# Dify Enterprise Docs: Chinese 3.13.x 开发者资源 ## 开发者资源 ### Workspace API #### 指南 - [Dify API 快速开始](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/get-started.md): 获取 API 密钥、发起第一个请求,并找到你的应用类型对应的接口 - [处理流式响应](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/streaming.md): 选择响应模式、解析 SSE 流、按事件类型分发处理,并在连接断开后恢复 - [人工介入 API 集成流程](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/human-input-flow.md): 通过 API 处理暂停中的人工介入表单的端到端流程 - [终端用户身份](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/end-user-identity.md): user 字段标识什么、限定哪些数据,以及为何要在各次调用间保持一致 - [处理错误与速率限制](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/errors.md): 错误响应的统一结构、各状态码类别的含义,以及哪些失败值得重试 - [部署环境](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/deployed-environments.md): 调用运行在部署环境中的应用,了解它们专有的基础 URL、认证方式和错误码 ##### API 概览 - [Chatflow 应用 API](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/chatflow.md): Chatflow 应用 API,涵盖对话消息、工作流级别流式事件、会话管理、人工介入暂停 - [Workflow 应用 API](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/workflow.md): Workflow 应用 API,涵盖工作流执行、运行控制与流式传输、人工介入暂停、运行历史查询 - [Agent API](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/agent.md): 面向 Agent 应用的 API,涵盖流式对话消息、会话管理、文件上传及应用配置 - [知识库 API](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/knowledge.md): 用于管理知识库、文档、分段、元数据、标签和知识流水线的 API - [对话型应用 API](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/chat.md): 面向聊天助手和旧版 Agent 应用的 API,涵盖对话消息、会话管理、文件上传、语音转换及标注管理 - [文本生成应用 API](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/guides/completion.md): 面向文本生成应用的 API,涵盖文本生成消息、文件上传、语音转换及反馈收集 #### 应用 API ##### 对话消息 - [发送对话消息](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chat-messages/send-chat-message.md): **适用于**:Chatflow、Agent、聊天助手、旧版 Agent。 - [停止对话消息生成](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chat-messages/stop-chat-message-generation.md): **适用于**:Chatflow、Agent、聊天助手、旧版 Agent。 - [获取下一轮建议问题列表](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chat-messages/get-next-suggested-questions.md): **适用于**:Chatflow、Agent、聊天助手、旧版 Agent。 ##### 文本生成消息 - [发送消息](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/completion-messages/send-completion-message.md): **适用于**:文本生成应用。 - [停止消息生成](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/completion-messages/stop-completion-message-generation.md): **适用于**:文本生成应用。 ##### 工作流运行 - [执行工作流](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/workflow-runs/run-workflow.md): **适用于**:Workflow。 - [按 ID 执行工作流](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/workflow-runs/run-workflow-by-id.md): **适用于**:Workflow。 - [停止工作流任务](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/workflow-runs/stop-workflow-task.md): **适用于**:Workflow。 - [获取工作流执行情况](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/workflow-runs/get-workflow-run-detail.md): **适用于**:Chatflow、Workflow。 - [获取工作流日志](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/workflow-runs/list-workflow-logs.md): **适用于**:Chatflow、Workflow。 - [流式获取工作流事件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/workflow-runs/stream-workflow-events.md): **适用于**:Chatflow、Workflow。 ##### 会话管理 - [获取会话列表](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/conversations/list-conversations.md): **适用于**:Chatflow、Agent、聊天助手、旧版 Agent。 - [获取会话历史消息](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/conversations/list-conversation-messages.md): **适用于**:Chatflow、Agent、聊天助手、旧版 Agent。 - [获取会话变量](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/conversations/list-conversation-variables.md): **适用于**:Chatflow、聊天助手、旧版 Agent。 - [重命名会话](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/conversations/rename-conversation.md): **适用于**:Chatflow、Agent、聊天助手、旧版 Agent。 - [更新会话变量](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/conversations/update-conversation-variable.md): **适用于**:Chatflow、聊天助手、旧版 Agent。 - [删除会话](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/conversations/delete-conversation.md): **适用于**:Chatflow、Agent、聊天助手、旧版 Agent。 ##### 文件操作 - [上传文件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/files/upload-file.md): **适用于**:Chatflow、Workflow、Agent、聊天助手、旧版 Agent、文本生成应用。 - [下载文件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/files/download-file.md): **适用于**:Chatflow、聊天助手、旧版 Agent、文本生成应用。 ##### 语音与文字转换 - [语音转文字](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/audio/convert-audio-to-text.md): **适用于**:Chatflow、Workflow、Agent、聊天助手、旧版 Agent、文本生成应用。 - [文字转语音](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/audio/convert-text-to-audio.md): **适用于**:Chatflow、Workflow、Agent、聊天助手、旧版 Agent、文本生成应用。 ##### 应用配置 - [获取应用基本信息](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/applications/get-app-info.md): **适用于**:Chatflow、Workflow、Agent、聊天助手、旧版 Agent、文本生成应用。 - [获取应用参数](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/applications/get-app-parameters.md): **适用于**:Chatflow、Workflow、Agent、聊天助手、旧版 Agent、文本生成应用。 - [获取应用元数据](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/applications/get-app-meta.md): **适用于**:Chatflow、Workflow、Agent、聊天助手、旧版 Agent、文本生成应用。 - [获取应用 WebApp 设置](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/applications/get-app-webapp-settings.md): **适用于**:Chatflow、Workflow、Agent、聊天助手、旧版 Agent、文本生成应用。 ##### 消息反馈 - [提交消息反馈](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/feedback/submit-message-feedback.md): **适用于**:Chatflow、聊天助手、旧版 Agent、文本生成应用。 - [获取应用的消息反馈](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/feedback/list-app-feedbacks.md): **适用于**:Chatflow、聊天助手、旧版 Agent、文本生成应用。 ##### 标注管理 - [创建标注](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/annotations/create-annotation.md): **适用于**:Chatflow、聊天助手、旧版 Agent。 - [获取标注列表](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/annotations/list-annotations.md): **适用于**:Chatflow、聊天助手、旧版 Agent。 - [更新标注](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/annotations/update-annotation.md): **适用于**:Chatflow、聊天助手、旧版 Agent。 - [删除标注](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/annotations/delete-annotation.md): **适用于**:Chatflow、聊天助手、旧版 Agent。 - [配置标注回复](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/annotations/configure-annotation-reply.md): **适用于**:Chatflow、聊天助手、旧版 Agent。 - [查询标注回复配置任务状态](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/annotations/get-annotation-reply-job-status.md): **适用于**:Chatflow、聊天助手、旧版 Agent。 ##### 终端用户 - [获取终端用户信息](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/end-users/get-end-user-info.md): **适用于**:Chatflow、Workflow、Agent、聊天助手、旧版 Agent、文本生成应用。 ##### 人工介入 - [获取人工介入表单](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/human-input/get-human-input-form.md): **适用于**:Chatflow、Workflow。 - [提交人工介入表单](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/human-input/submit-human-input-form.md): **适用于**:Chatflow、Workflow。 ##### 部署环境 - [发送对话消息](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/send-chat-message.md): **适用于**:Chatflow。 - [停止对话消息生成](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/stop-chat-message-generation.md): **适用于**:Chatflow。 - [执行工作流](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/run-workflow.md): **适用于**:Workflow。 - [停止工作流任务](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/stop-workflow-task.md): **适用于**:Workflow。 - [获取会话列表](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/list-conversations.md): **适用于**:Chatflow。 - [删除会话](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/delete-conversation.md): **适用于**:Chatflow。 - [重命名会话](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/rename-conversation.md): **适用于**:Chatflow。 - [获取会话历史消息](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/list-conversation-messages.md): **适用于**:Chatflow。 - [获取会话变量](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/list-conversation-variables.md): **适用于**:Chatflow。 - [更新会话变量](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/update-conversation-variable.md): **适用于**:Chatflow。 - [下载文件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/download-file.md): **适用于**:Workflow、Chatflow。 - [上传文件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/deployed-environments/upload-file.md): **适用于**:Workflow、Chatflow。 #### 知识库 API ##### 知识库 - [创建空知识库](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/knowledge-bases/create-an-empty-knowledge-base.md): 创建一个空知识库。之后用 [从文本创建文档](/zh/3.13.x/develop/api/documents/create-document-by-text) 或 [从文件创建文档](/zh/3.13.x/develop/api/documents/create-document-by-file) 向其中添加文档。 - [获取知识库列表](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/knowledge-bases/list-knowledge-bases.md): 返回知识库的分页列表,可按关键词或标签筛选。 - [获取知识库详情](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/knowledge-bases/get-knowledge-base.md): 返回知识库的详细信息,包括嵌入模型、检索配置和文档统计信息。 - [更新知识库](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/knowledge-bases/update-knowledge-base.md): 更新知识库。仅更改请求体中包含的字段。 - [删除知识库](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/knowledge-bases/delete-knowledge-base.md): 永久删除知识库、其中的所有文档,以及只绑定了该知识库的 API 密钥。同时绑定了其他知识库的密钥仍可继续访问那些知识库。 - [从知识库检索分段 / 测试检索](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/knowledge-bases/retrieve-chunks-from-a-knowledge-base-test-retrieval.md): 搜索知识库,返回与查询最相关的分段,可用于生产环境检索和测试检索。 ##### 文档 - [从文本创建文档](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/create-document-by-text.md): 在知识库中通过纯文本创建文档。索引异步进行;使用返回的 `batch` ID 通过 [获取文档嵌入状态(进度)](/zh/3.13.x/develop/api/documents/get-document-indexing-status) 跟踪。 - [从文件创建文档](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/create-document-by-file.md): 在知识库中通过上传文件创建文档。支持 PDF、TXT、DOCX 等常见格式。索引异步进行;使用返回的 `batch` ID 通过 [获取文档嵌入状态(进度)](/zh/3.13.x/develop/api/documents/get-document-indexing-status) 跟踪。 - [获取知识库的文档列表](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/list-documents.md): 返回知识库中文档的分页列表。 - [获取文档详情](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/get-document.md): 返回单个文档的详细信息。 - [删除文档](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/delete-document.md): 从知识库中永久删除文档及其所有分段。 - [更新文档](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/update-document.md): 通过上传新文件更新文档,然后重新索引。这是基于文件更新文档的规范端点。使用返回的 `batch` ID 通过 [获取文档嵌入状态(进度)](/zh/3.13.x/develop/api/documents/get-document-indexing-status) 跟踪进度。 - [下载文档](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/download-document.md): 返回用于下载文档原始上传文件的签名 URL。 - [获取文档嵌入状态(进度)](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/get-document-indexing-status.md): 返回批次中每个文档的索引进度:当前阶段和分段完成计数。轮询直到每个 `indexing_status` 变为 `completed` 或 `error`。状态按 `waiting` → `parsing` → `cleaning` → `splitting` → `indexing` → `completed` 推进。 - [用文本更新文档](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/update-document-by-text.md): 更新文档的文本内容、名称或处理配置。文本变更时会重新索引文档。 - [用文件更新文档](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/update-document-by-file.md): 已弃用。改用 [更新文档](/zh/3.13.x/develop/api/documents/update-document)。通过上传新文件更新文档,然后重新索引。 - [批量下载文档(ZIP)](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/download-documents-as-zip.md): 将一个或多个文档下载为单个 ZIP 压缩包。仅可包含以文件形式上传的文档。 - [批量更新文档状态](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/documents/update-document-status-in-batch.md): 在一次请求中批量启用、禁用、归档或取消归档多个文档。 ##### 分段 - [向文档添加分段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chunks/create-chunks.md): 在文档中创建一个或多个分段。 - [从文档获取分段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chunks/list-chunks.md): 返回文档内分段的分页列表,可按关键词或索引状态筛选。 - [获取文档中的分段详情](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chunks/get-chunk.md): 获取单个分段的完整详情。 - [更新文档中的分段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chunks/update-chunk.md): 更新分段的字段。更新会为该分段重新触发索引。 - [删除文档中的分段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chunks/delete-chunk.md): 从文档中永久删除一个分段。 - [创建子分段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chunks/create-child-chunk.md): 在父分段下创建子分段。适用于使用父子(`hierarchical_model`)分块模式的文档。 - [获取子分段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chunks/list-child-chunks.md): 返回特定父分段下子分段的分页列表。 - [更新子分段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chunks/update-child-chunk.md): 更新现有子分段的内容。 - [删除子分段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/chunks/delete-child-chunk.md): 从父分段中永久删除一个子分段。 ##### 元数据 - [创建元数据字段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/metadata/create-metadata-field.md): 为知识库创建自定义元数据字段,用于给文档标注结构化信息。 - [获取元数据字段列表](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/metadata/list-metadata-fields.md): 返回知识库的所有元数据字段(包括自定义和内置字段),以及使用每个字段的文档数量。 - [更新元数据字段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/metadata/update-metadata-field.md): 重命名自定义元数据字段。 - [删除元数据字段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/metadata/delete-metadata-field.md): 永久删除自定义元数据字段。使用过该字段的文档将丢失其对应的值。 - [获取内置元数据字段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/metadata/get-built-in-metadata-fields.md): 返回系统提供的内置元数据字段。 - [更新内置元数据字段](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/metadata/update-built-in-metadata-field.md): 启用或禁用知识库的内置元数据字段。 - [批量更新文档元数据](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/metadata/update-document-metadata-in-batch.md): 在一次请求中批量更新多个文档的元数据值。 ##### 标签 - [创建知识库标签](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/tags/create-knowledge-tag.md): 创建用于组织知识库的标签。 - [获取知识库标签列表](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/tags/list-knowledge-tags.md): 返回工作空间中所有的知识库标签。 - [修改知识库标签](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/tags/update-knowledge-tag.md): 重命名知识库标签。 - [删除知识库标签](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/tags/delete-knowledge-tag.md): 永久删除知识库标签。不会删除已被标记的知识库。 - [绑定标签到知识库](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/tags/create-tag-binding.md): 将一个或多个标签绑定到知识库。一个知识库可以有多个标签。 - [解除标签与知识库的绑定](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/tags/delete-tag-binding.md): 从知识库中移除一个或多个标签。 - [获取知识库绑定的标签](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/tags/get-knowledge-base-tags.md): 返回绑定到知识库的标签。 ##### 模型 - [获取可用模型](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/models/get-available-models.md): 返回指定类型的可用模型。用它查找可配置到知识库的 `text-embedding` 和 `rerank` 模型。 ##### 知识流水线 - [上传流水线文件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/knowledge-pipeline/upload-pipeline-file.md): 上传文件以在知识流水线中使用。将返回的 `id` 用作 [运行流水线](/zh/3.13.x/develop/api/knowledge-pipeline/run-pipeline) 中 `local_file` 项的 `reference`。 - [获取数据源插件列表](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/knowledge-pipeline/list-datasource-plugins.md): 返回知识流水线中已配置的数据源节点,每个节点包含其使用的插件,以及运行该节点所需的元数据。 - [执行数据源节点](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/knowledge-pipeline/run-datasource-node.md): 运行知识流水线中的单个数据源节点,并流式返回其执行事件。 - [运行流水线](https://enterprise-docs.dify.ai/zh/3.13.x/develop/api/knowledge-pipeline/run-pipeline.md): 对一个或多个数据源运行完整的知识流水线。`response_mode` 选择流式或阻塞响应。 ### CLI #### 入门 - [概述](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/introduction.md): 通过 Dify 官方命令行工具 difyctl,从终端、脚本、CI 流水线和 AI Agent 运行 Dify 应用 - [安装 difyctl](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/install.md): 用一行脚本或手动下载二进制文件安装 difyctl #### 账户用户 - [快速开始](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/account-users/quick-start.md): 在 5 分钟内从命令行运行你的第一个 Dify 应用 - [认证](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/account-users/authenticate.md): 从 CLI 登录你的公司 Dify 主机,了解 token 的存储位置,并管理你的会话 - [常见任务](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/account-users/common-tasks.md): 复制即用的命令,涵盖最常运行的 difyctl 任务 #### 外部 SSO 用户 - [快速开始](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/sso-users/quick-start.md): 使用你的企业 SSO 身份从命令行运行第一个 Dify 应用 - [认证](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/sso-users/authenticate.md): 用企业身份从 CLI 登录公司的 Dify 主机,了解 token 的存储位置,并登出 - [权限范围与限制](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/sso-users/scope-and-limitations.md): 你的外部 SSO 会话能做什么、不能做什么,以及如何申请更多访问权限 - [常见任务](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/sso-users/common-tasks.md): 复制即用的命令,涵盖作为外部 SSO 用户最常运行的任务 #### 集成你的 Agent - [将你的 Agent 接入 Dify 应用](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/integrate-agents/overview.md): 通过 difyctl,让任意编码 Agent 调用你的 Dify 应用,无需对接 API,也无需安装 SDK - [在 Agent 运行的位置进行认证](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/integrate-agents/auth-for-agent-deployments.md): 在 Agent 运行的服务器或容器上放置一个 difyctl 会话,使其无需人工值守即可调用 Dify 应用 - [安装 difyctl 技能](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/integrate-agents/install-the-difyctl-skill.md): 安装一个技能文件,让你的编码 Agent 能够访问你的 Dify 应用 - [处理错误与重试](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/integrate-agents/error-handling-and-retries-for-agents.md): 让 Agent 在 difyctl 出错时安全失败:根据退出码分支处理、解析错误、检测已暂停的工作流,并只重试安全的操作 #### 命令参考 - [命令索引](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/reference/command-index.md): 按名称查找任意 difyctl 命令,并附带其完整参考的链接 - [全局标志](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/reference/global-flags.md): 在 difyctl 命令中使用这些标志,控制输出格式、详细程度和重试行为 - [应用](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/reference/apps.md): 从命令行列出、查看、运行、恢复、导出和导入 Dify 应用 - [认证与上下文](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/reference/auth-and-contexts.md): 登录、管理会话,并在已保存的主机和账户之间切换 - [工作空间](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/reference/workspaces.md): 列出你的工作空间、切换当前工作空间,并了解 difyctl 如何决定命令使用哪个工作空间 - [环境变量](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/reference/environment-variables.md): 通过环境变量为当前 Shell 会话设置 difyctl 的默认值 - [帮助](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/reference/help.md): 在终端中获取帮助,包括各命令文档、指南主题以及机器可读的 JSON - [技能](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/reference/skills.md): 安装 Agent 技能,让编码 Agent 能够驱动 difyctl - [Version](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/reference/version.md): 检查 difyctl 版本及其与 Dify 服务器的兼容性 - [输出格式与退出码](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/reference/output-formats-and-exit-codes.md): difyctl 各输出格式分别输出什么内容,stdout 与 stderr 如何分流,错误如何结构化,以及每个退出码的含义 #### 故障排查 - [故障排查](https://enterprise-docs.dify.ai/zh/3.13.x/develop/cli/troubleshooting.md): 修复常见的 difyctl 错误,附带原因说明、退出码和解决方案 ### 插件开发 #### 快速开始 - [Dify 插件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/getting-started/getting-started-dify-plugin.md): 模块化组件,通过外部服务、自定义逻辑和专业工具扩展 Dify AI 应用 - [选择插件类型](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/getting-started/choose-plugin-type.md): 一份简明的决策指南,帮助你在工具、模型、Agent 策略、扩展、数据源和触发器插件之间做出选择 - [Dify 插件 CLI](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/getting-started/cli.md): 安装 Dify 插件 CLI、搭建新插件项目,并在本地开发时将其连接到 Dify 实例运行 #### 特性与规范 ##### 插件类型 - [通用规范](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/plugin-types/general-specifications.md): 各类插件共享的通用数据结构,包括 I18nObject、ProviderConfig、ModelConfig、NodeResponse 和 ToolSelector - [模型规范](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/plugin-types/model-designing-rules.md): Dify 模型插件相关实体的参考,包括 Provider、AIModelEntity、模型类型、配置方法、参数规则和凭据模式 - [模型 API 接口](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/plugin-types/model-schema.md): 实现 Dify 模型插件所需的接口和数据结构,涵盖 LLM、TextEmbedding、Rerank、Speech2Text、Text2Speech 和 Moderation 模型 - [持久化存储](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/plugin-types/persistent-storage-kv.md): 使用内置的键值存储在插件的多次交互间保存数据 - [工具返回](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/plugin-types/tool.md): 工具插件如何返回消息(文本、链接、图片、文件、JSON)、创建标准变量和流式变量,以及定义输出模式以供工作流引用 - [Manifest](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/plugin-types/plugin-info-by-manifest.md): 插件 manifest 的 YAML schema,用于声明名称、作者、运行时、资源、权限,以及插件附带的工具、模型和端点 - [多语言 README](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/plugin-types/multilingual-readme.md): 添加各语言的 README 文件,让 Dify Marketplace 以用户的首选语言展示插件文档 - [插件调试](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/plugin-types/remote-debug-a-plugin.md): 在本地运行开发中的插件,并将其挂载到在线 Dify 工作空间进行端到端测试,无需打包 - [输出插件日志](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/plugin-types/plugin-logging.md): 通过 SDK 的 plugin_logger_handler 输出插件日志,可在远程调试时查看,也会写入守护进程容器日志 ##### 高级开发 ###### 反向调用 - [Bundle 插件包](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/advanced-development/bundle.md): 将多个插件打包进一个 Bundle,支持 Marketplace、GitHub 和 Package 三种依赖类型 - [Dify 服务的反向调用](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/advanced-development/reverse-invocation.md): 在插件中调用 Dify 平台的 App、Model、Tool 和 Node 服务 - [应用](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/advanced-development/reverse-invocation-app.md): 在插件中调用 Dify 应用的 Chat、Workflow 和 Completion 接口 - [反向调用模型](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/advanced-development/reverse-invocation-model.md): 在插件中调用 LLM、嵌入、重排序、TTS、语音转文字和内容审核模型 - [工具](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/advanced-development/reverse-invocation-tool.md): 从插件中调用已安装工具、Workflow as Tool 和自定义工具 - [集成自定义模型](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/advanced-development/customizable-model.md): 以 Xinference 为例,将自定义模型集成到 Dify - [节点](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/features-and-specs/advanced-development/reverse-invocation-node.md): 从插件中调用参数提取器和问题分类器节点 #### 开发指南与示例 - [速查表](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/cheatsheet.md): Dify 插件开发的快速参考,涵盖环境配置、安装、开发流程和插件类型 ##### 按插件类型 - [工具插件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/tool-plugin.md): 从初始化到打包,以 Google Search 为示例完整开发一个 Dify 工具插件 - [Tool OAuth](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/tool-oauth.md): 用 OAuth 授权流程替代手动输入 API 密钥,让用户一键授权访问第三方服务 - [模型供应商插件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/creating-new-model-provider.md): 构建模型供应商插件,从项目搭建、供应商配置到模型实现、调试与发布。 - [Agent 策略插件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/agent-strategy-plugin.md): 从零开始构建一个 Function Calling Agent 策略,通过实战示例展示如何为 LLM 提供工具并让其自主获取当前时间 - [数据源插件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/datasource-plugin.md): 构建 Dify 1.9.0+ 数据源插件,将文档输入知识库管道 - [触发器插件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/trigger-plugin.md): 构建 Dify 1.10.0+ 触发器插件,将第三方 webhook 事件转换为工作流启动信号 - [Endpoint 插件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/endpoint.md): 以 Neko Cat 项目为例,定义、配置并实现 Dify 插件中的 HTTP Endpoint ##### 完整示例 - [Flomo 工具(10分钟)](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/develop-flomo-plugin.md): 在大约十分钟内端到端构建一个连接 Flomo 笔记服务的功能性 Dify 工具插件 - [Slack Bot](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/develop-a-slack-bot-plugin.md): 构建一个将 Dify 应用连接到 Slack 的 Slack Bot 插件,涵盖从项目初始化到调试和打包的完整流程 - [Markdown 导出器](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/develop-md-exporter.md): 学习如何创建一个将对话导出为不同文档格式的插件 - [多模态工具](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/dev-guides-and-walkthroughs/develop-multimodal-data-processing-tool.md): 配置工具插件以输出图片、音频或视频,使知识库节点能够将多模态输出与文本一同向量化 #### 发布 - [发布插件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/publishing/marketplace-listing/release-overview.md): 分发 Dify 插件的三种方式(Marketplace、GitHub 仓库或本地文件)以及如何选择合适的方式 - [发布插件到市场](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/publishing/marketplace-listing/submit-plugin-to-marketplace.md): 准备并验证 .difypkg,提交市场审核,处理 Pull Request,并在创作者中心查看已发布插件的表现和反馈 - [常见问题](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/publishing/faq/faq.md): 构建、打包、调试和安装 Dify 插件时的常见问题与解决方法 ##### 标准 - [插件开发指南](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/publishing/standards/contributor-covenant-code-of-conduct.md): 为了确保 Dify Marketplace 中所有插件的质量,并为 Dify Marketplace 用户提供一致的高质量体验,您在提交插件进行审核时必须遵守这些插件开发指南中列出的所有要求。提交插件即表示**您确认已阅读、理解并同意遵守以下所有条款**。遵循这些指南将帮助您的插件更快通过审核。 - [隐私政策指南](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/publishing/standards/privacy-protection-guidelines.md): 如何声明数据收集行为,并为提交到 Dify Marketplace 的每个插件编写所需的隐私政策 ##### GitHub 仓库 - [发布到个人 GitHub 仓库](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/publishing/marketplace-listing/release-to-individual-github-repo.md): 从自己的 GitHub 仓库分发 Dify 插件,用户通过仓库 URL 直接安装,无需 Marketplace 审核 ##### 本地文件 - [打包为本地文件并分享](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/publishing/marketplace-listing/release-by-file.md): 将 Dify 插件打包为 `.difypkg` 文件,可直接安装或分发给他人,无需发布到 Marketplace 或 GitHub - [为第三方签名验证签署插件](https://enterprise-docs.dify.ai/zh/3.13.x/develop/plugins/publishing/standards/third-party-signature-verification.md): 在 Dify Community Edition 中启用已签名的 `.difypkg` 安装,无需完全禁用签名验证(生成密钥、签署软件包、分发公钥) ## OpenAPI Specs - [openapi_service](/zh/3.13.x/develop/api/openapi_service.json)