### Example Agent Instructions for GitHub Interaction Source: https://docs.dust.tt/docs/github These instructions guide an agent on how to interact with GitHub repositories, specifying accessible repositories and a default choice. This helps the agent understand where to perform actions like filing issues. ```markdown Our repositories are the following: - https://github.com/dust-tt/dust (main code repository, public) - https://github.com/dust-tt/tasks (repository used for tasks tracking, private) If not specified the default repository to consider is our main one https://github.com/dust-tt/dust ``` -------------------------------- ### List Available Spaces (Ruby) Source: https://docs.dust.tt/reference/spaces Example of how to list available spaces in a Dust workspace using Ruby. This uses the 'net/http' library to perform a GET request. ```ruby require 'net/http' require 'uri' uri = URI.parse('https://dust.tt/api/v1/w/wId/spaces') response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http| request = Net::HTTP::Get.new uri.request_uri request['accept'] = 'application/json' http.request(request) end puts response.body ``` -------------------------------- ### Few-Shot Prompting for Translation (Example) Source: https://docs.dust.tt/reference/introduction-to-dust-apps This example demonstrates few-shot prompting, where a few input-output pairs are provided to guide the model. It's used here to show how to prompt a model to translate English text to French. The model learns the task from the provided examples without explicit instructions. ```text EN: Good Morning. FR: Bonjour. EN: The car is blue. FR: La voiture est bleue. EN: FR: ``` -------------------------------- ### List Available Spaces (Python) Source: https://docs.dust.tt/reference/spaces Example of how to list available spaces in a Dust workspace using Python. This uses the 'requests' library to perform a GET request. ```python import requests url = "https://dust.tt/api/v1/w/wId/spaces" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### List Available Spaces (Node.js) Source: https://docs.dust.tt/reference/spaces Example of how to list available spaces in a Dust workspace using Node.js. This uses the 'node-fetch' library to make a GET request to the API. ```javascript import fetch from 'node-fetch'; const options = { method: 'GET', headers: { 'accept': 'application/json' } }; fetch('https://dust.tt/api/v1/w/wId/spaces', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` -------------------------------- ### List Available Spaces (PHP) Source: https://docs.dust.tt/reference/spaces Example of how to list available spaces in a Dust workspace using PHP. This uses cURL to make the GET request to the API. ```php ``` -------------------------------- ### List Available Spaces (cURL) Source: https://docs.dust.tt/reference/spaces Example of how to list available spaces in a Dust workspace using cURL. This requires a GET request to the specified URL with an 'accept' header. ```shell curl --request GET \ --url https://dust.tt/api/v1/w/wId/spaces \ --header 'accept: application/json' ``` -------------------------------- ### List Agents API Response Example Source: https://docs.dust.tt/reference/workspace Provides an example of the JSON response structure when successfully retrieving agent configurations. ```json { "agentConfigurations": [ { "id": 12345, "sId": "7f3a9c2b1e", "version": 2, "versionCreatedAt": "2023-06-15T14:30:00Z", "versionAuthorId": "0ec9852c2f", "name": "Customer Support Agent", "description": "An AI agent designed to handle customer support inquiries", "instructions": "Always greet the customer politely and try to resolve their issue efficiently.", "pictureUrl": "https://example.com/agent-images/support-agent.png", "status": "active", "scope": "workspace", "userFavorite": true, "model": { "providerId": "openai", "modelId": "gpt-4", "temperature": 0.7 }, "actions": [], "maxStepsPerRun": 10, "templateId": "b4e2f1a9c7" } ] } ``` -------------------------------- ### Get Data Source View - Ruby Example Source: https://docs.dust.tt/reference/datasourceviews This snippet demonstrates how to fetch a data source view using Ruby's 'net/http' library. It constructs the request and handles the response, including potential errors. ```ruby require 'net/http' require 'uri' def get_data_source_view(w_id, space_id, dsv_id) uri = URI.parse("https://dust.tt/api/v1/w/#{w_id}/spaces/#{space_id}/data_source_views/#{dsv_id}") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Get.new(uri.request_uri) request['accept'] = 'application/json' response = http.request(request) if response.is_a?(Net::HTTPSuccess) return JSON.parse(response.body) else puts "Error: #{response.code} - #{response.message}" return nil end end # Example usage: # puts get_data_source_view('wId', 'spaceId', 'dsvId') ``` -------------------------------- ### Tera Templating for Data Block - Loop Source: https://docs.dust.tt/reference/quickstart This snippet demonstrates how to iterate over a dataset named 'EXAMPLES' using Tera templating within a 'chat' block. It formats company name, location, and employee count for each example, preparing it for few-shot prompting. ```Tera {% for e in EXAMPLES %} COMPANY NAME: {{e.companyName}} LOCATION: {{e.headquarters}} EMPLOYEES COUNT: {{e.employees}} {% endfor %} ``` -------------------------------- ### Install Dependencies and Clone Repository - Node.js Source: https://docs.dust.tt/docs/beta-import-dropbox-files Installs the necessary dependencies for the Dropbox importer script and clones the repository from GitHub. Requires Node.js and npm. ```bash git clone git@github.com:dust-tt/dust-labs.git cd dust-labs/dropbox npm install ``` -------------------------------- ### Dust App Translation Prompt - Tera Templating Source: https://docs.dust.tt/reference/introduction-to-dust-apps This code snippet demonstrates a Tera templating example for a translation Dust App. It iterates over few-shot examples and formats them along with user input for translation. The template is designed to be used within an LLM block in Dust. ```tera {% for e in EXAMPLES %} EN: {{e.english}} FR: {{e.french}} {% endfor %} EN: {{INPUT.english}} FR: ``` -------------------------------- ### Get Data Source View - PHP Example Source: https://docs.dust.tt/reference/datasourceviews This snippet provides a PHP implementation for retrieving a data source view using cURL. It sets up the cURL request, executes it, and processes the JSON response. ```php ``` -------------------------------- ### GET /websites/dust_tt/inquiries Source: https://docs.dust.tt/reference/post_api-v1-w-wid-assistant-conversations Retrieves a list of customer inquiries for the specified website. ```APIDOC ## GET /websites/dust_tt/inquiries ### Description Retrieves a list of customer inquiries for the specified website. ### Method GET ### Endpoint /websites/dust_tt/inquiries ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of inquiries to return. - **offset** (integer) - Optional - The number of inquiries to skip before returning results. ### Response #### Success Response (200) - **inquiries** (array) - An array of inquiry objects. - **id** (integer) - The unique identifier for the inquiry. - **sId** (string) - A unique string identifier for the inquiry. - **title** (string) - The title of the inquiry. - **visibility** (string) - The visibility setting of the inquiry. - **content** (array) - An array of message objects within the inquiry. - **id** (integer) - The unique identifier for the message. - **sId** (string) - A unique string identifier for the message. - **type** (string) - The type of the message. - **visibility** (string) - The visibility setting of the message. - **version** (integer) - The version of the message. - **created** (integer) - The timestamp when the message was created. - **user** (object) - Details about the user who sent the message. - **sId** (string) - A unique string identifier for the user. - **id** (integer) - The unique identifier for the user. - **createdAt** (integer) - The timestamp when the user account was created. - **username** (string) - The user's chosen username. - **email** (string) - The user's email address. - **firstName** (string) - The user's first name. - **lastName** (string) - The user's last name. - **fullName** (string) - The user's full name. - **provider** (string) - The authentication provider used by the user. - **image** (string) - The URL of the user's profile image. #### Response Example ```json { "inquiries": [ { "id": 1, "sId": "abc123xyz", "title": "Customer Inquiry #1234", "visibility": "private", "content": [ [ { "id": 1, "sId": "9e7d5c3a1f", "type": "human", "visibility": "visible", "version": 1, "created": 1625097700, "user": { "sId": "0ec9852c2f", "id": 12345, "createdAt": 1625097600, "username": "johndoe", "email": "john.doe@example.com", "firstName": "John", "lastName": "Doe", "fullName": "John Doe", "provider": "google", "image": "https://example.com/profile/johndoe.jpg" } } ] ] } ] } ``` ``` -------------------------------- ### GET /api/v1/w/{wId}/assistant/agent_configurations/search Source: https://docs.dust.tt/reference/get_api-v1-w-wid-assistant-agent-configurations-search Search for agent configurations by name in the workspace identified by {wId}. ```APIDOC ## GET /api/v1/w/{wId}/assistant/agent_configurations/search ### Description Search for agent configurations by name in the workspace identified by {wId}. ### Method GET ### Endpoint /api/v1/w/{wId}/assistant/agent_configurations/search ### Parameters #### Path Parameters - **wId** (string) - Required - ID of the workspace #### Query Parameters - **q** (string) - Required - Search query for agent configuration names ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **agentConfigurations** (array) - Successfully retrieved agent configurations - **id** (integer) - Example: 12345 - **sId** (string) - Unique string identifier for the agent configuration. Example: "7f3a9c2b1e" - **version** (integer) - Example: 2 - **versionCreatedAt** (string) - Timestamp of when the version was created. Example: "2023-06-15T14:30:00Z" - **versionAuthorId** (string) - ID of the user who created this version. Example: "0ec9852c2f" - **name** (string) - Name of the agent configuration. Example: "Customer Support Agent" - **description** (string) - Description of the agent configuration. Example: "An AI agent designed to handle customer support inquiries" - **instructions** (string) - Instructions for the agent. Example: "Always greet the customer politely and try to resolve their issue efficiently." - **pictureUrl** (string) - URL of the agent's picture. Example: "https://example.com/agent-images/support-agent.png" - **status** (string) - Current status of the agent configuration. Example: "active" - **scope** (string) - Scope of the agent configuration. Example: "workspace" - **userFavorite** (boolean) - Status of the user favorite for this configuration. Example: true #### Response Example ```json { "agentConfigurations": [ { "id": 12345, "sId": "7f3a9c2b1e", "version": 2, "versionCreatedAt": "2023-06-15T14:30:00Z", "versionAuthorId": "0ec9852c2f", "name": "Customer Support Agent", "description": "An AI agent designed to handle customer support inquiries", "instructions": "Always greet the customer politely and try to resolve their issue efficiently.", "pictureUrl": "https://example.com/agent-images/support-agent.png", "status": "active", "scope": "workspace", "userFavorite": true } ] } ``` ``` -------------------------------- ### GET /websites/dust_tt/agent/configurations Source: https://docs.dust.tt/reference/patch_api-v1-w-wid-assistant-agent-configurations-sid Retrieves a list of agent configurations associated with the project. ```APIDOC ## GET /websites/dust_tt/agent/configurations ### Description Retrieves a list of agent configurations for the specified project. ### Method GET ### Endpoint `/websites/dust_tt/agent/configurations` ### Parameters #### Query Parameters - **agentConfigurationId** (string) - Optional - The ID of the agent configuration to retrieve. ### Request Example (No request body for GET) ### Response #### Success Response (200) - **content** (object) - Contains the agent configuration details. - **agentConfiguration** (object) - Represents the agent configuration. - **isFavorite** (boolean) - Status of the user favorite for this configuration. - **model** (object) - Details about the AI model used. - **providerId** (string) - ID of the model provider. - **modelId** (string) - ID of the specific model. - **temperature** (number) - The temperature setting for the model. - **actions** (array) - List of actions available for the agent. - **maxStepsPerRun** (integer) - Maximum number of steps allowed per run. - **templateId** (string | null) - ID of the template used for this configuration. #### Response Example ```json { "content": { "agentConfiguration": { "isFavorite": true, "model": { "providerId": "openai", "modelId": "gpt-4", "temperature": 0.7 }, "actions": [], "maxStepsPerRun": 10, "templateId": "b4e2f1a9c7" } } } ``` #### Error Responses - **400**: Bad Request. Invalid or missing parameters. - **401**: Unauthorized. Invalid or missing authentication token. - **404**: Agent configuration not found. - **405**: Method not supported. Only GET or PATCH is expected. - **500**: Internal Server Error. ``` -------------------------------- ### GET /websites/dust_tt/agent-configurations Source: https://docs.dust.tt/reference/get_api-v1-w-wid-assistant-agent-configurations Retrieves a list of agent configurations. Supports filtering by workspace and inclusion of author information. ```APIDOC ## GET /websites/dust_tt/agent-configurations ### Description Retrieves a list of agent configurations for a given workspace. This endpoint supports optional query parameters to filter results and include additional data such as last authors. ### Method GET ### Endpoint `/websites/dust_tt/agent-configurations` ### Parameters #### Query Parameters - **workspace** (string) - Required - The ID of the workspace to retrieve agent configurations from. - **withAuthors** (boolean) - Optional - If true, includes the last author for each agent configuration. ### Response #### Success Response (200) - **configurations** (array) - An array of agent configuration objects. - **id** (string) - The unique identifier for the agent configuration. - **name** (string) - The name of the agent configuration. - **description** (string) - A detailed description of the agent configuration. - **pictureUrl** (string) - URL of the agent's picture. - **status** (string) - Current status of the agent configuration (e.g., "active"). - **scope** (string) - Scope of the agent configuration (e.g., "workspace"). - **userFavorite** (boolean) - Status of the user favorite for this configuration. - **model** (object) - Details about the AI model used. - **providerId** (string) - ID of the model provider (e.g., "openai"). - **modelId** (string) - ID of the specific model (e.g., "gpt-4"). - **temperature** (number) - The temperature setting for the model. - **actions** (array) - An array of actions associated with the configuration. - **maxStepsPerRun** (integer) - Maximum number of steps allowed per run. - **templateId** (string, nullable) - ID of the template used for this configuration. - **lastAuthors** (array, optional) - If `withAuthors=true`, this array contains information about the last authors. #### Error Response (400) - **description**: Bad Request. Missing or invalid parameters. #### Error Response (401) - **description**: Unauthorized. Invalid or missing authentication token, or attempting to access restricted views without authentication. #### Error Response (404) - **description**: Workspace not found. #### Error Response (405) - **description**: Method not supported. Only GET is expected. #### Error Response (500) - **description**: Internal Server Error. ### Response Example ```json { "configurations": [ { "id": "config-123", "name": "Support Agent", "description": "Handles customer support queries.", "pictureUrl": "https://example.com/agent-images/support-agent.png", "status": "active", "scope": "workspace", "userFavorite": true, "model": { "providerId": "openai", "modelId": "gpt-4", "temperature": 0.7 }, "actions": [], "maxStepsPerRun": 10, "templateId": "b4e2f1a9c7" } ] } ``` ``` -------------------------------- ### GET /api/v1/w/{wId}/assistant/agent_configurations Source: https://docs.dust.tt/reference/get_api-v1-w-wid-assistant-agent-configurations Retrieves a list of agent configurations for a specified workspace. Supports filtering by view and including author information. ```APIDOC ## GET /api/v1/w/{wId}/assistant/agent_configurations ### Description Get the agent configurations for the workspace identified by {wId}. ### Method GET ### Endpoint /api/v1/w/{wId}/assistant/agent_configurations ### Parameters #### Path Parameters - **wId** (string) - Required - ID of the workspace #### Query Parameters - **view** (string) - Optional - The view to use when retrieving agents: - all: Retrieves all non-private agents (default if not authenticated) - list: Retrieves all active agents accessible to the user (default if authenticated) - published: Retrieves all agents with published scope - global: Retrieves all global agents - favorites: Retrieves all agents marked as favorites by the user (only available to authenticated users) Enum: ["all", "list", "workspace", "published", "global", "favorites"] - **withAuthors** (string) - Optional - When set to 'true', includes recent authors information for each agent Enum: ["true", "false"] ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **agentConfigurations** (array) - Agent configurations for the workspace - **id** (integer) - Example: 12345 - **sId** (string) - Unique string identifier for the agent configuration. Example: "7f3a9c2b1e" - **version** (integer) - Example: 2 - **versionCreatedAt** (string) - Timestamp of when the version was created. Example: "2023-06-15T14:30:00Z" - **versionAuthorId** (string) - ID of the user who created this version. Example: "0ec9852c2f" - **name** (string) - Name of the agent configuration. Example: "Customer Support Agent" - **description** (string) - Description of the agent configuration. Example: "An AI agent designed to handle customer support inquiries" - **instructions** (string) - Instructions for the agent. Example: "Always greet the customer politely and try to resolve their issue efficiently." - **pictureUrl** (string) #### Response Example ```json { "agentConfigurations": [ { "id": 12345, "sId": "7f3a9c2b1e", "version": 2, "versionCreatedAt": "2023-06-15T14:30:00Z", "versionAuthorId": "0ec9852c2f", "name": "Customer Support Agent", "description": "An AI agent designed to handle customer support inquiries", "instructions": "Always greet the customer politely and try to resolve their issue efficiently.", "pictureUrl": "https://dust.tt/static/agents/default_agent_icon.png" } ] } ``` ``` -------------------------------- ### GET /api/v1/w/{wId}/spaces/{spaceId}/apps/{aId}/runs/{runId} Source: https://docs.dust.tt/reference/get_api-v1-w-wid-spaces-spaceid-apps-aid-runs-runid Retrieve a run for an app in the space identified by {spaceId}. ```APIDOC ## GET /api/v1/w/{wId}/spaces/{spaceId}/apps/{aId}/runs/{runId} ### Description Retrieve a run for an app in the space identified by {spaceId}. ### Method GET ### Endpoint `/api/v1/w/{wId}/spaces/{spaceId}/apps/{aId}/runs/{runId}` ### Parameters #### Path Parameters - **wId** (string) - Required - Unique string identifier for the workspace - **spaceId** (string) - Required - ID of the space - **aId** (string) - Required - ID of the app - **runId** (string) - Required - ID of the run ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **run** (object) - The run details - **run_id** (string) - The ID of the run - **app_id** (string) - The ID of the app - **status** (object) - The status of the run and its build - **run** (string) - The status of the run - **build** (string) - The status of the build - **results** (object) - The results of the run - **specification_hash** (string) - The hash of the app specification - **traces** (array) - An array of traces for the run #### Response Example ```json { "run": { "run_id": "4a2c6e8b0d", "app_id": "9f1d3b5a7c", "status": { "run": "succeeded", "build": "succeeded" }, "results": {}, "specification_hash": "8c0a4e6d2f", "traces": [ [ { "timestamp": 1234567890, "trace": {} } ] ] } } ``` ``` -------------------------------- ### Get Data Source View - Python Example Source: https://docs.dust.tt/reference/datasourceviews This snippet illustrates how to get a data source view using Python's 'requests' library. It makes a GET request to the API endpoint and returns the JSON response. ```python import requests def get_data_source_view(w_id, space_id, dsv_id): url = f"https://dust.tt/api/v1/w/{w_id}/spaces/{space_id}/data_source_views/{dsv_id}" headers = { 'accept': 'application/json' } response = requests.get(url, headers=headers) response.raise_for_status() # Raise an exception for bad status codes return response.json() # Example usage: # try: # data = get_data_source_view('wId', 'spaceId', 'dsvId') # print(data) # except requests.exceptions.RequestException as e: # print(f"Error: {e}") ``` -------------------------------- ### Instruction Following for Summarization (Example) Source: https://docs.dust.tt/reference/introduction-to-dust-apps This snippet illustrates instruction-following prompting for text summarization. It shows how to provide a long text and a direct instruction to generate a summary. This method is noted as potentially brittle for models not specifically fine-tuned for instruction following. ```text Generate a 1-paragraph summary of the text above: ``` -------------------------------- ### Get Data Source View - Node.js Example Source: https://docs.dust.tt/reference/datasourceviews This snippet shows how to retrieve a data source view using Node.js. It utilizes the 'axios' library for making the HTTP GET request and includes basic error handling. ```javascript const axios = require('axios'); async function getDataSourceView(wId, spaceId, dsvId) { try { const response = await axios.get(`https://dust.tt/api/v1/w/${wId}/spaces/${spaceId}/data_source_views/${dsvId}`, { headers: { 'accept': 'application/json' } }); return response.data; } catch (error) { console.error('Error fetching data source view:', error); throw error; } } // Example usage: // getDataSourceView('wId', 'spaceId', 'dsvId').then(data => console.log(data)); ``` -------------------------------- ### Example Agent Instructions for Issue Creation Source: https://docs.dust.tt/docs/github Detailed instructions for an agent tasked with creating GitHub issues. It specifies repository access, differentiates between task types (eng runner vs. team tasks), and provides fallback mechanisms and conditional logic for filing issues in public or private repositories. ```markdown Your role is to create GitHub issues for the team based on context. Our repositories are the following: - https://github.com/dust-tt/dust (main code repository, public) - https://github.com/dust-tt/tasks (repository used for tasks tracking, private) We have two types of tasks: Eng runner tasks, and team tasks (ongoing projects). Only file an eng runner task when "eng runner" (or "runner" or clearly similar) is explicitly mentioned. Otherwise, if a project or initiative is mentioned you can safely assume that it's a "team task". In case of doubts you can list the projects of the organization dust-tt first to discover the team tasks streams (projects) and infer from that. Fallback is simply to file an issue on the appropriate repository. If the request mentions filing a "public issue" doe not use `dust-tt/tasks` but rather `dust-tt/dust` (which is public). ``` -------------------------------- ### Example JSON Response for Feedbacks Source: https://docs.dust.tt/reference/feedbacks This snippet shows an example of a successful JSON response when retrieving feedback entries for a conversation. It details the structure of the 'feedbacks' array and the properties of each feedback object, including message IDs, user IDs, feedback direction, content, and timestamps. ```json { "feedbacks": [ { "messageId": "string", "agentMessageId": 0, "userId": 0, "thumbDirection": "up", "content": "string", "createdAt": 0, "agentConfigurationId": "string", "agentConfigurationVersion": 0, "isConversationShared": true } ] } ``` -------------------------------- ### POST /api/v1/w/{wId}/spaces/{spaceId}/apps/{aId}/runs Source: https://docs.dust.tt/reference/post_api-v1-w-wid-spaces-spaceid-apps-aid-runs Create and execute a run for an app in the specified space. ```APIDOC ## POST /api/v1/w/{wId}/spaces/{spaceId}/apps/{aId}/runs ### Description Create and execute a run for an app in the space specified by {spaceId}. ### Method POST ### Endpoint /api/v1/w/{wId}/spaces/{spaceId}/apps/{aId}/runs ### Parameters #### Path Parameters - **wId** (string) - Required - Unique string identifier for the workspace - **spaceId** (string) - Required - ID of the space - **aId** (string) - Required - Unique identifier of the app #### Request Body - **specification_hash** (string) - Required - Hash of the app specification. Ensures API compatibility across app iterations. - **config** (object) - Required - Configuration for the app run - **model** (object) - Optional - Model configuration - **provider_id** (string) - Optional - ID of the model provider - **model_id** (string) - Optional - ID of the model - **use_cache** (boolean) - Optional - Whether to use caching - **use_stream** (boolean) - Optional - Whether to use streaming - **inputs** (array) - Required - Array of input objects for the app - items (object) - Additional properties allowed - **stream** (boolean) - Optional - If true, the response will be streamed - **blocking** (boolean) - Optional - If true, the request will block until the run is complete - **block_filter** (array) - Optional - Array of block names to filter the response ### Request Example ```json { "specification_hash": "a1b2c3d4e5f6", "config": { "model": { "provider_id": "openai", "model_id": "gpt-3.5-turbo", "use_cache": true, "use_stream": false } }, "inputs": [ { "type": "text", "content": "Hello, world!" } ], "stream": false, "blocking": true, "block_filter": ["output"] } ``` ### Response #### Success Response (200) - **run** (object) - Description of the run object - **run_id** (string) - The ID of the run - **app_id** (string) - The ID of the app #### Response Example ```json { "run": { "run_id": "4a2c6e8b0d", "app_id": "your-app-id" } } ``` ``` -------------------------------- ### Get Workspace Usage Data (API) Source: https://docs.dust.tt/reference/get_api-v1-w-wid-workspace-usage Retrieves usage data for a specified workspace ({wId}). Supports CSV, JSON, and ZIP formats. Requires a start date and a mode (month/range). Additional parameters include end date, format, and the specific table of usage data to retrieve (e.g., users, assistants, all). ```json { "openapi": "3.0.0", "info": { "title": "DUST API Documentation", "version": "1.0.2", "description": "The OpenAPI specification for the Dust.tt API", "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" } }, "servers": [ { "url": "https://dust.tt", "description": "Dust.tt API (us-central1)" }, { "url": "https://eu.dust.tt", "description": "Dust.tt API (europe-west1)" } ], "paths": { "/api/v1/w/{wId}/workspace-usage": { "get": { "summary": "Get workspace usage data", "description": "Get usage data for the workspace identified by {wId} in CSV or JSON format.", "tags": [ "Workspace" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "in": "path", "name": "wId", "required": true, "description": "Unique string identifier for the workspace", "schema": { "type": "string" } }, { "in": "query", "name": "start", "required": true, "description": "The start date in YYYY-MM or YYYY-MM-DD format", "schema": { "type": "string" } }, { "in": "query", "name": "end", "required": false, "description": "The end date in YYYY-MM or YYYY-MM-DD format (required when mode is 'range')", "schema": { "type": "string" } }, { "in": "query", "name": "mode", "required": true, "description": "The mode of date range selection", "schema": { "type": "string", "enum": [ "month", "range" ] } }, { "in": "query", "name": "format", "required": false, "description": "The output format of the data (defaults to 'csv')", "schema": { "type": "string", "enum": [ "csv", "json" ] } }, { "in": "query", "name": "table", "required": true, "description": "The name of the usage table to retrieve:\n- \"users\": The list of users categorized by their activity level.\n- \"inactive_users\": The of users that didn't sent any messages\n- \"assistant_messages\": The list of messages sent by users including the mentioned agents.\n- \"builders\": The list of builders categorized by their activity level.\n- \"assistants\": The list of workspace agents and their corresponding usage.\n- \"feedback\": The list of feedback given by users on the agent messages.\n- \"all\": A concatenation of all the above tables.\n", "schema": { "type": "string", "enum": [ "users", "inactive_users", "assistant_messages", "builders", "assistants", "feedback", "all" ] } } ], "responses": { "200": { "description": "The usage data in CSV or JSON format, or a ZIP of multiple CSVs if table is equal to \"all\"", "content": { "text/csv": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "object" } }, "application/zip": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "description": "Invalid request query" }, "403": { "description": "The workspace does not have access to the usage data API" }, "404": { "description": "The workspace was not found" }, "405": { "description": "Method not supported" } } } } }, "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Your DUST API key is a Bearer token." } } } } ``` -------------------------------- ### List MCP Server Views (cURL) Source: https://docs.dust.tt/reference/tools-1 This snippet demonstrates how to list MCP server views for a given workspace and space using cURL. It specifies the GET request method, the endpoint URL, and the expected JSON 'accept' header. No specific input parameters are required beyond the workspace and space IDs in the URL. ```shell curl --request GET \ --url https://dust.tt/api/v1/w/wId/spaces/spaceId/mcp_server_views \ --header 'accept: application/json' ``` -------------------------------- ### Tera Templating for LLM Prompts Source: https://docs.dust.tt/reference/core-blocks Demonstrates how to use the Tera templating language to construct few-shot prompts for LLM models. It iterates over examples and formats input data for model processing. This is useful for dynamic prompt generation based on available data. ```tera {% for e in EXAMPLES %} EN: {{e.english}} FR: {{e.french}} {% endfor %} EN: {{INPUT.english}} FR: ``` -------------------------------- ### GET /api/v1/w/{wId}/assistant/conversations/{cId}/feedbacks Source: https://docs.dust.tt/reference/feedbacks Retrieves all feedback entries for a specific conversation. Requires authentication and read:conversation scope. ```APIDOC ## GET /api/v1/w/{wId}/assistant/conversations/{cId}/feedbacks ### Description Retrieves all feedback entries for a specific conversation. ### Method GET ### Endpoint /api/v1/w/{wId}/assistant/conversations/{cId}/feedbacks ### Parameters #### Path Parameters - **wId** (string) - Required - Workspace ID - **cId** (string) - Required - Conversation ID ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **feedbacks** (array of objects) - List of feedback entries for the conversation - **messageId** (string) - ID of the message that received feedback - **agentMessageId** (number) - ID of the agent message - **userId** (number) - ID of the user who gave feedback - **thumbDirection** (string) - enum: `up`, `down` - Direction of the thumb feedback - **content** (string | null) - Optional feedback content/comment - **createdAt** (number) - Timestamp when feedback was created - **agentConfigurationId** (string) - ID of the agent configuration - **agentConfigurationVersion** (number) - Version of the agent configuration - **isConversationShared** (boolean) - Whether the conversation was shared #### Error Responses - **400** - Invalid request parameters - **401** - Unauthorized - **403** - Forbidden - **404** - Conversation not found - **500** - Internal server error #### Response Example ```json { "feedbacks": [ { "messageId": "string", "agentMessageId": 0, "userId": 0, "thumbDirection": "up", "content": "string", "createdAt": 0, "agentConfigurationId": "string", "agentConfigurationVersion": 0, "isConversationShared": true } ] } ``` ``` -------------------------------- ### List MCP Server Views (Node.js) Source: https://docs.dust.tt/reference/tools-1 This Node.js code snippet shows how to fetch a list of MCP server views using the `undici` HTTP client. It constructs the URL with provided workspace and space IDs and sends a GET request with an 'accept: application/json' header. The response is then parsed as JSON. ```javascript import { request } from 'undici'; async function listMcpServerViews(wId, spaceId) { const { body } = await request(`https://dust.tt/api/v1/w/${wId}/spaces/${spaceId}/mcp_server_views`, { method: 'GET', headers: { 'accept': 'application/json' } }); return await body.json(); } ``` -------------------------------- ### Get Data Source View - cURL Request Source: https://docs.dust.tt/reference/datasourceviews This snippet demonstrates how to make a GET request to retrieve a specific data source view using cURL. It includes the endpoint URL and necessary headers. ```shell curl --request GET \ --url https://dust.tt/api/v1/w/wId/spaces/spaceId/data_source_views/dsvId \ --header 'accept: application/json' ``` -------------------------------- ### Execute Dust App via API using Curl Source: https://docs.dust.tt/reference/quickstart This example demonstrates how to execute a Dust application programmatically using a curl command. It includes a sample curl command with placeholders for an API key and specifies the expected input format for the application. The command is designed to be run from a terminal after saving it as a shell script. ```bash #!/bin/sh curl -X POST 'YOUR_API_ENDPOINT' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "inputs": [{ "currentCompany": "La Poste", "currentCity": "Paris; France"}]}' ``` -------------------------------- ### Get Conversation Feedbacks via cURL Source: https://docs.dust.tt/reference/feedbacks This snippet demonstrates how to retrieve feedback entries for a specific conversation using a cURL request. It includes the HTTP method, URL with placeholders for workspace and conversation IDs, and the 'accept' header. ```shell curl --request GET \ --url https://dust.tt/api/v1/w/wId/assistant/conversations/cId/feedbacks \ --header 'accept: application/json' ``` -------------------------------- ### List MCP Server Views (Ruby) Source: https://docs.dust.tt/reference/tools-1 This Ruby code snippet demonstrates how to retrieve MCP server views using the built-in Net::HTTP library. It defines the workspace and space IDs, constructs the request URL, and sends a GET request with the appropriate 'Accept' header. The response body is returned. ```ruby require 'net/http' require 'uri' def list_mcp_server_views(w_id, space_id) uri = URI.parse("https://dust.tt/api/v1/w/#{w_id}/spaces/#{space_id}/mcp_server_views") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Get.new(uri.request_uri) request['accept'] = 'application/json' response = http.request(request) JSON.parse(response.body) end ``` -------------------------------- ### Receive Webhook Trigger - Ruby Example Source: https://docs.dust.tt/reference/triggers This Ruby example shows how to make an HTTP POST request to the Dust API to trigger a flow via webhook. It uses the built-in 'net/http' library. ```ruby require 'net/http' require 'uri' require 'json' def trigger_webhook(w_id, webhook_source_id, data) uri = URI.parse("https://dust.tt/api/v1/w/#{w_id}/triggers/hooks/#{webhook_source_id}") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Post.new(uri.request_uri) request['content-type'] = 'application/json' request.body = data.to_json response = http.request(request) if response.is_a?(Net::HTTPSuccess) puts "Webhook received successfully: #{response.body}" return response.body else puts "Error triggering webhook: #{response.code} #{response.message}" raise "Error triggering webhook: #{response.code} #{response.message}" end end # Example usage: # w_id = 'your_workspace_id' # webhook_source_id = 'your_webhook_source_id' # payload = { key: 'value' } # Your webhook payload # trigger_webhook(w_id, webhook_source_id, payload) ```