diff --git a/components/dust/actions/talk-assistant/talk-assistant.mjs b/components/dust/actions/run-agent/run-agent.mjs similarity index 63% rename from components/dust/actions/talk-assistant/talk-assistant.mjs rename to components/dust/actions/run-agent/run-agent.mjs index 17ec47e2b9f01..37965dac8ff7e 100644 --- a/components/dust/actions/talk-assistant/talk-assistant.mjs +++ b/components/dust/actions/run-agent/run-agent.mjs @@ -2,23 +2,21 @@ import { TIMEZONE_OPTIONS } from "../../common/constants.mjs"; import dust from "../../dust.app.mjs"; export default { - key: "dust-talk-assistant", - name: "Talk to Assistant", - description: "Send a message to an assistant on Dust and receive an answer. [See the documentation](https://docs.dust.tt/reference/post_api-v1-w-wid-assistant-conversations-cid-messages)", - version: "0.0.1", + key: "dust-run-agent", + name: "Run an Agent", + description: + "Send a message to an agent on Dust and receive an answer. [See the documentation](https://docs.dust.tt/reference/post_api-v1-w-wid-assistant-conversations-cid-messages)", + version: "0.0.2", type: "action", props: { dust, - assistantId: { - propDefinition: [ - dust, - "assistantId", - ], + agentId: { + propDefinition: [dust, "agentId"], }, content: { type: "string", label: "Message Content", - description: "The content of the message to be sent to the assistant", + description: "The content of the message to be sent to the agent", }, timezone: { type: "string", @@ -36,11 +34,16 @@ export default { label: "Email", description: "Put an email if needed.", }, + skipToolsValidation: { + type: "boolean", + label: "Skip Tools Validation", + default: false, + description: + "Skip all tools validation. All tools will be run by the agent without user validation.", + }, }, async run({ $ }) { - const { - conversation, message, - } = await this.dust.sendMessageToAssistant({ + const { conversation, message } = await this.dust.sendMessageToAgent({ $, data: { message: { @@ -54,17 +57,18 @@ export default { }, mentions: [ { - configurationId: this.assistantId, + configurationId: this.agentId, }, ], }, blocking: true, + skipToolsValidation: this.skipToolsValidation, visibility: "unlisted", title: null, }, }); - $.export("$summary", "Successfully sent message to assistant"); + $.export("$summary", "Successfully sent message to agent"); return { agentMessage: conversation.content[1][0].content, conversationUrl: `https://dust.tt/w/${conversation.owner.sId}/assistant/${conversation.sId}`, diff --git a/components/dust/dust.app.mjs b/components/dust/dust.app.mjs index 2a8dc14cf7b50..17a3eb27192e7 100644 --- a/components/dust/dust.app.mjs +++ b/components/dust/dust.app.mjs @@ -4,16 +4,15 @@ export default { type: "app", app: "dust", propDefinitions: { - assistantId: { + agentId: { type: "string", - label: "Assistant ID", - description: "Select the name of your Assistant from the list. Your Dust Assistant must be a **Shared** or **Company** Assistant. Personal Assistants are not visible in this list.", + label: "Agent ID", + description: + "Select the name of your Agent from the list. Non **Published** agents are not visible in this list.", async options() { - const { agentConfigurations } = await this.listAssistants(); + const { agentConfigurations } = await this.listAgents(); - return agentConfigurations.map(({ - description, name, sId: value, - }) => ({ + return agentConfigurations.map(({ description, name, sId: value }) => ({ label: `${name} - ${description}`, value, })); @@ -26,9 +25,7 @@ export default { async options() { const { data_sources: ds } = await this.listDataSources(); - return ds.map(({ - description, name, dustAPIDataSourceId: value, - }) => ({ + return ds.map(({ description, name, dustAPIDataSourceId: value }) => ({ label: `${name} - ${description}`, value, })); @@ -44,16 +41,14 @@ export default { Authorization: `Bearer ${this.$auth.api_key}`, }; }, - _makeRequest({ - $ = this, path, ...opts - }) { + _makeRequest({ $ = this, path, ...opts }) { return axios($, { url: this._baseUrl() + path, headers: this._headers(), ...opts, }); }, - listAssistants(opts = {}) { + listAgents(opts = {}) { return this._makeRequest({ path: "/assistant/agent_configurations", ...opts, @@ -65,16 +60,14 @@ export default { ...opts, }); }, - sendMessageToAssistant(opts = {}) { + sendMessageToAgent(opts = {}) { return this._makeRequest({ method: "POST", path: "/assistant/conversations", ...opts, }); }, - upsertDocument({ - documentId, dataSourceId, ...opts - }) { + upsertDocument({ documentId, dataSourceId, ...opts }) { return this._makeRequest({ method: "POST", path: `/data_sources/${dataSourceId}/documents/${documentId}`, diff --git a/components/dust/package.json b/components/dust/package.json index de2d79e946f0d..90545421117a7 100644 --- a/components/dust/package.json +++ b/components/dust/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/dust", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream Dust Components", "main": "dust.app.mjs", "keywords": [