Skip to main content

Dify

Dify

Properties used to connect to Dify.

dify

  • Type: true | { inputs?: object, user?: string, files?: {type: "file"|"collection", id: string}[]}

  • Default: {user: "user"}

Connect to Dify's Chat API. You can set this property to true or configure it using an object:
inputs is an object containing custom input variables defined in your Dify application.
user is the user identifier for the conversation.
files is an array of pre-uploaded file references to include in the conversation. Each object requires a type ("file" or "collection") and an id referencing the uploaded file.

Example

<deep-chat
directConnection='{
"dify": {
"key": "placeholder key",
"user": "deep-chat-user"
}
}'
></deep-chat>
info

Use stream to stream the AI responses.

File Upload Example

Upload files (images, documents, audio, video) alongside your messages:

<deep-chat
directConnection='{
"dify": {"key": "placeholder key"}
}'
images="true"
mixedFiles="true"
></deep-chat>
tip

Files are automatically uploaded to Dify's file upload endpoint before being included in the chat message. Supported file types include images, documents, audio, and video.

Getting Your API Key

To use Dify with Deep Chat, you need to:

  1. Create a Dify account at dify.ai or set up a self-hosted instance
  2. Create an application (Chatbot, Agent, or Workflow)
  3. Get your API key from the application's API Access page
tip

Your API key can be found in your Dify application under API Access in the left sidebar. See the Dify API documentation for more details.