capabilities.work

Attach a File and Ask an Agent

A 3-step recipe with Dust. We can help you get access.

Recipe · 3 steps

Attach a File and Ask an Agent

with Dust

Upload a file, attach it as a content fragment, and ask an agent about it.

  1. Reserve a file upload URL for the conversation use case and capture the file identifier to reference in the content fragment.
  2. Attach the uploaded file to the conversation as a content fragment so the agent can read it.
  3. Post a message mentioning the agent so it reasons over the attached content fragment.
What you'll need to have ready
  • apiToken: Dust API key used as the Bearer token.
  • wId: The workspace identifier.
  • cId: The identifier of the existing conversation.
  • agentConfigurationId: The sId of the agent configuration to mention.
  • fileName: Name of the file being uploaded.
  • contentType: MIME type of the file being uploaded.
  • fileSize: Size of the file in bytes.
  • useCaseMetadata: Use case metadata; for conversations a stringified dictionary containing conversationId.
  • fragmentTitle: Title for the content fragment.
  • content: The text of the message asking the agent about the attached file.
For your developer

Arazzo workflow dust-tt:attach-file-and-ask, 3 operations: {$sourceDescriptions.conversationsApi.url}#/paths/~1api~1v1~1w~1{wId}~1files/post → {$sourceDescriptions.conversationsApi.url}#/paths/~1api~1v1~1w~1{wId}~1assistant~1conversations~1{cId}~1content_fragments/post → {$sourceDescriptions.conversationsApi.url}#/paths/~1api~1v1~1w~1{wId}~1assistant~1conversations~1{cId}~1messages/post. Specs on APIs.io.