Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dify x OpenAPI

[![Dify Version Support](https://img.shields.io/badge/Support_Dify_Version-1.4.3-blue)](https://github.com/langgenius/dify)
[![Dify Version Support](https://img.shields.io/badge/Support_Dify_Version-1.5.0-blue)](https://github.com/langgenius/dify)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Package Manager: uv](https://img.shields.io/badge/package%20manager-uv-black)](https://github.com/astral-sh/uv)
Expand Down Expand Up @@ -39,7 +39,7 @@ Provides OpenAPI Schema for [Dify](https://github.com/langgenius/dify) API, whic
> [!tip]
> This indicates that the API has passed at least one test case request. If you find any API errors, feel free to submit an issue or PR!

- Knowledge Base: [OpenAPI Schema(中文)](./schema/knowledge_base.zh.yaml) | [OpenAPI Schema(English)](./schema/knowledge_base.en.yaml) | [Official Documentation Source](https://github.com/langgenius/dify/tree/1.4.3/web/app/(commonLayout)/datasets/template)
- Knowledge Base: [OpenAPI Schema(中文)](./schema/knowledge_base.zh.yaml) | [OpenAPI Schema(English)](./schema/knowledge_base.en.yaml) | [Official Documentation Source](https://github.com/langgenius/dify/tree/1.5.0/web/app/(commonLayout)/datasets/template)
- [x] POST /datasets - Create empty knowledge base
- [x] POST /datasets/{dataset_id} - Update knowledge base
- [x] GET /datasets/{dataset_id}/documents - Get document list
Expand All @@ -50,6 +50,7 @@ Provides OpenAPI Schema for [Dify](https://github.com/langgenius/dify) API, whic
- [x] POST /datasets/{dataset_id}/documents/{document_id}/update-by-file - Update document by file
- [x] GET /datasets/{dataset_id}/documents/{document_id}/upload-file - Get upload file
- [x] GET /datasets/{dataset_id}/documents/{batch}/indexing-status - Get document embedding status
- [x] PATCH /datasets/{dataset_id}/documents/status/{action} - Batch update document status
- [x] GET /datasets/{dataset_id}/documents/{document_id}/segments - Query document segments
- [x] POST /datasets/{dataset_id}/documents/{document_id}/segments - Create document segment
- [x] DELETE /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id} - Delete document segment
Expand All @@ -70,7 +71,7 @@ Provides OpenAPI Schema for [Dify](https://github.com/langgenius/dify) API, whic
- [x] POST /datasets/{dataset_id}/tags - Query dataset bound tags
- [x] POST /datasets/{dataset_id}/retrieval - Retrieve with metadata filtering conditions

- Chat Application: [OpenAPI Schema(中文)](./schema/app_chat.zh.yaml) | [OpenAPI Schema(English)](./schema/app_chat.en.yaml) | [Official Documentation Source](https://github.com/langgenius/dify/tree/1.4.3/web/app/components/develop/template)
- Chat Application: [OpenAPI Schema(中文)](./schema/app_chat.zh.yaml) | [OpenAPI Schema(English)](./schema/app_chat.en.yaml) | [Official Documentation Source](https://github.com/langgenius/dify/tree/1.5.0/web/app/components/develop/template)
- [x] POST /chat-messages - Send conversation message
- [x] POST /files/upload - Upload file
- [x] POST /messages/{message_id}/feedbacks - Message feedback
Expand All @@ -83,7 +84,7 @@ Provides OpenAPI Schema for [Dify](https://github.com/langgenius/dify) API, whic
- [x] GET /info - Get application basic information
- [x] GET /parameters - Get application parameters

- Advanced Chat Application: [OpenAPI Schema(中文)](./schema/app_advanced_chat.zh.yaml) | [OpenAPI Schema(English)](./schema/app_advanced_chat.en.yaml) | [Official Documentation Source](https://github.com/langgenius/dify/tree/1.4.3/web/app/components/develop/template)
- Advanced Chat Application: [OpenAPI Schema(中文)](./schema/app_advanced_chat.zh.yaml) | [OpenAPI Schema(English)](./schema/app_advanced_chat.en.yaml) | [Official Documentation Source](https://github.com/langgenius/dify/tree/1.5.0/web/app/components/develop/template)
- [x] POST /audio-to-text - Speech to text
- [x] POST /text-to-audio - Text to speech
- [x] GET /apps/annotations - Get annotation list
Expand All @@ -99,10 +100,10 @@ Provides OpenAPI Schema for [Dify](https://github.com/langgenius/dify) API, whic
- [x] GET /parameters - Get application parameters


- Text Generation Application: [OpenAPI Schema(中文)](./schema/app_generation.zh.yaml) | [OpenAPI Schema(English)](./schema/app_generation.en.yaml) | [Official Documentation Source](https://github.com/langgenius/dify/tree/1.4.3/web/app/components/develop/template)
- Text Generation Application: [OpenAPI Schema(中文)](./schema/app_generation.zh.yaml) | [OpenAPI Schema(English)](./schema/app_generation.en.yaml) | [Official Documentation Source](https://github.com/langgenius/dify/tree/1.5.0/web/app/components/develop/template)
- [x] POST /completion-messages - Send message

- Workflow Application: [OpenAPI Schema(中文)](./schema/app_workflow.zh.yaml) | [OpenAPI Schema(English)](./schema/app_workflow.en.yaml) | [Official Documentation Source](https://github.com/langgenius/dify/tree/1.4.3/web/app/components/develop/template)
- Workflow Application: [OpenAPI Schema(中文)](./schema/app_workflow.zh.yaml) | [OpenAPI Schema(English)](./schema/app_workflow.en.yaml) | [Official Documentation Source](https://github.com/langgenius/dify/tree/1.5.0/web/app/components/develop/template)
- [x] POST /workflows/run - Execute workflow
- [x] GET /workflows/run/{workflow_run_id} - Get workflow execution status
- [x] POST /workflows/tasks/{task_id}/stop - Stop response
Expand Down
13 changes: 7 additions & 6 deletions README.zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dify x OpenAPI

[![Dify Version Support](https://img.shields.io/badge/Support_Dify_Version-1.4.3-blue)](https://github.com/langgenius/dify)
[![Dify Version Support](https://img.shields.io/badge/Support_Dify_Version-1.5.0-blue)](https://github.com/langgenius/dify)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Package Manager: uv](https://img.shields.io/badge/package%20manager-uv-black)](https://github.com/astral-sh/uv)
Expand Down Expand Up @@ -41,7 +41,7 @@
> [!tip]
> 这里指至少可以通过一次测试用例请求, 如果你发现有哪些API错误, 欢迎提issue或者pr!

- 知识库: [OpenAPI Schema(中文)](./schema/knowledge_base.zh.yaml) | [OpenAPI Schema(English)](./schema/knowledge_base.en.yaml) | [官方文档源码](https://github.com/langgenius/dify/tree/1.4.3/web/app/(commonLayout)/datasets/template)
- 知识库: [OpenAPI Schema(中文)](./schema/knowledge_base.zh.yaml) | [OpenAPI Schema(English)](./schema/knowledge_base.en.yaml) | [官方文档源码](https://github.com/langgenius/dify/tree/1.5.0/web/app/(commonLayout)/datasets/template)
- [x] POST /datasets - 创建空知识库
- [x] POST /datasets/{dataset_id} - 更新知识库
- [x] GET /datasets/{dataset_id}/documents - 获取文档列表
Expand All @@ -52,6 +52,7 @@
- [x] POST /datasets/{dataset_id}/documents/{document_id}/update-by-file - 通过文件更新文档
- [x] GET /datasets/{dataset_id}/documents/{document_id}/upload-file - 获取上传文件
- [x] GET /datasets/{dataset_id}/documents/{batch}/indexing-status - 获取文档嵌入状态
- [x] PATCH /datasets/{dataset_id}/documents/status/{action} - 批量更新文档状态
- [x] GET /datasets/{dataset_id}/documents/{document_id}/segments - 查询文档分段
- [x] POST /datasets/{dataset_id}/documents/{document_id}/segments - 创建文档分段
- [x] DELETE /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id} - 删除文档分段
Expand All @@ -72,7 +73,7 @@
- [x] POST /datasets/{dataset_id}/tags - 查询知识库已绑定的标签
- [x] POST /datasets/{dataset_id}/retrieval - 带元数据过滤条件的检索

- 聊天应用: [OpenAPI Schema(中文)](./schema/app_chat.zh.yaml) | [OpenAPI Schema(English)](./schema/app_chat.en.yaml) | [官方文档源码](https://github.com/langgenius/dify/tree/1.4.3/web/app/components/develop/template)
- 聊天应用: [OpenAPI Schema(中文)](./schema/app_chat.zh.yaml) | [OpenAPI Schema(English)](./schema/app_chat.en.yaml) | [官方文档源码](https://github.com/langgenius/dify/tree/1.5.0/web/app/components/develop/template)
- [x] POST /chat-messages - 发送对话消息
- [x] POST /files/upload - 上传文件
- [x] POST /messages/{message_id}/feedbacks - 消息反馈
Expand All @@ -85,7 +86,7 @@
- [x] GET /info - 获取应用基本信息
- [x] GET /parameters - 获取应用参数

- 高级聊天应用: [OpenAPI Schema(中文)](./schema/app_advanced_chat.zh.yaml) | [OpenAPI Schema(English)](./schema/app_advanced_chat.en.yaml) | [官方文档源码](https://github.com/langgenius/dify/tree/1.4.3/web/app/components/develop/template)
- 高级聊天应用: [OpenAPI Schema(中文)](./schema/app_advanced_chat.zh.yaml) | [OpenAPI Schema(English)](./schema/app_advanced_chat.en.yaml) | [官方文档源码](https://github.com/langgenius/dify/tree/1.5.0/web/app/components/develop/template)
- [x] POST /audio-to-text - 语音转文字
- [x] POST /text-to-audio - 文字转语音
- [x] GET /apps/annotations - 获取标注列表
Expand All @@ -100,10 +101,10 @@
- [x] GET /info - 获取应用基本信息
- [x] GET /parameters - 获取应用参数(包含文字转语音设置)

- 文本生成应用: [OpenAPI Schema(中文)](./schema/app_generation.zh.yaml) | [OpenAPI Schema(English)](./schema/app_generation.en.yaml) | [官方文档源码](https://github.com/langgenius/dify/tree/1.4.3/web/app/components/develop/template)
- 文本生成应用: [OpenAPI Schema(中文)](./schema/app_generation.zh.yaml) | [OpenAPI Schema(English)](./schema/app_generation.en.yaml) | [官方文档源码](https://github.com/langgenius/dify/tree/1.5.0/web/app/components/develop/template)
- [x] POST /completion-messages - 发送消息

- 工作流应用: [OpenAPI Schema(中文)](./schema/app_workflow.zh.yaml) | [OpenAPI Schema(English)](./schema/app_workflow.en.yaml) | [官方文档源码](https://github.com/langgenius/dify/tree/1.4.3/web/app/components/develop/template)
- 工作流应用: [OpenAPI Schema(中文)](./schema/app_workflow.zh.yaml) | [OpenAPI Schema(English)](./schema/app_workflow.en.yaml) | [官方文档源码](https://github.com/langgenius/dify/tree/1.5.0/web/app/components/develop/template)
- [x] POST /workflows/run - 执行工作流
- [x] GET /workflows/run/{workflow_run_id} - 获取工作流执行状态
- [x] POST /workflows/tasks/{task_id}/stop - 停止响应
Expand Down
2 changes: 1 addition & 1 deletion libs/dify
Submodule dify updated 605 files
132 changes: 132 additions & 0 deletions misc/official_api_doc_changes/1.4.3__1.5.0.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
diff --git a/web/app/(commonLayout)/datasets/template/template.zh.mdx b/web/app/(commonLayout)/datasets/template/template.zh.mdx
index d121a93df..d407fad3c 100644
--- a/web/app/(commonLayout)/datasets/template/template.zh.mdx
+++ b/web/app/(commonLayout)/datasets/template/template.zh.mdx
@@ -55,7 +55,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi
<Property name='indexing_technique' type='string' key='indexing_technique'>
索引方式
- <code>high_quality</code> 高质量:使用
- ding 模型进行嵌入,构建为向量数据库索引
+ Embedding 模型进行嵌入,构建为向量数据库索引
- <code>economy</code> 经济:使用 keyword table index 的倒排索引进行构建
</Property>
<Property name='doc_form' type='string' key='doc_form'>
@@ -1131,6 +1131,63 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi

<hr className='ml-0 mr-0' />

+<Heading
+ url='/datasets/{dataset_id}/documents/status/{action}'
+ method='PATCH'
+ title='更新文档状态'
+ name='#batch_document_status'
+/>
+<Row>
+ <Col>
+ ### Path
+ <Properties>
+ <Property name='dataset_id' type='string' key='dataset_id'>
+ 知识库 ID
+ </Property>
+ <Property name='action' type='string' key='action'>
+ - `enable` - 启用文档
+ - `disable` - 禁用文档
+ - `archive` - 归档文档
+ - `un_archive` - 取消归档文档
+ </Property>
+ </Properties>
+
+ ### Request Body
+ <Properties>
+ <Property name='document_ids' type='array[string]' key='document_ids'>
+ 文档ID列表
+ </Property>
+ </Properties>
+ </Col>
+ <Col sticky>
+ <CodeGroup
+ title="Request"
+ tag="PATCH"
+ label="/datasets/{dataset_id}/documents/status/{action}"
+ targetCode={`curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}/documents/status/{action}' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "document_ids": ["doc-id-1", "doc-id-2"]\n}'`}
+ >
+ ```bash {{ title: 'cURL' }}
+ curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}/documents/status/{action}' \
+ --header 'Authorization: Bearer {api_key}' \
+ --header 'Content-Type: application/json' \
+ --data-raw '{
+ "document_ids": ["doc-id-1", "doc-id-2"]
+ }'
+ ```
+ </CodeGroup>
+
+ <CodeGroup title="Response">
+ ```json {{ title: 'Response' }}
+ {
+ "result": "success"
+ }
+ ```
+ </CodeGroup>
+ </Col>
+</Row>
+
+<hr className='ml-0 mr-0' />
+
<Heading
url='/datasets/{dataset_id}/documents/{document_id}/segments'
method='POST'
diff --git a/web/app/components/develop/template/template_advanced_chat.zh.mdx b/web/app/components/develop/template/template_advanced_chat.zh.mdx
index fa3ad3f37..7a69ee60a 100755
--- a/web/app/components/develop/template/template_advanced_chat.zh.mdx
+++ b/web/app/components/develop/template/template_advanced_chat.zh.mdx
@@ -153,7 +153,6 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
- `data` (object) 详细内容
- `id` (string) workflow 执行 ID
- `workflow_id` (string) 关联 Workflow ID
- - `sequence_number` (int) 自增序号,App 内自增,从 1 开始
- `created_at` (timestamp) 开始时间
- `event: node_started` node 开始执行
- `task_id` (string) 任务 ID,用于请求跟踪和下方的停止响应接口
@@ -297,7 +296,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
### 流式模式
<CodeGroup title="Response">
```streaming {{ title: 'Response' }}
- data: {"event": "workflow_started", "task_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "workflow_run_id": "5ad498-f0c7-4085-b384-88cbe6290", "data": {"id": "5ad498-f0c7-4085-b384-88cbe6290", "workflow_id": "dfjasklfjdslag", "sequence_number": 1, "created_at": 1679586595}}
+ data: {"event": "workflow_started", "task_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "workflow_run_id": "5ad498-f0c7-4085-b384-88cbe6290", "data": {"id": "5ad498-f0c7-4085-b384-88cbe6290", "workflow_id": "dfjasklfjdslag", "created_at": 1679586595}}
data: {"event": "node_started", "task_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "workflow_run_id": "5ad498-f0c7-4085-b384-88cbe6290", "data": {"id": "5ad498-f0c7-4085-b384-88cbe6290", "node_id": "dfjasklfjdslag", "node_type": "start", "title": "Start", "index": 0, "predecessor_node_id": "fdljewklfklgejlglsd", "inputs": {}, "created_at": 1679586595}}
data: {"event": "node_finished", "task_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "workflow_run_id": "5ad498-f0c7-4085-b384-88cbe6290", "data": {"id": "5ad498-f0c7-4085-b384-88cbe6290", "node_id": "dfjasklfjdslag", "node_type": "start", "title": "Start", "index": 0, "predecessor_node_id": "fdljewklfklgejlglsd", "inputs": {}, "outputs": {}, "status": "succeeded", "elapsed_time": 0.324, "execution_metadata": {"total_tokens": 63127864, "total_price": 2.378, "currency": "USD"}, "created_at": 1679586595}}
data: {"event": "workflow_finished", "task_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "workflow_run_id": "5ad498-f0c7-4085-b384-88cbe6290", "data": {"id": "5ad498-f0c7-4085-b384-88cbe6290", "workflow_id": "dfjasklfjdslag", "outputs": {}, "status": "succeeded", "elapsed_time": 0.324, "total_tokens": 63127864, "total_steps": "1", "created_at": 1679586595, "finished_at": 1679976595}}
diff --git a/web/app/components/develop/template/template_workflow.zh.mdx b/web/app/components/develop/template/template_workflow.zh.mdx
index d599cb503..fc193de5d 100644
--- a/web/app/components/develop/template/template_workflow.zh.mdx
+++ b/web/app/components/develop/template/template_workflow.zh.mdx
@@ -98,7 +98,6 @@ Workflow 应用无会话支持,适合用于翻译/文章写作/总结 AI 等
- `data` (object) 详细内容
- `id` (string) workflow 执行 ID
- `workflow_id` (string) 关联 Workflow ID
- - `sequence_number` (int) 自增序号,App 内自增,从 1 开始
- `created_at` (timestamp) 开始时间
- `event: node_started` node 开始执行
- `task_id` (string) 任务 ID,用于请求跟踪和下方的停止响应接口
@@ -232,7 +231,7 @@ Workflow 应用无会话支持,适合用于翻译/文章写作/总结 AI 等
### Streaming Mode
<CodeGroup title="Response">
```streaming {{ title: 'Response' }}
- data: {"event": "workflow_started", "task_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "workflow_run_id": "5ad498-f0c7-4085-b384-88cbe6290", "data": {"id": "5ad498-f0c7-4085-b384-88cbe6290", "workflow_id": "dfjasklfjdslag", "sequence_number": 1, "created_at": 1679586595}}
+ data: {"event": "workflow_started", "task_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "workflow_run_id": "5ad498-f0c7-4085-b384-88cbe6290", "data": {"id": "5ad498-f0c7-4085-b384-88cbe6290", "workflow_id": "dfjasklfjdslag", "created_at": 1679586595}}
data: {"event": "node_started", "task_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "workflow_run_id": "5ad498-f0c7-4085-b384-88cbe6290", "data": {"id": "5ad498-f0c7-4085-b384-88cbe6290", "node_id": "dfjasklfjdslag", "node_type": "start", "title": "Start", "index": 0, "predecessor_node_id": "fdljewklfklgejlglsd", "inputs": {}, "created_at": 1679586595}}
data: {"event": "node_finished", "task_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "workflow_run_id": "5ad498-f0c7-4085-b384-88cbe6290", "data": {"id": "5ad498-f0c7-4085-b384-88cbe6290", "node_id": "dfjasklfjdslag", "node_type": "start", "title": "Start", "index": 0, "predecessor_node_id": "fdljewklfklgejlglsd", "inputs": {}, "outputs": {}, "status": "succeeded", "elapsed_time": 0.324, "execution_metadata": {"total_tokens": 63127864, "total_price": 2.378, "currency": "USD"}, "created_at": 1679586595}}
data: {"event": "workflow_finished", "task_id": "5ad4cb98-f0c7-4085-b384-88c403be6290", "workflow_run_id": "5ad498-f0c7-4085-b384-88cbe6290", "data": {"id": "5ad498-f0c7-4085-b384-88cbe6290", "workflow_id": "dfjasklfjdslag", "outputs": {}, "status": "succeeded", "elapsed_time": 0.324, "total_tokens": 63127864, "total_steps": "1", "created_at": 1679586595, "finished_at": 1679976595}}
@@ -522,6 +521,12 @@ Workflow 应用无会话支持,适合用于翻译/文章写作/总结 AI 等
<Property name='limit' type='int' key='limit'>
每页条数, 默认20.
</Property>
+ <Property name='created_by_end_user_session_id' type='str' key='created_by_end_user_session_id'>
+ 由哪个endUser创建,例如,`abc-123`.
+ </Property>
+ <Property name='created_by_account' type='str' key='created_by_account'>
+ 由哪个邮箱账户创建,例如,lizb@test.com.
+ </Property>
</Properties>

### Response
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "dify-openapi"
version = "1.4.3"
version = "1.5.0"
description = "a client for testing and validating dify openapi schema"
readme = "README.md"
authors = [{ name = "straydragon", email = "straydragonl@foxmail.com" }]
Expand Down
Loading
Loading