From fc4eb669212c50cd7d828599e22f42217ca5bdb2 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 26 Aug 2026 08:45:21 +0800 Subject: [PATCH 01/10] feat: align service api with generated contract Pin the reviewed Dify source revision and add a deterministic three-language alignment pipeline while preserving documentation presentation fields. --- docs.json | 44 +- en/api-reference/openapi_service.json | 22832 +++++++++++------ ja/api-reference/openapi_service.json | 21099 +++++++++------ tools/api-pipeline/README.md | 15 +- tools/api-pipeline/align_service_api.py | 631 + tools/api-pipeline/merge_specs.py | 2 +- tools/api-pipeline/service_api_source.json | 5 + tools/api-pipeline/test_align_service_api.py | 166 + zh/api-reference/openapi_service.json | 21095 +++++++++------ 9 files changed, 40501 insertions(+), 25388 deletions(-) create mode 100644 tools/api-pipeline/align_service_api.py create mode 100644 tools/api-pipeline/service_api_source.json create mode 100644 tools/api-pipeline/test_align_service_api.py diff --git a/docs.json b/docs.json index f45acf01c6..a3eafc1fad 100644 --- a/docs.json +++ b/docs.json @@ -379,6 +379,7 @@ "group": "Applications", "openapi": "en/api-reference/openapi_service.json", "pages": [ + "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -450,7 +451,6 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", - "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -1101,6 +1101,7 @@ "group": "Applications", "openapi": "en/api-reference/openapi_service.json", "pages": [ + "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -1172,7 +1173,6 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", - "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -1772,6 +1772,7 @@ "group": "应用配置", "openapi": "zh/api-reference/openapi_service.json", "pages": [ + "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -1843,7 +1844,6 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", - "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -2494,6 +2494,7 @@ "group": "应用配置", "openapi": "zh/api-reference/openapi_service.json", "pages": [ + "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -2565,7 +2566,6 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", - "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -3165,6 +3165,7 @@ "group": "アプリケーション設定", "openapi": "ja/api-reference/openapi_service.json", "pages": [ + "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -3236,7 +3237,6 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", - "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -3887,6 +3887,7 @@ "group": "アプリケーション設定", "openapi": "ja/api-reference/openapi_service.json", "pages": [ + "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -3958,7 +3959,6 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", - "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -5357,22 +5357,6 @@ "source": "/use-dify/publish/developing-with-apis", "destination": "/en/api-reference/guides/get-started" }, - { - "source": "/api-reference/knowledge-bases/list-knowledge-bases", - "destination": "/en/api-reference/guides/knowledge" - }, - { - "source": "/api-reference/知识库/获取知识库列表", - "destination": "/zh/api-reference/guides/knowledge" - }, - { - "source": "/api-reference/データセット/ナレッジベースリストを取得", - "destination": "/ja/api-reference/guides/knowledge" - }, - { - "source": "/api-reference/:slug*", - "destination": "/en/api-reference/guides/get-started" - }, { "source": "/home", "destination": "/en/home" @@ -5396,6 +5380,22 @@ { "source": "/develop-plugin/:slug*", "destination": "/en/develop-plugin/:slug*" + }, + { + "source": "/api-reference/knowledge-bases/list-knowledge-bases", + "destination": "/en/api-reference/guides/knowledge" + }, + { + "source": "/api-reference/知识库/获取知识库列表", + "destination": "/zh/api-reference/guides/knowledge" + }, + { + "source": "/api-reference/データセット/ナレッジベースリストを取得", + "destination": "/ja/api-reference/guides/knowledge" + }, + { + "source": "/api-reference/:slug*", + "destination": "/en/api-reference/guides/get-started" } ], "integrations": { diff --git a/en/api-reference/openapi_service.json b/en/api-reference/openapi_service.json index 0ddc889a12..419ff5bedd 100644 --- a/en/api-reference/openapi_service.json +++ b/en/api-reference/openapi_service.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.1.0", "info": { "title": "Dify Service API", "description": "REST API for Dify applications and knowledge bases. Application endpoints authenticate with an app API key; knowledge endpoints authenticate with a dataset API key.", @@ -19,7 +19,7 @@ ], "security": [ { - "ApiKeyAuth": [] + "Bearer": [] } ], "tags": [ @@ -97,11 +97,51 @@ } ], "paths": { + "/": { + "get": { + "operationId": "get_index_api", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndexInfoResponse" + }, + "examples": { + "response": { + "summary": "Response Example", + "value": { + "welcome": "Dify OpenAPI", + "api_version": "v1", + "server_version": "1.17.0" + } + } + } + } + }, + "description": "Success" + } + }, + "security": [], + "summary": "Get API Information", + "tags": [ + "Applications" + ], + "description": "Returns the public Service API version and server version without requiring an API key.", + "x-mint": { + "href": "/en/api-reference/applications/get-api-information", + "metadata": { + "title": "Get API Information", + "sidebarTitle": "Get API Information" + } + } + } + }, "/chat-messages": { "post": { "summary": "Send Chat Message", "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nSends a message to a chat app and returns the assistant's reply. The events in the streaming response vary by app type.", - "operationId": "sendChatMessage", + "operationId": "create_chat_message", "tags": [ "Chat Messages" ], @@ -111,7 +151,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChatRequest" + "$ref": "#/components/schemas/ChatRequestPayloadWithUser" }, "examples": { "streaming_example": { @@ -153,7 +193,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChatCompletionResponse" + "$ref": "#/components/schemas/ChatBlockingResponse" }, "examples": { "blockingResponse": { @@ -413,6 +453,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -435,7 +481,7 @@ "post": { "summary": "Stop Chat Message Generation", "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nStops a chat message generation task. Only supported in `streaming` mode.", - "operationId": "stopChatMessageGeneration", + "operationId": "stop_chat_message", "tags": [ "Chat Messages" ], @@ -446,7 +492,8 @@ "required": true, "description": "Task ID, from the streaming events of [Send Chat Message](/en/api-reference/chat-messages/send-chat-message).", "schema": { - "type": "string" + "type": "string", + "description": "Task ID, obtained from a streaming chunk returned by the Send Chat Message API." } } ], @@ -455,16 +502,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. Must match the `user` sent with the original message; if it differs, the stop silently does nothing and still returns success. See [End User Identity](/en/api-reference/guides/end-user-identity)." - } - } + "$ref": "#/components/schemas/RequiredServiceApiUserPayload" }, "examples": { "example": { @@ -479,7 +517,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleResultResponse" + } + } + }, + "description": "Task stopped successfully" }, "400": { "description": "- `not_chat_app` : App mode does not match the API route.\n- `invalid_param` : The required `user` field is missing.", @@ -505,6 +550,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "Task not found" } }, "x-mint": { @@ -520,7 +583,7 @@ "get": { "summary": "Get Next Suggested Questions", "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nReturns the follow-up questions suggested for a message.", - "operationId": "getSuggestedQuestions", + "operationId": "get_suggested_questions", "tags": [ "Chat Messages" ], @@ -532,7 +595,8 @@ "description": "ID of the message to get suggestions for. Get it from a chat response or [List Conversation Messages](/en/api-reference/conversations/list-conversation-messages).", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Message ID" } }, { @@ -541,7 +605,8 @@ "required": true, "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", "schema": { - "type": "string" + "type": "string", + "description": "User identifier, used for end-user context." } } ], @@ -551,7 +616,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuggestedQuestionsResponse" + "$ref": "#/components/schemas/SimpleResultStringListResponse" }, "examples": { "suggestedQuestions": { @@ -627,6 +692,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-codeSamples": [ @@ -649,7 +726,7 @@ "post": { "summary": "Upload File", "description": "**Available for**: Chatflow, Workflow, New Agent, Chatbot, Agent, Text Generator apps.\n\nUploads a file and returns its `id` for later requests to reference. The file belongs to the uploading end user: only requests carrying the same `user` can reference it.\n\nWhich file types an app actually consumes depends on its file-upload settings; read them from [Get App Parameters](/en/api-reference/applications/get-app-parameters).", - "operationId": "uploadChatFile", + "operationId": "upload_file", "tags": [ "Files" ], @@ -684,7 +761,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileUploadResponse" + "$ref": "#/components/schemas/FileResponse" }, "examples": { "uploadSuccess": { @@ -785,6 +862,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -807,7 +896,7 @@ "get": { "summary": "Download File", "description": "**Available for**: Chatflow, Chatbot, Agent, Text Generator apps.\n\nReturns the raw bytes of a file previously returned by [Upload File](/en/api-reference/files/upload-file). A file is reachable only through the app whose messages reference it.", - "operationId": "previewChatFile", + "operationId": "preview_file", "tags": [ "Files" ], @@ -819,7 +908,8 @@ "description": "ID of the file to download, from the Upload File response.", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "The unique identifier of the file to preview, obtained from the [Upload File](/en/api-reference/files/upload-file) API response." } }, { @@ -829,7 +919,8 @@ "description": "When `true`, the file downloads as an attachment instead of rendering inline in the browser.", "schema": { "type": "boolean", - "default": false + "default": false, + "description": "If `true`, forces the file to download as an attachment instead of previewing in browser." } }, { @@ -838,7 +929,8 @@ "required": false, "description": "End-user identifier, defined by your app and unique within it. It has no effect on file access here, which is scoped by app and message rather than by `user`. See [End User Identity](/en/api-reference/guides/end-user-identity).", "schema": { - "type": "string" + "type": "string", + "description": "User identifier, used for end-user context." } } ], @@ -846,10 +938,10 @@ "200": { "description": "Returns the raw file content. The `Content-Type` header is set to the file's MIME type. If `as_attachment` is `true`, the file is returned as a download with `Content-Disposition: attachment`.", "content": { - "application/octet-stream": { + "*/*": { "schema": { - "type": "string", - "format": "binary" + "format": "binary", + "type": "string" } } } @@ -887,6 +979,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -902,7 +1000,7 @@ "get": { "summary": "Get End User Info", "description": "**Available for**: Chatflow, Workflow, New Agent, Chatbot, Agent, Text Generator apps.\n\nReturns an end user's details by ID. Useful for resolving an end-user ID returned by another endpoint, such as `created_by` in the [Upload File](/en/api-reference/files/upload-file) response.", - "operationId": "getEndUserChat", + "operationId": "get_end_user", "tags": [ "End Users" ], @@ -914,7 +1012,8 @@ "description": "ID of the end user to look up.", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "End user ID" } } ], @@ -962,6 +1061,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -977,7 +1088,7 @@ "post": { "summary": "Submit Message Feedback", "description": "**Available for**: Chatflow, Chatbot, Agent, Text Generator apps.\n\nRecords a `like` or `dislike` rating, plus an optional comment, on a message. Submitting `null` for `rating` revokes the message's existing feedback.", - "operationId": "postChatMessageFeedback", + "operationId": "create_message_feedback", "tags": [ "Feedback" ], @@ -989,7 +1100,8 @@ "description": "ID of the message to give feedback on. Get message IDs from [List Conversation Messages](/en/api-reference/conversations/list-conversation-messages).", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Message ID." } } ], @@ -998,7 +1110,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageFeedbackRequest" + "$ref": "#/components/schemas/MessageFeedbackPayloadWithUser" }, "examples": { "likeFeedback": { @@ -1015,7 +1127,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultResponse" + } + } + }, + "description": "Feedback submitted successfully" }, "400": { "description": "`invalid_param` : The required `user` field is omitted, or `rating` is `null` but there is no existing feedback to revoke.", @@ -1050,6 +1169,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -1065,32 +1196,34 @@ "get": { "summary": "List App Feedbacks", "description": "**Available for**: Chatflow, Chatbot, Agent, Text Generator apps.\n\nReturns a paginated list of all feedback on the app's messages, including both end-user and admin submissions.", - "operationId": "getChatAppFeedbacks", + "operationId": "get_app_feedbacks", "tags": [ "Feedback" ], "parameters": [ { - "name": "page", + "name": "limit", "in": "query", - "description": "Page number.", + "description": "Feedback items per page.", "required": false, "schema": { "type": "integer", - "default": 1, - "minimum": 1 + "default": 20, + "minimum": 1, + "maximum": 101, + "description": "Number of records per page." } }, { - "name": "limit", + "name": "page", "in": "query", - "description": "Feedback items per page.", + "description": "Page number.", "required": false, "schema": { "type": "integer", - "default": 20, + "default": 1, "minimum": 1, - "maximum": 101 + "description": "Page number for pagination." } } ], @@ -1100,7 +1233,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AppFeedbacksResponse" + "$ref": "#/components/schemas/AppFeedbackListResponse" }, "examples": { "feedbacksList": { @@ -1139,6 +1272,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -1154,27 +1299,19 @@ "get": { "summary": "List Conversations", "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nLists an end user's conversations, most recently active first.", - "operationId": "getConversationsList", + "operationId": "list_conversations", "tags": [ "Conversations" ], "parameters": [ - { - "name": "user", - "in": "query", - "required": false, - "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", - "schema": { - "type": "string" - } - }, { "name": "last_id", "in": "query", "required": false, "description": "Pagination cursor: the `id` of the last conversation on the current page. Omit to fetch the first page.", "schema": { - "type": "string" + "type": "string", + "description": "The ID of the last record on the current page. Used to fetch the next page." } }, { @@ -1186,7 +1323,8 @@ "type": "integer", "default": 20, "minimum": 1, - "maximum": 100 + "maximum": 100, + "description": "Number of records to return." } }, { @@ -1197,12 +1335,23 @@ "schema": { "type": "string", "enum": [ - "created_at", "-created_at", - "updated_at", - "-updated_at" + "-updated_at", + "created_at", + "updated_at" ], - "default": "-updated_at" + "default": "-updated_at", + "description": "Sorting field. Use the `-` prefix for descending order." + } + }, + { + "name": "user", + "in": "query", + "required": false, + "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", + "schema": { + "type": "string", + "description": "User identifier, used for end-user context." } } ], @@ -1212,7 +1361,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationsListResponse" + "$ref": "#/components/schemas/ConversationInfiniteScrollPagination" }, "examples": { "conversationsList": { @@ -1272,6 +1421,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -1287,7 +1448,7 @@ "get": { "summary": "List Conversation Messages", "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nReturns a conversation's message history, newest first. Pass `first_id` to page backward into older messages.", - "operationId": "getConversationHistory", + "operationId": "list_messages", "tags": [ "Conversations" ], @@ -1298,16 +1459,8 @@ "required": true, "description": "ID of the conversation to read. Get conversation IDs from [List Conversations](/en/api-reference/conversations/list-conversations).", "schema": { - "type": "string" - } - }, - { - "name": "user", - "in": "query", - "required": false, - "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", - "schema": { - "type": "string" + "type": "string", + "description": "Conversation ID." } }, { @@ -1316,7 +1469,8 @@ "required": false, "description": "Pagination cursor: the `id` of the first message on the current page. Pass it to fetch the previous (older) page; omit to fetch the latest messages.", "schema": { - "type": "string" + "type": "string", + "description": "The ID of the first chat record on the current page. Omit this value to fetch the latest messages; for subsequent pages, use the first message ID from the current list to fetch older messages." } }, { @@ -1328,7 +1482,18 @@ "type": "integer", "default": 20, "minimum": 1, - "maximum": 100 + "maximum": 100, + "description": "Number of chat history messages to return per request." + } + }, + { + "name": "user", + "in": "query", + "required": false, + "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", + "schema": { + "type": "string", + "description": "User identifier, used for end-user context." } } ], @@ -1338,7 +1503,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationHistoryResponse" + "$ref": "#/components/schemas/MessageInfiniteScrollPagination" }, "examples": { "conversationHistory": { @@ -1421,6 +1586,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-codeSamples": [ @@ -1443,7 +1620,7 @@ "get": { "summary": "List Conversation Variables", "description": "**Available for**: Chatflow, Chatbot, Agent apps.\n\nLists the variables stored in a conversation.", - "operationId": "getConversationVariables", + "operationId": "list_conversation_variables", "tags": [ "Conversations" ], @@ -1454,16 +1631,9 @@ "required": true, "description": "ID of the conversation whose variables to list. Get conversation IDs from [List Conversations](/en/api-reference/conversations/list-conversations).", "schema": { - "type": "string" - } - }, - { - "name": "user", - "in": "query", - "required": false, - "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", - "schema": { - "type": "string" + "type": "string", + "description": "Conversation ID.", + "format": "uuid" } }, { @@ -1472,7 +1642,8 @@ "required": false, "description": "Pagination cursor: the `id` of the last variable on the current page. Omit to fetch the first page.", "schema": { - "type": "string" + "type": "string", + "description": "The ID of the last record on the current page. Used to fetch the next page." } }, { @@ -1484,7 +1655,18 @@ "type": "integer", "default": 20, "minimum": 1, - "maximum": 100 + "maximum": 100, + "description": "Number of records to return." + } + }, + { + "name": "user", + "in": "query", + "required": false, + "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", + "schema": { + "type": "string", + "description": "User identifier, used for end-user context." } }, { @@ -1495,7 +1677,8 @@ "schema": { "type": "string", "minLength": 1, - "maxLength": 255 + "maxLength": 255, + "description": "Filter variables by a specific name." } } ], @@ -1505,7 +1688,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationVariablesResponse" + "$ref": "#/components/schemas/ConversationVariableInfiniteScrollPaginationResponse" }, "examples": { "conversationVariables": { @@ -1571,6 +1754,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -1586,7 +1781,7 @@ "post": { "summary": "Rename Conversation", "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nRenames a conversation, or auto-generates a name from its messages when `auto_generate` is `true`. The name is what clients display in a multi-conversation list.", - "operationId": "renameConversation", + "operationId": "rename_conversation", "tags": [ "Conversations" ], @@ -1597,7 +1792,9 @@ "required": true, "description": "ID of the conversation to rename. Get conversation IDs from [List Conversations](/en/api-reference/conversations/list-conversations).", "schema": { - "type": "string" + "type": "string", + "description": "Conversation ID.", + "format": "uuid" } } ], @@ -1606,7 +1803,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationRenameRequest" + "$ref": "#/components/schemas/ConversationRenamePayloadWithUser" }, "examples": { "renameExample": { @@ -1626,7 +1823,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationListItem" + "$ref": "#/components/schemas/SimpleConversation" }, "examples": { "renamedConversation": { @@ -1688,6 +1885,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -1703,7 +1912,7 @@ "put": { "summary": "Update Conversation Variable", "description": "**Available for**: Chatflow, Chatbot, Agent apps.\n\nUpdates a conversation variable's value. The new value must match the variable's existing type.", - "operationId": "updateChatConversationVariable", + "operationId": "update_conversation_variable", "tags": [ "Conversations" ], @@ -1715,7 +1924,8 @@ "description": "ID of the conversation that owns the variable. Get conversation IDs from [List Conversations](/en/api-reference/conversations/list-conversations).", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Conversation ID." } }, { @@ -1725,7 +1935,8 @@ "description": "ID of the variable to update. Get variable IDs from [List Conversation Variables](/en/api-reference/conversations/list-conversation-variables).", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Variable ID." } } ], @@ -1734,7 +1945,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationVariableUpdateRequest" + "$ref": "#/components/schemas/ConversationVariableUpdatePayloadWithUser" }, "examples": { "updateStringVariable": { @@ -1754,7 +1965,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationVariableItem" + "$ref": "#/components/schemas/ConversationVariableResponse" }, "examples": { "updatedVariable": { @@ -1822,6 +2033,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -1837,7 +2060,7 @@ "delete": { "summary": "Delete Conversation", "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nDeletes a conversation.", - "operationId": "deleteConversation", + "operationId": "delete_conversation", "tags": [ "Conversations" ], @@ -1848,7 +2071,9 @@ "required": true, "description": "ID of the conversation to delete. Get conversation IDs from [List Conversations](/en/api-reference/conversations/list-conversations).", "schema": { - "type": "string" + "type": "string", + "description": "Conversation ID.", + "format": "uuid" } } ], @@ -1858,13 +2083,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity)." - } - } + "$ref": "#/components/schemas/OptionalServiceApiUserPayload" }, "examples": { "deleteExample": { @@ -1914,6 +2133,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -1929,7 +2160,7 @@ "post": { "summary": "Convert Audio to Text", "description": "**Available for**: Chatflow, Workflow, New Agent, Chatbot, Agent, Text Generator apps.\n\nTranscribes an uploaded audio file to text using the workspace's default speech-to-text model.", - "operationId": "audioToText", + "operationId": "audio_to_text", "tags": [ "Audio" ], @@ -1938,18 +2169,32 @@ "content": { "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/AudioToTextRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successfully converted audio to text.", - "content": { + "properties": { + "file": { + "description": "Audio file to transcribe. Supported MIME types: `audio/mp3`, `audio/mpga`, `audio/m4a`, `audio/x-m4a`, `audio/wav`, and `audio/amr`. File size limit is `30 MB`.", + "format": "binary", + "type": "string" + }, + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" + } + }, + "required": [ + "file" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully converted audio to text.", + "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AudioToTextResponse" + "$ref": "#/components/schemas/AudioTranscriptResponse" }, "examples": { "audioToTextSuccess": { @@ -2061,6 +2306,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -2083,7 +2340,7 @@ "post": { "summary": "Convert Text to Audio", "description": "**Available for**: Chatflow, Workflow, New Agent, Chatbot, Agent, Text Generator apps.\n\nConverts text to speech audio. Pass `text` to synthesize arbitrary text, or `message_id` to voice an existing message's answer.", - "operationId": "textToAudioChat", + "operationId": "text_to_audio", "tags": [ "Audio" ], @@ -2092,7 +2349,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TextToAudioRequest" + "$ref": "#/components/schemas/TextToAudioPayloadWithUser" }, "examples": { "textToAudioExample": { @@ -2229,6 +2486,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -2244,7 +2513,7 @@ "get": { "summary": "Get App Info", "description": "**Available for**: Chatflow, Workflow, New Agent, Chatbot, Agent, Text Generator apps.\n\nReturns basic information about the app: name, description, tags, mode, and author.", - "operationId": "getChatAppInfo", + "operationId": "get_app_info", "tags": [ "Applications" ], @@ -2273,6 +2542,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "Application not found" } }, "x-mint": { @@ -2288,7 +2575,7 @@ "get": { "summary": "Get App Parameters", "description": "**Available for**: Chatflow, Workflow, New Agent, Chatbot, Agent, Text Generator apps.\n\nReturns the app's front-end configuration: the opening statement and suggested questions, feature toggles, the user input form, and file-upload limits. Use it to render the app's inputs and apply the correct upload limits.", - "operationId": "getChatAppParameters", + "operationId": "get_app_parameters", "tags": [ "Applications" ], @@ -2298,7 +2585,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AppParametersResponse" + "$ref": "#/components/schemas/Parameters" }, "examples": { "appParameters": { @@ -2391,6 +2678,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "Application not found" } }, "x-mint": { @@ -2406,7 +2711,7 @@ "get": { "summary": "Get App Meta", "description": "**Available for**: Chatflow, Workflow, New Agent, Chatbot, Agent, Text Generator apps.\n\nReturns the display icons for the tools this app uses, keyed by tool name.", - "operationId": "getChatAppMeta", + "operationId": "get_app_meta", "tags": [ "Applications" ], @@ -2434,6 +2739,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "Application not found" } }, "x-mint": { @@ -2449,7 +2772,7 @@ "get": { "summary": "Get App WebApp Settings", "description": "**Available for**: Chatflow, Workflow, New Agent, Chatbot, Agent, Text Generator apps.\n\nReturns the branding and display settings for the app's hosted web app, such as its title, icon, theme colors, and default language.", - "operationId": "getChatWebAppSettings", + "operationId": "get_app_site", "tags": [ "Applications" ], @@ -2459,7 +2782,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebAppSettingsResponse" + "$ref": "#/components/schemas/Site" }, "examples": { "webAppSettings": { @@ -2502,6 +2825,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -2517,7 +2846,7 @@ "post": { "summary": "Create Annotation", "description": "**Available for**: Chatflow, Chatbot, Agent apps.\n\nCreates an annotation. Annotations are predefined question-answer pairs the app returns directly on a match, instead of generating a fresh response.", - "operationId": "createAnnotation", + "operationId": "create_annotation", "tags": [ "Annotations" ], @@ -2526,7 +2855,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAnnotationRequest" + "$ref": "#/components/schemas/AnnotationCreatePayload" }, "examples": { "createAnnotation": { @@ -2546,7 +2875,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AnnotationItem" + "$ref": "#/components/schemas/Annotation" }, "examples": { "createdAnnotation": { @@ -2562,6 +2891,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -2575,20 +2916,20 @@ "get": { "summary": "List Annotations", "description": "**Available for**: Chatflow, Chatbot, Agent apps.\n\nLists the app's annotations, optionally filtered by keyword.", - "operationId": "getAnnotationList", + "operationId": "list_annotations", "tags": [ "Annotations" ], "parameters": [ { - "name": "page", + "name": "keyword", "in": "query", - "description": "Page number.", + "description": "Keyword to filter annotations by question or answer content.", "required": false, "schema": { - "type": "integer", - "default": 1, - "minimum": 1 + "type": "string", + "default": "", + "description": "Keyword to filter annotations by question or answer content." } }, { @@ -2599,16 +2940,20 @@ "schema": { "type": "integer", "default": 20, - "minimum": 1 + "minimum": 1, + "description": "Number of items per page." } }, { - "name": "keyword", + "name": "page", "in": "query", - "description": "Keyword to filter annotations by question or answer content.", + "description": "Page number.", "required": false, "schema": { - "type": "string" + "type": "integer", + "default": 1, + "minimum": 1, + "description": "Page number for pagination." } } ], @@ -2618,7 +2963,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AnnotationListResponse" + "$ref": "#/components/schemas/AnnotationList" }, "examples": { "annotationList": { @@ -2642,6 +2987,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -2657,7 +3014,7 @@ "put": { "summary": "Update Annotation", "description": "**Available for**: Chatflow, Chatbot, Agent apps.\n\nUpdates an annotation's question and answer.", - "operationId": "updateAnnotation", + "operationId": "update_annotation", "tags": [ "Annotations" ], @@ -2669,7 +3026,8 @@ "description": "ID of the annotation to update. Get annotation IDs from [List Annotations](/en/api-reference/annotations/list-annotations).", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "The unique identifier of the annotation to update." } } ], @@ -2678,7 +3036,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateAnnotationRequest" + "$ref": "#/components/schemas/AnnotationCreatePayload" }, "examples": { "updateAnnotation": { @@ -2698,7 +3056,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AnnotationItem" + "$ref": "#/components/schemas/Annotation" }, "examples": { "updatedAnnotation": { @@ -2731,6 +3089,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "`forbidden` : Insufficient permissions to edit annotations." } }, "x-mint": { @@ -2744,7 +3114,7 @@ "delete": { "summary": "Delete Annotation", "description": "**Available for**: Chatflow, Chatbot, Agent apps.\n\nDeletes an annotation and its associated hit history.", - "operationId": "deleteAnnotation", + "operationId": "delete_annotation", "tags": [ "Annotations" ], @@ -2756,7 +3126,8 @@ "description": "ID of the annotation to delete. Get annotation IDs from [List Annotations](/en/api-reference/annotations/list-annotations).", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "The unique identifier of the annotation to delete." } } ], @@ -2780,6 +3151,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "`forbidden` : Insufficient permissions to edit annotations." } }, "x-mint": { @@ -2795,7 +3178,7 @@ "post": { "summary": "Configure Annotation Reply", "description": "**Available for**: Chatflow, Chatbot, Agent apps.\n\nEnables or disables annotation reply for the app. Runs asynchronously; track progress with [Get Annotation Reply Job Status](/en/api-reference/annotations/get-annotation-reply-job-status).\n\nThe body is validated before the action runs, so `score_threshold`, `embedding_provider_name`, and `embedding_model_name` are required even for `disable`.", - "operationId": "initialAnnotationReplySettings", + "operationId": "annotation_reply_action", "tags": [ "Annotations" ], @@ -2808,9 +3191,10 @@ "schema": { "type": "string", "enum": [ - "enable", - "disable" - ] + "disable", + "enable" + ], + "description": "Action to perform: `enable` or `disable`." } } ], @@ -2819,7 +3203,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitialAnnotationReplySettingsRequest" + "$ref": "#/components/schemas/AnnotationReplyActionPayload" }, "examples": { "enableAnnotationReply": { @@ -2840,7 +3224,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitialAnnotationReplySettingsResponse" + "$ref": "#/components/schemas/AnnotationJobStatusResponse" }, "examples": { "annotationReplyResponse": { @@ -2853,6 +3237,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -2868,7 +3264,7 @@ "get": { "summary": "Get Annotation Reply Job Status", "description": "**Available for**: Chatflow, Chatbot, Agent apps.\n\nReturns the status of an annotation reply configuration job started by [Configure Annotation Reply](/en/api-reference/annotations/configure-annotation-reply).", - "operationId": "getInitialAnnotationReplySettingsStatus", + "operationId": "get_annotation_reply_action_status", "tags": [ "Annotations" ], @@ -2881,9 +3277,10 @@ "schema": { "type": "string", "enum": [ - "enable", - "disable" - ] + "disable", + "enable" + ], + "description": "Action to perform: `enable` or `disable`." } }, { @@ -2893,7 +3290,8 @@ "description": "Job ID returned by [Configure Annotation Reply](/en/api-reference/annotations/configure-annotation-reply).", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Job ID returned by [Configure Annotation Reply](/en/api-reference/annotations/configure-annotation-reply)." } } ], @@ -2903,7 +3301,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitialAnnotationReplySettingsStatusResponse" + "$ref": "#/components/schemas/AnnotationJobStatusDetailResponse" }, "examples": { "jobStatus": { @@ -2934,6 +3332,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "Job not found" } }, "x-mint": { @@ -2949,7 +3365,7 @@ "get": { "summary": "Get Workflow Run Detail", "description": "**Available for**: Chatflow, Workflow apps.\n\nGet a single workflow run's status, inputs, outputs, and execution metrics.", - "operationId": "getWorkflowRunDetail", + "operationId": "get_workflow_run_detail", "tags": [ "Workflow Runs" ], @@ -2960,7 +3376,8 @@ "required": true, "description": "Workflow run ID, from the response or streaming events of [Run Workflow](/en/api-reference/workflow-runs/run-workflow), or from message metadata in Chatflow apps.", "schema": { - "type": "string" + "type": "string", + "description": "Workflow run ID, obtained from the workflow execution response or streaming events." } } ], @@ -2970,7 +3387,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowRunDetailResponse" + "$ref": "#/components/schemas/WorkflowRunResponse" }, "examples": { "workflowRunDetail": { @@ -3028,6 +3445,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -3043,87 +3472,103 @@ "get": { "summary": "List Workflow Logs", "description": "**Available for**: Chatflow, Workflow apps.\n\nList past workflow runs with optional filters. Each entry is a run-level summary (status, token usage, step count, and timing), not a node-by-node execution log.\n\nTo follow a run's node-level events, stream it instead:\n\n- **A run you start**: use [Run Workflow](/en/api-reference/workflow-runs/run-workflow) in streaming mode, which emits `node_started` and `node_finished` as the run executes.\n- **A run already in progress**: call [Stream Workflow Events](/en/api-reference/workflow-runs/stream-workflow-events) with `include_state_snapshot=true` to replay each executed node's status, then stream the rest.\n\nA finished run's node-level logs aren't available through the Service API.", - "operationId": "getWorkflowLogs", + "operationId": "get_workflow_logs", "tags": [ "Workflow Runs" ], "parameters": [ { - "name": "keyword", + "name": "created_at__after", "in": "query", - "description": "Keyword to search in logs.", + "description": "Filter logs created after this ISO 8601 timestamp.", "schema": { - "type": "string" - } + "type": "string", + "format": "date-time", + "description": "Filter logs created after this ISO 8601 timestamp." + }, + "required": false }, { - "name": "status", + "name": "created_at__before", "in": "query", - "description": "Filter by execution status.", + "description": "Filter logs created before this ISO 8601 timestamp.", "schema": { "type": "string", - "enum": [ - "succeeded", - "failed", - "stopped" - ] - } + "format": "date-time", + "description": "Filter logs created before this ISO 8601 timestamp." + }, + "required": false }, { - "name": "page", + "name": "created_by_account", "in": "query", - "description": "Page number.", + "description": "Filter by the creator's account email (e.g., `name@example.com`).", "schema": { - "type": "integer", - "default": 1, - "minimum": 1, - "maximum": 99999 - } + "type": "string", + "description": "Filter by account ID." + }, + "required": false }, { - "name": "limit", + "name": "created_by_end_user_session_id", "in": "query", - "description": "Number of items per page.", + "description": "Filter by end user session ID.", "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100 - } + "type": "string", + "description": "Filter by end user session ID." + }, + "required": false }, { - "name": "created_at__before", + "name": "keyword", "in": "query", - "description": "Filter logs created before this ISO 8601 timestamp.", + "description": "Keyword to search in logs.", "schema": { "type": "string", - "format": "date-time" - } + "description": "Keyword to search in logs." + }, + "required": false }, { - "name": "created_at__after", + "name": "limit", "in": "query", - "description": "Filter logs created after this ISO 8601 timestamp.", + "description": "Number of items per page.", "schema": { - "type": "string", - "format": "date-time" - } + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 100, + "description": "Number of items per page." + }, + "required": false }, { - "name": "created_by_end_user_session_id", + "name": "page", "in": "query", - "description": "Filter by end user session ID.", + "description": "Page number.", "schema": { - "type": "string" - } + "type": "integer", + "default": 1, + "minimum": 1, + "maximum": 99999, + "description": "Page number for pagination." + }, + "required": false }, { - "name": "created_by_account", + "name": "status", "in": "query", - "description": "Filter by the creator's account email (e.g., `name@example.com`).", + "description": "Filter by execution status.", "schema": { - "type": "string" - } + "type": "string", + "enum": [ + "failed", + "stopped", + "succeeded" + ], + "description": "Filter by execution status." + }, + "required": false } ], "responses": { @@ -3132,7 +3577,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowLogsResponse" + "$ref": "#/components/schemas/WorkflowAppLogPaginationResponse" }, "examples": { "workflowLogs": { @@ -3192,6 +3637,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -3210,14 +3667,15 @@ ], "summary": "Get Human Input Form", "description": "**Available for**: Chatflow, Workflow apps.\n\nReturns the contents of a paused Human Input form. Requires web app delivery.\n\nFor the full sequence of Human Input calls, see [Human Input Flow](/en/api-reference/guides/human-input-flow).", - "operationId": "getChatflowHumanInputForm", + "operationId": "get_human_input_form", "parameters": [ { "name": "form_token", "in": "path", "required": true, "schema": { - "type": "string" + "type": "string", + "description": "Human input form token" }, "description": "Access token for the paused form, returned in the `human_input_required` event from the Run Workflow or Send Chat Message endpoint in streaming mode." } @@ -3228,163 +3686,17 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "form_content": { - "type": "string", - "description": "Pre-rendered form body with workflow variables substituted." - }, - "inputs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "Form input control type. Available values: `paragraph` (multi-line text input), `select` (single-choice from a list), `file` (single file upload), and `file-list` (multiple file uploads)." - }, - "output_variable_name": { - "type": "string", - "description": "Variable name used to reference this input's submitted value inside the workflow. Corresponds to the key in the submission `inputs` object." - }, - "default": { - "type": "object", - "nullable": true, - "description": "Raw default-value configuration for `paragraph` inputs. The client should not resolve this directly; use `resolved_default_values` to display defaults. absent for other input types or when no default is configured.", - "properties": { - "type": { - "type": "string", - "description": "Source of the default. `constant` means `value` is used as a literal string; `variable` means `selector` points to a workflow variable." - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Variable reference path (for example, `[\"node_id\", \"var_name\"]`) when `type` is `variable`. Must contain at least two elements." - }, - "value": { - "type": "string", - "description": "Literal default value when `type` is `constant`. Always a string." - } - } - }, - "option_source": { - "type": "object", - "description": "Source of options for `select` inputs. Present only when `type` is `select`.", - "properties": { - "type": { - "type": "string", - "enum": [ - "variable", - "constant" - ], - "description": "Origin of the options. `constant` means `value` lists the options literally; `variable` means `selector` points to an `array[string]` workflow variable that provides them." - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Variable reference path when `type` is `variable`." - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Literal option list when `type` is `constant`." - } - } - }, - "allowed_file_types": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "image", - "document", - "audio", - "video", - "custom" - ] - }, - "description": "File categories the recipient may upload. Present for `file` and `file-list` inputs. Values: `image`, `document`, `audio`, `video`, `custom`." - }, - "allowed_file_extensions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Allowed file extensions when `allowed_file_types` includes `custom`. Include the leading `.` in each extension, for example `.md`. Present for `file` and `file-list` inputs." - }, - "allowed_file_upload_methods": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "local_file", - "remote_url" - ] - }, - "description": "Upload methods the recipient may use. Values: `local_file`, `remote_url`. Present for `file` and `file-list` inputs." - }, - "number_limits": { - "type": "integer", - "description": "Maximum number of files the recipient may upload. Present only for `file-list` inputs." - } - } - }, - "description": "Form input field definitions." - }, - "resolved_default_values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Pre-rendered values to display in the form. Keyed by input `output_variable_name`. Populated for `paragraph` inputs whose default resolves from a workflow variable; empty for inputs with no resolvable default. Display these values; do not re-resolve `default` on the client. All values are stringified." - }, - "user_actions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "maxLength": 20, - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Identifier of the action button. Pass as `action` on [Submit Human Input Form](/en/api-reference/human-input/submit-human-input-form) when the recipient selects this button." - }, - "title": { - "type": "string", - "maxLength": 100, - "description": "Button label shown to the recipient." - }, - "button_style": { - "type": "string", - "description": "Visual style of the button. Available values: `primary`, `default`, `accent`, `ghost`." - } - } - }, - "description": "Available submission actions." - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp (seconds) after which this form can no longer be submitted.", - "nullable": true - } - } - }, - "examples": { - "success": { - "summary": "Response Example", - "value": { - "form_content": "Please review the draft, set a priority, and confirm or request changes.", - "inputs": [ - { - "type": "paragraph", - "output_variable_name": "feedback", + "$ref": "#/components/schemas/HumanInputFormDefinitionResponse" + }, + "examples": { + "success": { + "summary": "Response Example", + "value": { + "form_content": "Please review the draft, set a priority, and confirm or request changes.", + "inputs": [ + { + "type": "paragraph", + "output_variable_name": "feedback", "default": { "type": "constant", "selector": [], @@ -3495,6 +3807,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -3511,14 +3835,15 @@ ], "summary": "Submit Human Input Form", "description": "**Available for**: Chatflow, Workflow apps.\n\nSubmits the recipient's response to a paused Human Input form. On acceptance the workflow resumes; follow the resumed run via [Stream Workflow Events](/en/api-reference/workflow-runs/stream-workflow-events). Requires web app delivery.", - "operationId": "submitChatflowHumanInputForm", + "operationId": "submit_human_input_form", "parameters": [ { "name": "form_token", "in": "path", "required": true, "schema": { - "type": "string" + "type": "string", + "description": "Human input form token" }, "description": "Access token for the paused form, returned in the `human_input_required` event from the Run Workflow or Send Chat Message endpoint in streaming mode." } @@ -3528,27 +3853,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "inputs", - "action", - "user" - ], - "properties": { - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "Submitted values keyed by each input's `output_variable_name`. Paragraph and select inputs take a string; a `file` input takes one file mapping; a `file-list` input takes an array of file mappings.\n\nA file mapping is `{transfer_method: local_file, upload_file_id, type}` or `{transfer_method: remote_url, url, type}`, where `type` is one of the field's `allowed_file_types`. For `local_file`, `upload_file_id` is the `id` from [Upload File](/en/api-reference/files/upload-file).\n\nUse a consistent `user` across the run, upload, and submit." - }, - "action": { - "type": "string", - "description": "ID of the action button the recipient selected. Must match one of the `id` values from the form's `user_actions` list (returned by [Get Human Input Form](/en/api-reference/human-input/get-human-input-form))." - }, - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. Service API and web app user IDs are separate, even when identical. See [End User Identity](/en/api-reference/guides/end-user-identity)." - } - } + "$ref": "#/components/schemas/HumanInputFormSubmitPayloadWithUser" }, "examples": { "approve": { @@ -3589,7 +3894,7 @@ "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/HumanInputFormSubmitResponse" }, "examples": { "success": { @@ -3666,6 +3971,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-mint": { @@ -3684,7 +4001,7 @@ ], "summary": "Stream Workflow Events", "description": "**Available for**: Chatflow, Workflow apps.\n\nResume the Server-Sent Events stream for a workflow run after a pause or a dropped SSE connection. For runs that have already finished, the stream emits a single `workflow_finished` event and closes.\n\nTo check an in-progress run's node-level status and progress, call it with `include_state_snapshot=true`: the stream replays each already-executed node's status before streaming new events.", - "operationId": "streamWorkflowEvents", + "operationId": "get_workflow_events", "parameters": [ { "name": "workflow_run_id", @@ -3692,18 +4009,20 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "description": "Workflow run ID returned by the original workflow run request." }, "description": "Workflow run ID whose event stream to resume, from the response or streaming events of [Run Workflow](/en/api-reference/workflow-runs/run-workflow)." }, { - "name": "user", + "name": "continue_on_pause", "in": "query", - "required": true, + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false, + "description": "Set to `true` to keep the stream open across multiple `workflow_paused` events, which is useful when the workflow has more than one Human Input node in sequence. By default, the stream closes after the first pause." }, - "description": "End-user identifier, defined by your app and unique within it. Must match the `user` that started the run. See [End User Identity](/en/api-reference/guides/end-user-identity)." + "description": "Set to `true` to keep the stream open across multiple `workflow_paused` events (useful when the workflow has more than one Human Input node in sequence). Default closes the stream after the first pause." }, { "name": "include_state_snapshot", @@ -3711,19 +4030,20 @@ "required": false, "schema": { "type": "boolean", - "default": false + "default": false, + "description": "When `true`, replay from the persisted state snapshot to include a status summary of already-executed nodes before streaming new events." }, "description": "When `true`, replay from the persisted state snapshot to include a status summary of already-executed nodes before streaming new events." }, { - "name": "continue_on_pause", + "name": "user", "in": "query", - "required": false, + "required": true, "schema": { - "type": "boolean", - "default": false + "type": "string", + "description": "End-user identifier that originally triggered the run. Must match the creator of the run." }, - "description": "Set to `true` to keep the stream open across multiple `workflow_paused` events (useful when the workflow has more than one Human Input node in sequence). Default closes the stream after the first pause." + "description": "End-user identifier, defined by your app and unique within it. Must match the `user` that started the run. See [End User Identity](/en/api-reference/guides/end-user-identity)." } ], "responses": { @@ -3781,6 +4101,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" } }, "x-codeSamples": [ @@ -3808,7 +4140,7 @@ "post": { "summary": "Run Workflow", "description": "**Available for**: Workflow apps.\n\nRun the app's published workflow and return its outputs, either in a single `blocking` response or as a `streaming` Server-Sent Events feed. Requires a published workflow.", - "operationId": "executeWorkflow", + "operationId": "run_workflow", "tags": [ "Workflow Runs" ], @@ -3817,7 +4149,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowExecutionRequest" + "$ref": "#/components/schemas/WorkflowRunPayloadWithUser" }, "examples": { "streaming_example": { @@ -4013,6 +4345,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "Workflow not found" } }, "x-mint": { @@ -4035,7 +4385,7 @@ "post": { "summary": "Run Workflow by ID", "description": "**Available for**: Workflow apps.\n\nRun a specific published workflow version, identified by the `workflow_id` in the path. Request body, response, and streaming behavior match [Run Workflow](/en/api-reference/workflow-runs/run-workflow); only the executed version differs.", - "operationId": "runWorkflowById", + "operationId": "run_workflow_by_id", "tags": [ "Workflow Runs" ], @@ -4046,7 +4396,8 @@ "required": true, "description": "Published workflow version to run. Returned in the `workflow_id` field of [Run Workflow](/en/api-reference/workflow-runs/run-workflow) responses and [Get Workflow Run Detail](/en/api-reference/workflow-runs/get-workflow-run-detail). Must reference a published version; a draft version ID is rejected with `bad_request`.", "schema": { - "type": "string" + "type": "string", + "description": "Workflow ID of the specific version to execute. This value is returned in the `workflow_id` field of workflow run responses." } } ], @@ -4055,7 +4406,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowExecutionRequest" + "$ref": "#/components/schemas/WorkflowRunPayloadWithUser" }, "examples": { "example": { @@ -4262,6 +4613,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -4277,7 +4634,7 @@ "post": { "summary": "Stop Workflow Task", "description": "**Available for**: Workflow apps.\n\nStop a running workflow task. Only supported in `streaming` mode.", - "operationId": "stopWorkflowTaskGeneration", + "operationId": "stop_workflow_task", "tags": [ "Workflow Runs" ], @@ -4288,7 +4645,8 @@ "required": true, "description": "Task ID, from the streaming events of [Run Workflow](/en/api-reference/workflow-runs/run-workflow).", "schema": { - "type": "string" + "type": "string", + "description": "Task ID, obtained from the streaming chunk returned by the Run Workflow API." } } ], @@ -4297,16 +4655,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. Need not match the `user` that started the run; the stop applies to the task regardless of `user`. See [End User Identity](/en/api-reference/guides/end-user-identity)." - } - } + "$ref": "#/components/schemas/RequiredServiceApiUserPayload" }, "examples": { "example": { @@ -4321,7 +4670,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleResultResponse" + } + } + }, + "description": "Task stopped successfully" }, "400": { "description": "- `not_workflow_app` : App mode does not match the API route.\n- `invalid_param` : A request parameter is missing or invalid, such as a missing `user`.", @@ -4347,6 +4703,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "Task not found" } }, "x-mint": { @@ -4362,7 +4736,7 @@ "post": { "summary": "Send Completion Message", "description": "**Available for**: Text Generator apps.\n\nSends a request to a text-generation app and returns the generated text.", - "operationId": "createCompletionMessage", + "operationId": "create_completion", "tags": [ "Completion Messages" ], @@ -4372,7 +4746,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CompletionRequest" + "$ref": "#/components/schemas/CompletionRequestPayloadWithUser" }, "examples": { "streaming_example": { @@ -4414,7 +4788,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CompletionResponse" + "$ref": "#/components/schemas/CompletionBlockingResponse" }, "examples": { "blockingResponse": { @@ -4551,6 +4925,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "Conversation not found" } }, "x-mint": { @@ -4573,7 +4965,7 @@ "post": { "summary": "Stop Completion Message Generation", "description": "**Available for**: Text Generator apps.\n\nStops a completion message generation task. Only supported in `streaming` mode.", - "operationId": "stopGenerate", + "operationId": "stop_completion", "tags": [ "Completion Messages" ], @@ -4584,7 +4976,8 @@ "required": true, "description": "Task ID, from the streaming events of [Send Completion Message](/en/api-reference/completion-messages/send-completion-message).", "schema": { - "type": "string" + "type": "string", + "description": "Task ID, obtained from a streaming chunk returned by the Send Completion Message API." } } ], @@ -4593,16 +4986,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. Must match the `user` sent with the original message; if it differs, the stop silently does nothing and still returns success. See [End User Identity](/en/api-reference/guides/end-user-identity)." - } - } + "$ref": "#/components/schemas/RequiredServiceApiUserPayload" }, "examples": { "example": { @@ -4617,7 +5001,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleResultResponse" + } + } + }, + "description": "Task stopped successfully" }, "400": { "description": "- `app_unavailable` : App unavailable or misconfigured.\n- `invalid_param` : The required `user` field is missing.", @@ -4643,6 +5034,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - token scope, app, dataset, or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "Task not found" } }, "x-mint": { @@ -4661,101 +5070,13 @@ ], "summary": "Create an Empty Knowledge Base", "description": "Creates an empty knowledge base. Add documents to it with [Create Document by Text](/en/api-reference/documents/create-document-by-text) or [Create Document by File](/en/api-reference/documents/create-document-by-file).", - "operationId": "createDataset", + "operationId": "create_dataset", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 40, - "description": "Name of the knowledge base." - }, - "description": { - "type": "string", - "maxLength": 400, - "default": "", - "description": "Description of the knowledge base." - }, - "indexing_technique": { - "type": "string", - "enum": [ - "high_quality", - "economy" - ], - "nullable": true, - "description": "`high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing." - }, - "permission": { - "type": "string", - "enum": [ - "only_me", - "all_team_members", - "partial_members" - ], - "default": "only_me", - "description": "Controls who can access this knowledge base. `only_me` restricts to the creator, `all_team_members` grants access to the entire workspace, `partial_members` grants access to specified members." - }, - "provider": { - "type": "string", - "enum": [ - "vendor", - "external" - ], - "default": "vendor", - "description": "`vendor` for internal knowledge base, `external` for external knowledge base." - }, - "embedding_model": { - "type": "string", - "description": "Embedding model name. Use the `model` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`." - }, - "embedding_model_provider": { - "type": "string", - "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). A bare name like `openai` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`." - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "Retrieval model configuration. Controls how chunks are searched and ranked when querying this knowledge base." - }, - "external_knowledge_api_id": { - "type": "string", - "description": "ID of the external knowledge API connection." - }, - "external_knowledge_id": { - "type": "string", - "description": "ID of the external knowledge base." - }, - "summary_index_setting": { - "type": "object", - "nullable": true, - "description": "Summary index configuration.", - "properties": { - "enable": { - "type": "boolean", - "description": "Whether to enable summary indexing." - }, - "model_name": { - "type": "string", - "description": "Name of the model used for generating summaries." - }, - "model_provider_name": { - "type": "string", - "description": "Provider of the summary generation model." - }, - "summary_prompt": { - "type": "string", - "description": "Custom prompt template for summary generation." - } - } - } - } + "$ref": "#/components/schemas/DatasetCreatePayload" } } } @@ -4766,7 +5087,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/DatasetDetailResponse" }, "examples": { "success": { @@ -4876,6 +5197,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -4892,42 +5219,50 @@ ], "summary": "List Knowledge Bases", "description": "Returns a paginated list of knowledge bases, optionally filtered by keyword or tags.", - "operationId": "listDatasets", + "operationId": "list_datasets", "parameters": [ { - "name": "page", + "name": "include_all", "in": "query", "schema": { - "type": "integer", - "default": 1 + "type": "boolean", + "default": false, + "description": "Whether to include all knowledge bases regardless of permissions." }, - "description": "Page number." + "description": "Whether to include all knowledge bases regardless of permissions.", + "required": false }, { - "name": "limit", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 20 + "type": "string", + "description": "Search keyword to filter by name." }, - "description": "Number of items per page." + "description": "Search keyword to filter by name.", + "required": false }, { - "name": "keyword", + "name": "limit", "in": "query", "schema": { - "type": "string" + "type": "integer", + "default": 20, + "description": "Number of items per page. Server caps at `100`." }, - "description": "Search keyword to filter by name." + "description": "Number of items per page.", + "required": false }, { - "name": "include_all", + "name": "page", "in": "query", "schema": { - "type": "boolean", - "default": false + "type": "integer", + "default": 1, + "description": "Page number to retrieve." }, - "description": "Whether to include all knowledge bases regardless of permissions." + "description": "Page number.", + "required": false }, { "name": "tag_ids", @@ -4936,11 +5271,11 @@ "type": "array", "items": { "type": "string" - } + }, + "description": "Tag IDs to filter by." }, - "style": "form", - "explode": true, - "description": "Tag IDs to filter by. Get tag IDs from [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags)." + "description": "Tag IDs to filter by. Get tag IDs from [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags).", + "required": false } ], "responses": { @@ -4949,32 +5284,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "Array of knowledge base objects.", - "items": { - "$ref": "#/components/schemas/Dataset" - } - }, - "has_more": { - "type": "boolean", - "description": "Whether more items exist on the next page." - }, - "limit": { - "type": "integer", - "description": "Number of items per page." - }, - "total": { - "type": "integer", - "description": "Total number of matching items." - }, - "page": { - "type": "integer", - "description": "Current page number." - } - } + "$ref": "#/components/schemas/DatasetListResponse" }, "examples": { "success": { @@ -5041,6 +5351,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - dataset API access or workspace access denied" } }, "x-mint": { @@ -5059,7 +5381,7 @@ ], "summary": "Get Knowledge Base", "description": "Returns detailed information about a knowledge base, including its embedding model, retrieval configuration, and document statistics.", - "operationId": "getDatasetDetail", + "operationId": "get_dataset", "parameters": [ { "name": "dataset_id", @@ -5067,7 +5389,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID, from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -5078,7 +5401,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/DatasetDetailWithPartialMembersResponse" }, "examples": { "success": { @@ -5171,6 +5494,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -5187,7 +5516,7 @@ ], "summary": "Update Knowledge Base", "description": "Updates a knowledge base. Only the fields included in the request body are changed.", - "operationId": "updateDataset", + "operationId": "update_dataset", "parameters": [ { "name": "dataset_id", @@ -5195,7 +5524,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID, from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -5205,89 +5535,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 40, - "description": "Name of the knowledge base." - }, - "description": { - "type": "string", - "maxLength": 400, - "description": "Description of the knowledge base." - }, - "indexing_technique": { - "type": "string", - "enum": [ - "high_quality", - "economy" - ], - "nullable": true, - "description": "`high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing." - }, - "permission": { - "type": "string", - "enum": [ - "only_me", - "all_team_members", - "partial_members" - ], - "description": "Controls who can access this knowledge base. `only_me` restricts to the creator, `all_team_members` grants access to the entire workspace, `partial_members` grants access to specified members." - }, - "embedding_model": { - "type": "string", - "description": "Embedding model name. Use the `model` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`." - }, - "embedding_model_provider": { - "type": "string", - "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). A bare name like `openai` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`." - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "Retrieval model configuration. Controls how chunks are searched and ranked when querying this knowledge base." - }, - "partial_member_list": { - "type": "array", - "description": "List of team members with access when `permission` is `partial_members`.", - "items": { - "type": "object", - "properties": { - "user_id": { - "type": "string", - "description": "ID of the team member to grant access." - } - } - } - }, - "external_retrieval_model": { - "type": "object", - "description": "Retrieval settings for external knowledge bases.", - "properties": { - "top_k": { - "type": "integer", - "description": "Maximum number of results to return." - }, - "score_threshold": { - "type": "number", - "description": "Minimum similarity score threshold for filtering results." - }, - "score_threshold_enabled": { - "type": "boolean", - "description": "Whether score threshold filtering is enabled." - } - } - }, - "external_knowledge_id": { - "type": "string", - "description": "ID of the external knowledge base." - }, - "external_knowledge_api_id": { - "type": "string", - "description": "ID of the external knowledge API connection." - } - } + "$ref": "#/components/schemas/DatasetUpdatePayload" } } } @@ -5298,7 +5546,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/DatasetDetailWithPartialMembersResponse" }, "examples": { "success": { @@ -5417,6 +5665,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -5433,7 +5687,7 @@ ], "summary": "Delete Knowledge Base", "description": "Permanently deletes a knowledge base and all of its documents.", - "operationId": "deleteDataset", + "operationId": "delete_dataset", "parameters": [ { "name": "dataset_id", @@ -5441,7 +5695,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID, from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -5491,6 +5746,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "409": { + "content": { + "application/json": {} + }, + "description": "`dataset_in_use` : The knowledge base is being used by some apps. Please remove it from the apps before deleting." } }, "x-mint": { @@ -5509,7 +5776,7 @@ ], "summary": "Create Document by Text", "description": "Creates a document in a knowledge base from raw text. Indexing runs asynchronously; track it with the returned `batch` ID via [Get Document Indexing Status](/en/api-reference/documents/get-document-indexing-status).", - "operationId": "createDocumentFromText", + "operationId": "create_document_by_text", "parameters": [ { "name": "dataset_id", @@ -5517,7 +5784,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -5527,123 +5795,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name", - "text" - ], - "properties": { - "name": { - "type": "string", - "description": "Document name." - }, - "text": { - "type": "string", - "description": "Document text content." - }, - "indexing_technique": { - "type": "string", - "enum": [ - "high_quality", - "economy" - ], - "description": "Required when adding the first document to a knowledge base. Subsequent documents inherit the knowledge base's indexing technique if omitted. `high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing." - }, - "doc_form": { - "type": "string", - "enum": [ - "text_model", - "hierarchical_model", - "qa_model" - ], - "default": "text_model", - "description": "`text_model` for standard text chunking, `hierarchical_model` for parent-child chunk structure, `qa_model` for question-answer pair extraction." - }, - "doc_language": { - "type": "string", - "default": "English", - "description": "Language of the document for processing optimization." - }, - "process_rule": { - "type": "object", - "description": "Processing rules for chunking.", - "required": [ - "mode" - ], - "properties": { - "mode": { - "type": "string", - "enum": [ - "automatic", - "custom", - "hierarchical" - ], - "description": "`automatic` uses built-in rules, `custom` allows manual configuration, `hierarchical` enables parent-child chunk structure (use with `doc_form: hierarchical_model`)." - }, - "rules": { - "type": "object", - "properties": { - "pre_processing_rules": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "remove_stopwords", - "remove_extra_spaces", - "remove_urls_emails" - ], - "description": "Rule identifier." - }, - "enabled": { - "type": "boolean", - "description": "Whether this preprocessing rule is enabled." - } - } - } - }, - "segmentation": { - "type": "object", - "properties": { - "separator": { - "type": "string", - "default": "\n", - "description": "Custom separator for splitting text." - }, - "max_tokens": { - "type": "integer", - "description": "Maximum token count per chunk." - }, - "chunk_overlap": { - "type": "integer", - "default": 0, - "description": "Token overlap between chunks." - } - } - } - } - } - } - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "Controls how chunks are searched and ranked when querying this knowledge base." - }, - "embedding_model": { - "type": "string", - "description": "Embedding model name. Use the `model` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`." - }, - "embedding_model_provider": { - "type": "string", - "description": "Embedding model provider. Use the `provider` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`." - }, - "original_document_id": { - "type": "string", - "description": "Original document ID for versioning. Get it from [List Documents](/en/api-reference/documents/list-documents)." - } - } + "$ref": "#/components/schemas/DocumentTextCreatePayload" } } } @@ -5654,16 +5806,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "Batch ID for tracking indexing progress." - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -5780,39 +5923,11 @@ } } }, - "404": { - "description": "`not_found` : Knowledge base not found.", - "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } - }, - "503": { - "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -5831,7 +5946,7 @@ ], "summary": "Create Document by File", "description": "Creates a document in a knowledge base from an uploaded file. Common formats such as PDF, TXT, and DOCX are supported. Indexing runs asynchronously; track it with the returned `batch` ID via [Get Document Indexing Status](/en/api-reference/documents/get-document-indexing-status).", - "operationId": "createDocumentFromFile", + "operationId": "create_document_by_file", "parameters": [ { "name": "dataset_id", @@ -5839,7 +5954,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -5875,16 +5991,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "Batch ID for tracking indexing progress." - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -6025,23 +6132,6 @@ } } }, - "404": { - "description": "`not_found` : Knowledge base not found.", - "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } - }, "413": { "description": "`file_too_large` : The uploaded file exceeds the maximum size.", "content": { @@ -6059,22 +6149,11 @@ } } }, - "503": { - "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -6100,7 +6179,7 @@ ], "summary": "List Documents", "description": "Returns a paginated list of documents in a knowledge base.", - "operationId": "listDocuments", + "operationId": "list_documents", "parameters": [ { "name": "dataset_id", @@ -6108,35 +6187,42 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, { - "name": "page", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 1 + "type": "string", + "description": "Search keyword to filter by document name." }, - "description": "Page number." + "description": "Search keyword to filter by document name.", + "required": false }, { "name": "limit", "in": "query", "schema": { "type": "integer", - "default": 20 + "default": 20, + "description": "Number of items per page. Server caps at `100`." }, - "description": "Number of items per page. Server caps at `100`." + "description": "Number of items per page. Server caps at `100`.", + "required": false }, { - "name": "keyword", + "name": "page", "in": "query", "schema": { - "type": "string" + "type": "integer", + "default": 1, + "description": "Page number to retrieve." }, - "description": "Search keyword to filter by document name." + "description": "Page number.", + "required": false }, { "name": "status", @@ -6144,16 +6230,18 @@ "schema": { "type": "string", "enum": [ - "queuing", - "indexing", - "paused", - "error", + "archived", "available", "disabled", - "archived" - ] + "error", + "indexing", + "paused", + "queuing" + ], + "description": "Filter by display status." }, - "description": "Filter by display status." + "description": "Filter by display status.", + "required": false } ], "responses": { @@ -6162,32 +6250,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "Array of document objects.", - "items": { - "$ref": "#/components/schemas/Document" - } - }, - "has_more": { - "type": "boolean", - "description": "Whether more items exist on the next page." - }, - "limit": { - "type": "integer", - "description": "Number of items per page." - }, - "total": { - "type": "integer", - "description": "Total number of matching items." - }, - "page": { - "type": "integer", - "description": "Current page number." - } - } + "$ref": "#/components/schemas/DocumentListResponse" }, "examples": { "success": { @@ -6276,6 +6339,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -6294,7 +6363,7 @@ ], "summary": "Get Document", "description": "Returns detailed information for a single document.", - "operationId": "getDocumentDetail", + "operationId": "get_document", "parameters": [ { "name": "dataset_id", @@ -6302,7 +6371,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -6312,7 +6382,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. From [List Documents](/en/api-reference/documents/list-documents)." }, @@ -6326,9 +6397,11 @@ "only", "without" ], - "default": "all" + "default": "all", + "description": "`all` returns all fields including metadata. `only` returns only `id`, `doc_type`, and `doc_metadata`. `without` returns all fields except `doc_metadata`." }, - "description": "`all` returns all fields including metadata. `only` returns only `id`, `doc_type`, and `doc_metadata`. `without` returns all fields except `doc_metadata`." + "description": "`all` returns all fields including metadata. `only` returns only `id`, `doc_type`, and `doc_metadata`. `without` returns all fields except `doc_metadata`.", + "required": false } ], "responses": { @@ -6337,198 +6410,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Document identifier." - }, - "position": { - "type": "integer", - "description": "Position index within the knowledge base." - }, - "data_source_type": { - "type": "string", - "description": "How the document was uploaded. `upload_file` for file uploads, `notion_import` for Notion imports." - }, - "data_source_info": { - "type": "object", - "description": "Data source details. For file uploads, this detail endpoint returns the full file object under `upload_file` (the list endpoint returns only `upload_file_id`).", - "properties": { - "upload_file": { - "type": "object", - "description": "Uploaded file details. Present when `data_source_type` is `upload_file`.", - "properties": { - "id": { - "type": "string", - "description": "File identifier." - }, - "name": { - "type": "string", - "description": "Original file name." - }, - "size": { - "type": "integer", - "description": "File size in bytes." - }, - "extension": { - "type": "string", - "description": "File extension." - }, - "mime_type": { - "type": "string", - "description": "File MIME type." - }, - "created_by": { - "type": "string", - "description": "ID of the user who uploaded the file." - }, - "created_at": { - "type": "integer", - "description": "Unix timestamp of file upload." - } - } - } - } - }, - "dataset_process_rule_id": { - "type": "string", - "description": "ID of the processing rule applied to this document." - }, - "dataset_process_rule": { - "type": "object", - "description": "Knowledge-base-level processing rule configuration." - }, - "document_process_rule": { - "type": "object", - "description": "Document-level processing rule configuration." - }, - "name": { - "type": "string", - "description": "Document name." - }, - "created_from": { - "type": "string", - "description": "Origin of the document. `api` for API creation, `web` for UI creation." - }, - "created_by": { - "type": "string", - "description": "ID of the user who created the document." - }, - "created_at": { - "type": "number", - "description": "Unix timestamp of document creation." - }, - "tokens": { - "type": "integer", - "description": "Number of tokens in the document." - }, - "indexing_status": { - "type": "string", - "description": "Current indexing status, e.g. `waiting`, `parsing`, `cleaning`, `splitting`, `indexing`, `completed`, `error`, `paused`." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if indexing failed, `null` otherwise." - }, - "enabled": { - "type": "boolean", - "description": "Whether the document is enabled for retrieval." - }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "Unix timestamp when the document was disabled, `null` if enabled." - }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "ID of the user who disabled the document, `null` if enabled." - }, - "archived": { - "type": "boolean", - "description": "Whether the document is archived." - }, - "display_status": { - "type": "string", - "description": "Display-friendly indexing status for the UI." - }, - "hit_count": { - "type": "integer", - "description": "Number of times this document has been retrieved." - }, - "doc_form": { - "type": "string", - "description": "Document chunking mode. `text_model` for standard text, `hierarchical_model` for parent-child, `qa_model` for QA pairs." - }, - "doc_language": { - "type": "string", - "description": "Language of the document content." - }, - "doc_type": { - "type": "string", - "nullable": true, - "description": "Document type classification, `null` if not set." - }, - "doc_metadata": { - "type": "array", - "description": "Custom metadata key-value pairs for this document.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Metadata field identifier." - }, - "name": { - "type": "string", - "description": "Metadata field name." - }, - "type": { - "type": "string", - "description": "Metadata field type." - }, - "value": { - "type": "string", - "description": "Metadata field value for this document." - } - } - } - }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "Unix timestamp when processing completed, `null` if not yet completed." - }, - "updated_at": { - "type": "number", - "nullable": true, - "description": "Unix timestamp of last update, `null` if never updated." - }, - "indexing_latency": { - "type": "number", - "nullable": true, - "description": "Time taken for indexing in seconds, `null` if not completed." - }, - "segment_count": { - "type": "integer", - "description": "Number of chunks in the document." - }, - "average_segment_length": { - "type": "number", - "description": "Average character length of chunks." - }, - "summary_index_status": { - "type": "string", - "nullable": true, - "description": "Status of summary indexing, `null` if summary index is not enabled." - }, - "need_summary": { - "type": "boolean", - "description": "Whether the document needs summary generation." - } - } + "$ref": "#/components/schemas/DocumentDetailResponse" }, "examples": { "success": { @@ -6652,6 +6534,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -6668,7 +6556,7 @@ ], "summary": "Delete Document", "description": "Permanently deletes a document and all its chunks from the knowledge base.", - "operationId": "deleteDocument", + "operationId": "delete_document", "parameters": [ { "name": "dataset_id", @@ -6676,7 +6564,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -6686,7 +6575,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. From [List Documents](/en/api-reference/documents/list-documents)." } @@ -6752,6 +6642,18 @@ } } } + }, + "400": { + "content": { + "application/json": {} + }, + "description": "`document_indexing` : Cannot delete document during indexing." + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -6768,7 +6670,7 @@ ], "summary": "Update Document", "description": "Updates a document by uploading a new file, then re-indexes it. This is the canonical endpoint for file-based document updates. Track progress with the returned `batch` ID via [Get Document Indexing Status](/en/api-reference/documents/get-document-indexing-status).", - "operationId": "updateDocument", + "operationId": "update_document_by_file", "parameters": [ { "name": "dataset_id", @@ -6776,7 +6678,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -6786,13 +6689,14 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. From [List Documents](/en/api-reference/documents/list-documents)." } ], "requestBody": { - "required": true, + "required": false, "content": { "multipart/form-data": { "schema": { @@ -6819,16 +6723,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "Batch ID for tracking indexing progress." - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -7012,22 +6907,11 @@ } } }, - "503": { - "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -7053,7 +6937,7 @@ ], "summary": "Download Document", "description": "Returns a signed URL for downloading a document's original uploaded file.", - "operationId": "downloadDocument", + "operationId": "get_document_download_url", "parameters": [ { "name": "dataset_id", @@ -7061,7 +6945,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -7071,7 +6956,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. From [List Documents](/en/api-reference/documents/list-documents)." } @@ -7082,13 +6968,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Signed URL to download the original uploaded file." - } - } + "$ref": "#/components/schemas/UrlResponse" }, "examples": { "success": { @@ -7166,6 +7046,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -7184,26 +7070,28 @@ ], "summary": "Get Document Indexing Status", "description": "Returns indexing progress for every document in a batch: the current stage and chunk completion counts. Poll until each `indexing_status` reaches `completed` or `error`. Status advances through `waiting` → `parsing` → `cleaning` → `splitting` → `indexing` → `completed`.", - "operationId": "getDocumentIndexingStatus", + "operationId": "get_document_indexing_status", "parameters": [ { - "name": "dataset_id", + "name": "batch", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "description": "Batch ID." }, - "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." + "description": "Batch ID returned when you create or update a document." }, { - "name": "batch", + "name": "dataset_id", "in": "path", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid", + "description": "Knowledge base ID." }, - "description": "Batch ID returned when you create or update a document." + "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } ], "responses": { @@ -7212,74 +7100,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "List of indexing status entries.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Document identifier." - }, - "indexing_status": { - "type": "string", - "description": "Current indexing status: `waiting`, `parsing`, `cleaning`, `splitting`, `indexing`, `completed`, or `error`." - }, - "processing_started_at": { - "type": "number", - "nullable": true, - "description": "Unix timestamp when processing started." - }, - "parsing_completed_at": { - "type": "number", - "nullable": true, - "description": "Unix timestamp when parsing completed." - }, - "cleaning_completed_at": { - "type": "number", - "nullable": true, - "description": "Unix timestamp when cleaning completed." - }, - "splitting_completed_at": { - "type": "number", - "nullable": true, - "description": "Unix timestamp when splitting completed." - }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "Unix timestamp when indexing completed." - }, - "paused_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when indexing was paused. `null` if not paused." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if indexing failed. `null` if no error." - }, - "stopped_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when indexing was stopped. `null` if not stopped." - }, - "completed_segments": { - "type": "integer", - "description": "Number of chunks that have been indexed." - }, - "total_segments": { - "type": "integer", - "description": "Total number of chunks to be indexed." - } - } - } - } - } + "$ref": "#/components/schemas/DocumentStatusListResponse" }, "examples": { "success": { @@ -7348,6 +7169,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -7366,7 +7193,7 @@ ], "summary": "Update Document by Text", "description": "Updates a document's text content, name, or processing configuration. Re-indexes the document when its text changes.", - "operationId": "updateDocumentByText", + "operationId": "update_document_by_text", "parameters": [ { "name": "dataset_id", @@ -7374,7 +7201,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -7384,7 +7212,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. From [List Documents](/en/api-reference/documents/list-documents)." } @@ -7394,99 +7223,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Document name. Required when `text` is provided." - }, - "text": { - "type": "string", - "description": "Document text content." - }, - "process_rule": { - "type": "object", - "description": "Processing rules for chunking.", - "required": [ - "mode" - ], - "properties": { - "mode": { - "type": "string", - "enum": [ - "automatic", - "custom", - "hierarchical" - ], - "description": "`automatic` uses built-in rules, `custom` allows manual configuration, `hierarchical` enables parent-child chunk structure (use with `doc_form: hierarchical_model`)." - }, - "rules": { - "type": "object", - "properties": { - "pre_processing_rules": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "remove_stopwords", - "remove_extra_spaces", - "remove_urls_emails" - ], - "description": "Rule identifier." - }, - "enabled": { - "type": "boolean", - "description": "Whether this preprocessing rule is enabled." - } - } - } - }, - "segmentation": { - "type": "object", - "properties": { - "separator": { - "type": "string", - "default": "\n", - "description": "Custom separator for splitting text." - }, - "max_tokens": { - "type": "integer", - "description": "Maximum token count per chunk." - }, - "chunk_overlap": { - "type": "integer", - "default": 0, - "description": "Token overlap between chunks." - } - } - } - } - } - } - }, - "doc_form": { - "type": "string", - "enum": [ - "text_model", - "hierarchical_model", - "qa_model" - ], - "default": "text_model", - "description": "`text_model` for standard text chunking, `hierarchical_model` for parent-child chunk structure, `qa_model` for question-answer pair extraction." - }, - "doc_language": { - "type": "string", - "default": "English", - "description": "Language of the document for processing optimization." - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "Controls how chunks are searched and ranked when querying this knowledge base." - } - } + "$ref": "#/components/schemas/DocumentTextUpdate" } } } @@ -7497,16 +7234,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "Batch ID for tracking indexing progress." - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -7648,22 +7376,11 @@ } } }, - "503": { - "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -7682,7 +7399,7 @@ ], "summary": "Update Document by File", "description": "Deprecated. Use [Update Document](/en/api-reference/documents/update-document) instead. Updates a document by uploading a new file, then re-indexes it.", - "operationId": "updateDocumentByFile", + "operationId": "update_document_by_file_deprecated", "parameters": [ { "name": "dataset_id", @@ -7690,7 +7407,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -7700,13 +7418,14 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. From [List Documents](/en/api-reference/documents/list-documents)." } ], "requestBody": { - "required": true, + "required": false, "content": { "multipart/form-data": { "schema": { @@ -7733,16 +7452,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "Batch ID for tracking indexing progress." - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -7926,22 +7636,11 @@ } } }, - "503": { - "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "deprecated": true, @@ -7961,7 +7660,7 @@ ], "summary": "Download Documents as ZIP", "description": "Downloads one or more documents as a single ZIP archive. Only documents that were uploaded as files can be included.", - "operationId": "downloadDocumentsZip", + "operationId": "download_documents_as_zip", "parameters": [ { "name": "dataset_id", @@ -7969,7 +7668,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -7979,22 +7679,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "document_ids" - ], - "properties": { - "document_ids": { - "type": "array", - "minItems": 1, - "maxItems": 100, - "items": { - "type": "string", - "format": "uuid" - }, - "description": "Document IDs to include in the archive. Get them from [List Documents](/en/api-reference/documents/list-documents)." - } - } + "$ref": "#/components/schemas/DocumentBatchDownloadZipPayload" } } } @@ -8085,6 +7770,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -8103,32 +7794,34 @@ ], "summary": "Update Document Status in Batch", "description": "Enables, disables, archives, or unarchives multiple documents in one request.", - "operationId": "batchUpdateDocumentStatus", + "operationId": "update_document_status", "parameters": [ { - "name": "dataset_id", + "name": "action", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "archive", + "disable", + "enable", + "un_archive" + ], + "description": "Action to perform: 'enable', 'disable', 'archive', or 'un_archive'" }, - "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." + "description": "`enable` activates documents for retrieval, `disable` deactivates them, `archive` moves them to the archive, `un_archive` restores them from the archive." }, { - "name": "action", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", - "enum": [ - "enable", - "disable", - "archive", - "un_archive" - ] + "format": "uuid", + "description": "Knowledge base ID." }, - "description": "`enable` activates documents for retrieval, `disable` deactivates them, `archive` moves them to the archive, `un_archive` restores them from the archive." + "description": "Knowledge base ID. From [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } ], "requestBody": { @@ -8136,19 +7829,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "document_ids" - ], - "properties": { - "document_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Document IDs to update. Get them from [List Documents](/en/api-reference/documents/list-documents)." - } - } + "$ref": "#/components/schemas/DocumentStatusPayload" } } } @@ -8159,13 +7840,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "Operation result." - } - } + "$ref": "#/components/schemas/SimpleResultResponse" }, "examples": { "success": { @@ -8228,6 +7903,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -8246,7 +7927,7 @@ ], "summary": "Create Chunks", "description": "Create one or more chunks within a document.", - "operationId": "createSegments", + "operationId": "create_segments", "parameters": [ { "name": "dataset_id", @@ -8254,7 +7935,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -8264,7 +7946,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." } @@ -8274,48 +7957,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "segments" - ], - "properties": { - "segments": { - "type": "array", - "items": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "Chunk text content.", - "minLength": 1 - }, - "answer": { - "type": "string", - "description": "Answer text. Required for Q&A-mode (`qa_model`) documents." - }, - "keywords": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Keywords for the chunk." - }, - "attachment_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Attachment file IDs." - } - }, - "required": [ - "content" - ] - }, - "description": "Array of chunk objects to create.", - "minItems": 1 - } - } + "$ref": "#/components/schemas/SegmentCreatePayload" } } } @@ -8326,20 +7968,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "List of created chunks.", - "items": { - "$ref": "#/components/schemas/Segment" - } - }, - "doc_form": { - "type": "string", - "description": "Document chunking mode used by this document." - } - } + "$ref": "#/components/schemas/SegmentCreateListResponse" }, "examples": { "success": { @@ -8500,22 +8129,11 @@ } } }, - "503": { - "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -8532,7 +8150,7 @@ ], "summary": "List Chunks", "description": "Returns a paginated list of chunks within a document, optionally filtered by keyword or indexing status.", - "operationId": "listSegments", + "operationId": "list_segments", "parameters": [ { "name": "dataset_id", @@ -8540,7 +8158,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -8550,19 +8169,20 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." }, { - "name": "page", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 1, - "minimum": 1 + "type": "string", + "description": "Search keyword." }, - "description": "Page number." + "description": "Search keyword.", + "required": false }, { "name": "limit", @@ -8570,30 +8190,36 @@ "schema": { "type": "integer", "default": 20, - "minimum": 1 + "minimum": 1, + "description": "Number of items per page. Server caps at `100`." }, - "description": "Number of items per page. Server caps at `100`." + "description": "Number of items per page. Server caps at `100`.", + "required": false }, { - "name": "status", + "name": "page", "in": "query", "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "integer", + "default": 1, + "minimum": 1, + "description": "Page number to retrieve." }, - "style": "form", - "explode": true, - "description": "Filter chunks by indexing status, e.g. `completed`, `indexing`, `error`." + "description": "Page number.", + "required": false }, { - "name": "keyword", + "name": "status", "in": "query", "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter chunks by indexing status, such as `completed`, `indexing`, or `error`." }, - "description": "Search keyword." + "description": "Filter chunks by indexing status, e.g. `completed`, `indexing`, `error`.", + "required": false } ], "responses": { @@ -8602,36 +8228,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "List of chunks.", - "items": { - "$ref": "#/components/schemas/Segment" - } - }, - "doc_form": { - "type": "string", - "description": "Document chunking mode used by this document." - }, - "total": { - "type": "integer", - "description": "Total number of matching chunks." - }, - "has_more": { - "type": "boolean", - "description": "Whether more items exist on the next page." - }, - "limit": { - "type": "integer", - "description": "Number of items per page." - }, - "page": { - "type": "integer", - "description": "Current page number." - } - } + "$ref": "#/components/schemas/SegmentListResponse" }, "examples": { "success": { @@ -8741,6 +8338,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -8759,7 +8362,7 @@ ], "summary": "Get Chunk", "description": "Retrieve the full details of a single chunk.", - "operationId": "getSegmentDetail", + "operationId": "get_segment", "parameters": [ { "name": "dataset_id", @@ -8767,7 +8370,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -8777,7 +8381,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." }, @@ -8787,7 +8392,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Chunk ID." }, "description": "Chunk ID. Obtain it from [List Chunks](/en/api-reference/chunks/list-chunks)." } @@ -8798,16 +8404,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Segment" - }, - "doc_form": { - "type": "string", - "description": "Document chunking mode used by this document." - } - } + "$ref": "#/components/schemas/SegmentDetailResponse" }, "examples": { "success": { @@ -8919,6 +8516,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -8935,7 +8538,7 @@ ], "summary": "Update Chunk", "description": "Update a chunk's fields. The update re-triggers indexing for that chunk.", - "operationId": "updateSegment", + "operationId": "update_segment", "parameters": [ { "name": "dataset_id", @@ -8943,7 +8546,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -8953,7 +8557,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." }, @@ -8963,7 +8568,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Chunk ID." }, "description": "Chunk ID. Obtain it from [List Chunks](/en/api-reference/chunks/list-chunks)." } @@ -8973,54 +8579,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "segment" - ], - "properties": { - "segment": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "Chunk text content." - }, - "answer": { - "type": "string", - "description": "Answer text for Q&A-mode (`qa_model`) documents." - }, - "keywords": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Keywords for the chunk." - }, - "enabled": { - "type": "boolean", - "description": "Whether the chunk is enabled." - }, - "regenerate_child_chunks": { - "type": "boolean", - "default": false, - "description": "Whether to regenerate child chunks." - }, - "attachment_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Attachment file IDs." - }, - "summary": { - "type": "string", - "nullable": true, - "description": "Summary content for summary index." - } - }, - "description": "Chunk data to update." - } - } + "$ref": "#/components/schemas/SegmentUpdatePayload" } } } @@ -9031,16 +8590,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Segment" - }, - "doc_form": { - "type": "string", - "description": "Document chunking mode used by this document." - } - } + "$ref": "#/components/schemas/SegmentDetailResponse" }, "examples": { "success": { @@ -9177,22 +8727,11 @@ } } }, - "503": { - "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -9209,7 +8748,7 @@ ], "summary": "Delete Chunk", "description": "Permanently delete a chunk from the document.", - "operationId": "deleteSegment", + "operationId": "delete_segment", "parameters": [ { "name": "dataset_id", @@ -9217,7 +8756,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -9227,7 +8767,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." }, @@ -9237,7 +8778,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Chunk ID." }, "description": "Chunk ID. Obtain it from [List Chunks](/en/api-reference/chunks/list-chunks)." } @@ -9328,6 +8870,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -9346,7 +8894,7 @@ ], "summary": "Create Child Chunk", "description": "Create a child chunk under a parent chunk. Intended for documents that use the parent-child (`hierarchical_model`) chunking mode.", - "operationId": "createChildChunk", + "operationId": "create_child_chunk", "parameters": [ { "name": "dataset_id", @@ -9354,7 +8902,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -9364,7 +8913,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." }, @@ -9374,7 +8924,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Chunk ID." }, "description": "Parent chunk ID. Obtain it from [List Chunks](/en/api-reference/chunks/list-chunks)." } @@ -9384,16 +8935,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "description": "Child chunk text content." - } - } + "$ref": "#/components/schemas/ChildChunkCreatePayload" } } } @@ -9404,12 +8946,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/ChildChunk" - } - } + "$ref": "#/components/schemas/ChildChunkDetailResponse" }, "examples": { "success": { @@ -9530,22 +9067,11 @@ } } }, - "503": { - "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -9562,7 +9088,7 @@ ], "summary": "List Child Chunks", "description": "Returns a paginated list of child chunks under a specific parent chunk.", - "operationId": "getChildChunks", + "operationId": "list_child_chunks", "parameters": [ { "name": "dataset_id", @@ -9570,7 +9096,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -9580,7 +9107,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." }, @@ -9590,19 +9118,20 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Chunk ID." }, "description": "Parent chunk ID. Obtain it from [List Chunks](/en/api-reference/chunks/list-chunks)." }, { - "name": "page", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 1, - "minimum": 1 + "type": "string", + "description": "Search keyword." }, - "description": "Page number." + "description": "Search keyword.", + "required": false }, { "name": "limit", @@ -9610,17 +9139,23 @@ "schema": { "type": "integer", "default": 20, - "minimum": 1 + "minimum": 1, + "description": "Number of items per page. Server caps at `100`." }, - "description": "Number of items per page. Server caps at `100`." + "description": "Number of items per page. Server caps at `100`.", + "required": false }, { - "name": "keyword", + "name": "page", "in": "query", "schema": { - "type": "string" + "type": "integer", + "default": 1, + "minimum": 1, + "description": "Page number to retrieve." }, - "description": "Search keyword." + "description": "Page number.", + "required": false } ], "responses": { @@ -9629,32 +9164,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "List of child chunks.", - "items": { - "$ref": "#/components/schemas/ChildChunk" - } - }, - "total": { - "type": "integer", - "description": "Total number of child chunks." - }, - "total_pages": { - "type": "integer", - "description": "Total number of pages." - }, - "page": { - "type": "integer", - "description": "Current page number." - }, - "limit": { - "type": "integer", - "description": "Number of items per page." - } - } + "$ref": "#/components/schemas/ChildChunkListResponse" }, "examples": { "success": { @@ -9731,6 +9241,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -9749,47 +9265,51 @@ ], "summary": "Update Child Chunk", "description": "Update the content of an existing child chunk.", - "operationId": "updateChildChunk", + "operationId": "update_child_chunk", "parameters": [ { - "name": "dataset_id", + "name": "child_chunk_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Child chunk ID." }, - "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." + "description": "Child chunk ID." }, { - "name": "document_id", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, - "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." + "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, { - "name": "segment_id", + "name": "document_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, - "description": "Parent chunk ID. Obtain it from [List Chunks](/en/api-reference/chunks/list-chunks)." + "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." }, { - "name": "child_chunk_id", + "name": "segment_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Chunk ID." }, - "description": "Child chunk ID." + "description": "Parent chunk ID. Obtain it from [List Chunks](/en/api-reference/chunks/list-chunks)." } ], "requestBody": { @@ -9797,16 +9317,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "description": "Child chunk text content." - } - } + "$ref": "#/components/schemas/ChildChunkUpdatePayload" } } } @@ -9817,12 +9328,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/ChildChunk" - } - } + "$ref": "#/components/schemas/ChildChunkDetailResponse" }, "examples": { "success": { @@ -9943,22 +9449,11 @@ } } }, - "503": { - "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -9975,47 +9470,51 @@ ], "summary": "Delete Child Chunk", "description": "Permanently delete a child chunk from its parent chunk.", - "operationId": "deleteChildChunk", + "operationId": "delete_child_chunk", "parameters": [ { - "name": "dataset_id", + "name": "child_chunk_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Child chunk ID." }, - "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." + "description": "Child chunk ID." }, { - "name": "document_id", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, - "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." + "description": "Knowledge base ID. Obtain it from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, { - "name": "segment_id", + "name": "document_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Document ID." }, - "description": "Parent chunk ID. Obtain it from [List Chunks](/en/api-reference/chunks/list-chunks)." + "description": "Document ID. Obtain it from [List Documents](/en/api-reference/documents/list-documents)." }, { - "name": "child_chunk_id", + "name": "segment_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Chunk ID." }, - "description": "Child chunk ID." + "description": "Parent chunk ID. Obtain it from [List Chunks](/en/api-reference/chunks/list-chunks)." } ], "responses": { @@ -10112,6 +9611,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -10130,7 +9635,7 @@ ], "summary": "Retrieve Chunks from a Knowledge Base / Test Retrieval", "description": "Searches a knowledge base and returns the chunks most relevant to the query, for both production retrieval and test retrieval.", - "operationId": "retrieveSegments", + "operationId": "dataset_hit_testing", "parameters": [ { "name": "dataset_id", @@ -10138,7 +9643,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID, from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -10148,47 +9654,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "query" - ], - "properties": { - "query": { - "type": "string", - "maxLength": 250, - "description": "Search query text." - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "Retrieval model configuration. Controls how chunks are searched and ranked when querying this knowledge base." - }, - "attachment_ids": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true, - "description": "List of attachment IDs to include in the retrieval context." - }, - "external_retrieval_model": { - "type": "object", - "description": "Retrieval settings for external knowledge bases.", - "properties": { - "top_k": { - "type": "integer", - "description": "Maximum number of results to return." - }, - "score_threshold": { - "type": "number", - "description": "Minimum similarity score threshold for filtering results." - }, - "score_threshold_enabled": { - "type": "boolean", - "description": "Whether score threshold filtering is enabled." - } - } - } - } + "$ref": "#/components/schemas/HitTestingPayload" } } } @@ -10199,231 +9665,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "query": { - "type": "object", - "description": "The original query object.", - "properties": { - "content": { - "type": "string", - "description": "The query text." - } - } - }, - "records": { - "type": "array", - "description": "List of matched retrieval records.", - "items": { - "type": "object", - "properties": { - "segment": { - "type": "object", - "description": "Matched chunk from the knowledge base.", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier of the chunk." - }, - "position": { - "type": "integer", - "description": "Position of the chunk within the document." - }, - "document_id": { - "type": "string", - "description": "ID of the document this chunk belongs to." - }, - "content": { - "type": "string", - "description": "Text content of the chunk." - }, - "sign_content": { - "type": "string", - "description": "Signed content hash for integrity verification." - }, - "answer": { - "type": "string", - "description": "Answer content, used in Q&A mode documents." - }, - "word_count": { - "type": "integer", - "description": "Word count of the chunk content." - }, - "tokens": { - "type": "integer", - "description": "Token count of the chunk content." - }, - "keywords": { - "type": "array", - "description": "Keywords associated with this chunk for keyword-based retrieval.", - "items": { - "type": "string" - } - }, - "index_node_id": { - "type": "string", - "description": "ID of the index node in the vector store." - }, - "index_node_hash": { - "type": "string", - "description": "Hash of the indexed content, used to detect changes." - }, - "hit_count": { - "type": "integer", - "description": "Number of times this chunk has been matched in retrieval queries." - }, - "enabled": { - "type": "boolean", - "description": "Whether the chunk is enabled for retrieval." - }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when the chunk was disabled. `null` if enabled." - }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "ID of the user who disabled the chunk. `null` if enabled." - }, - "status": { - "type": "string", - "description": "Indexing status of the chunk." - }, - "created_by": { - "type": "string", - "description": "ID of the user who created the chunk." - }, - "created_at": { - "type": "number", - "description": "Creation timestamp (Unix epoch in seconds)." - }, - "indexing_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when indexing started. `null` if not yet started." - }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when indexing completed. `null` if not yet completed." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if indexing failed. `null` when no error." - }, - "stopped_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when indexing was stopped. `null` if not stopped." - }, - "document": { - "type": "object", - "description": "Parent document information for the matched chunk.", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier of the document." - }, - "data_source_type": { - "type": "string", - "description": "How the document was created." - }, - "name": { - "type": "string", - "description": "Document name." - }, - "doc_type": { - "type": "string", - "nullable": true, - "description": "Document type classification. `null` if not set." - }, - "doc_metadata": { - "type": "object", - "nullable": true, - "description": "Metadata values for the document. `null` if no metadata is configured." - } - } - } - } - }, - "child_chunks": { - "type": "array", - "description": "Matched child chunks within the chunk, if using hierarchical indexing.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier of the child chunk." - }, - "content": { - "type": "string", - "description": "Text content of the child chunk." - }, - "position": { - "type": "integer", - "description": "Position of the child chunk within the parent chunk." - }, - "score": { - "type": "number", - "description": "Similarity score of the child chunk." - } - } - } - }, - "score": { - "type": "number", - "description": "Similarity score." - }, - "tsne_position": { - "type": "object", - "nullable": true, - "description": "t-SNE visualization position." - }, - "files": { - "type": "array", - "description": "Files attached to this chunk.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Attachment file identifier." - }, - "name": { - "type": "string", - "description": "Original file name." - }, - "size": { - "type": "integer", - "description": "File size in bytes." - }, - "extension": { - "type": "string", - "description": "File extension." - }, - "mime_type": { - "type": "string", - "description": "MIME type of the file." - }, - "source_url": { - "type": "string", - "description": "URL to access the attachment." - } - } - } - }, - "summary": { - "type": "string", - "nullable": true, - "description": "Summary content if retrieved via summary index." - } - } - } - } - } + "$ref": "#/components/schemas/HitTestingResponse" }, "examples": { "success": { @@ -10597,6 +9839,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -10615,24 +9863,13 @@ ], "summary": "Create Knowledge Tag", "description": "Create a tag for organizing knowledge bases.", - "operationId": "createKnowledgeTag", + "operationId": "create_dataset_tag", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 50, - "description": "Tag name. Must be unique within the workspace." - } - } + "$ref": "#/components/schemas/TagCreatePayload" } } } @@ -10643,26 +9880,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Tag identifier." - }, - "name": { - "type": "string", - "description": "Tag display name." - }, - "type": { - "type": "string", - "description": "Tag type. Always `knowledge` for knowledge base tags." - }, - "binding_count": { - "type": "string", - "nullable": true, - "description": "Number of knowledge bases bound to this tag." - } - } + "$ref": "#/components/schemas/KnowledgeTagResponse" }, "examples": { "success": { @@ -10694,6 +9912,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - insufficient permissions" } }, "x-mint": { @@ -10710,36 +9940,14 @@ ], "summary": "List Knowledge Tags", "description": "Returns all knowledge base tags in the workspace.", - "operationId": "getKnowledgeTags", + "operationId": "list_dataset_tags", "responses": { "200": { "description": "List of tags.", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Tag identifier." - }, - "name": { - "type": "string", - "description": "Tag display name." - }, - "type": { - "type": "string", - "description": "Tag type. Always `knowledge` for knowledge base tags." - }, - "binding_count": { - "type": "string", - "nullable": true, - "description": "Number of knowledge bases bound to this tag." - } - } - } + "$ref": "#/components/schemas/KnowledgeTagListResponse" }, "examples": { "success": { @@ -10756,6 +9964,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - dataset API access or workspace access denied" } }, "x-mint": { @@ -10772,29 +9992,13 @@ ], "summary": "Update Knowledge Tag", "description": "Rename a knowledge base tag.", - "operationId": "updateKnowledgeTag", + "operationId": "update_dataset_tag", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "tag_id", - "name" - ], - "properties": { - "tag_id": { - "type": "string", - "description": "ID of the tag to rename. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags)." - }, - "name": { - "type": "string", - "minLength": 1, - "maxLength": 50, - "description": "New name for the tag. Must be unique within the workspace." - } - } + "$ref": "#/components/schemas/TagUpdatePayload" } } } @@ -10805,26 +10009,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Tag identifier." - }, - "name": { - "type": "string", - "description": "Tag display name." - }, - "type": { - "type": "string", - "description": "Tag type. Always `knowledge` for knowledge base tags." - }, - "binding_count": { - "type": "string", - "nullable": true, - "description": "Number of knowledge bases bound to this tag." - } - } + "$ref": "#/components/schemas/KnowledgeTagResponse" }, "examples": { "success": { @@ -10873,6 +10058,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - insufficient permissions" } }, "x-mint": { @@ -10889,22 +10086,13 @@ ], "summary": "Delete Knowledge Tag", "description": "Permanently delete a knowledge base tag. Does not delete the knowledge bases that were tagged.", - "operationId": "deleteKnowledgeTag", + "operationId": "delete_dataset_tag", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "tag_id" - ], - "properties": { - "tag_id": { - "type": "string", - "description": "ID of the tag to delete. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags)." - } - } + "$ref": "#/components/schemas/TagDeletePayload" } } } @@ -10929,7 +10117,19 @@ } } } - } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - insufficient permissions" + } }, "x-mint": { "href": "/en/api-reference/tags/delete-knowledge-tag", @@ -10947,31 +10147,13 @@ ], "summary": "Create Tag Binding", "description": "Bind one or more tags to a knowledge base. A knowledge base can have multiple tags.", - "operationId": "bindTagsToDataset", + "operationId": "bind_dataset_tags", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "tag_ids", - "target_id" - ], - "properties": { - "tag_ids": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "description": "IDs of the tags to bind. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags). Unknown tag IDs are silently ignored." - }, - "target_id": { - "type": "string", - "description": "Knowledge base to bind the tags to. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." - } - } + "$ref": "#/components/schemas/TagBindingPayload" } } } @@ -10996,6 +10178,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - insufficient permissions" } }, "x-mint": { @@ -11014,35 +10208,13 @@ ], "summary": "Delete Tag Binding", "description": "Remove one or more tags from a knowledge base.", - "operationId": "unbindTagFromDataset", + "operationId": "unbind_dataset_tags", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "target_id" - ], - "properties": { - "tag_ids": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "description": "Tag IDs to unbind. Required unless the legacy `tag_id` is provided. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags)." - }, - "tag_id": { - "type": "string", - "deprecated": true, - "description": "Legacy single-tag form. Normalized into `tag_ids` server-side. Use `tag_ids` for new integrations." - }, - "target_id": { - "type": "string", - "description": "Knowledge base to unbind the tags from. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." - } - } + "$ref": "#/components/schemas/TagUnbindingPayload" } } } @@ -11067,6 +10239,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - insufficient permissions" } }, "x-mint": { @@ -11085,7 +10269,7 @@ ], "summary": "Get Knowledge Base Tags", "description": "Returns the tags bound to a knowledge base.", - "operationId": "queryDatasetTags", + "operationId": "get_dataset_tags_binding_status", "parameters": [ { "name": "dataset_id", @@ -11093,7 +10277,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -11104,30 +10289,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "List of tags bound to this knowledge base.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Tag identifier." - }, - "name": { - "type": "string", - "description": "Tag display name." - } - } - } - }, - "total": { - "type": "integer", - "description": "Total number of tags bound to this knowledge base." - } - } + "$ref": "#/components/schemas/DatasetBoundTagListResponse" }, "examples": { "success": { @@ -11163,22 +10325,11 @@ } } }, - "404": { - "description": "`not_found` : Dataset not found.", + "401": { "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -11197,7 +10348,7 @@ ], "summary": "Create Metadata Field", "description": "Create a custom metadata field for annotating documents in the knowledge base with structured information.", - "operationId": "createMetadataField", + "operationId": "create_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11205,7 +10356,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -11215,26 +10367,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "type", - "name" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "number", - "time" - ], - "description": "`string` for text values, `number` for numeric values, `time` for date/time values." - }, - "name": { - "type": "string", - "description": "Name for the metadata field. Must be unique among the knowledge base's fields and at most 255 characters." - } - } + "$ref": "#/components/schemas/MetadataArgs" } } } @@ -11245,21 +10378,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Metadata field identifier." - }, - "name": { - "type": "string", - "description": "Metadata field name." - }, - "type": { - "type": "string", - "description": "Metadata field type." - } - } + "$ref": "#/components/schemas/DatasetMetadataResponse" }, "examples": { "success": { @@ -11332,6 +10451,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -11348,7 +10473,7 @@ ], "summary": "List Metadata Fields", "description": "Returns all metadata fields for the knowledge base, both custom and built-in, with the count of documents using each field.", - "operationId": "listMetadataFields", + "operationId": "get_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11356,7 +10481,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -11367,38 +10493,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "doc_metadata": { - "type": "array", - "description": "List of metadata field definitions.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Metadata field identifier." - }, - "name": { - "type": "string", - "description": "Metadata field name." - }, - "type": { - "type": "string", - "description": "Metadata field type." - }, - "count": { - "type": "integer", - "description": "Number of documents using this metadata field." - } - } - } - }, - "built_in_field_enabled": { - "type": "boolean", - "description": "Whether built-in metadata fields are enabled for this knowledge base." - } - } + "$ref": "#/components/schemas/DatasetMetadataListResponse" }, "examples": { "success": { @@ -11452,6 +10547,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -11470,7 +10571,7 @@ ], "summary": "Update Metadata Field", "description": "Rename a custom metadata field.", - "operationId": "updateMetadataField", + "operationId": "update_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11478,7 +10579,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -11488,7 +10590,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Metadata field ID." }, "description": "ID of the metadata field to rename. See [List Metadata Fields](/en/api-reference/metadata/list-metadata-fields)." } @@ -11498,16 +10601,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "New name for the field. Must be unique among the knowledge base's fields and at most 255 characters." - } - } + "$ref": "#/components/schemas/MetadataUpdatePayload" } } } @@ -11518,21 +10612,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Metadata field identifier." - }, - "name": { - "type": "string", - "description": "Metadata field name." - }, - "type": { - "type": "string", - "description": "Metadata field type." - } - } + "$ref": "#/components/schemas/DatasetMetadataResponse" }, "examples": { "success": { @@ -11605,6 +10685,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -11621,7 +10707,7 @@ ], "summary": "Delete Metadata Field", "description": "Permanently delete a custom metadata field. Documents that used the field lose their values for it.", - "operationId": "deleteMetadataField", + "operationId": "delete_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11629,7 +10715,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -11639,7 +10726,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Metadata field ID." }, "description": "ID of the metadata field to delete. See [List Metadata Fields](/en/api-reference/metadata/list-metadata-fields)." } @@ -11689,6 +10777,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -11707,7 +10801,7 @@ ], "summary": "Get Built-in Metadata Fields", "description": "Returns the built-in metadata fields provided by the system.", - "operationId": "getBuiltInMetadataFields", + "operationId": "get_built_in_fields", "parameters": [ { "name": "dataset_id", @@ -11715,7 +10809,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -11726,26 +10821,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "fields": { - "type": "array", - "description": "List of system-provided metadata fields.", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Built-in field identifier. `document_name` for the document title, `uploader` for the creator, `upload_date` for creation time, `last_update_date` for last modification time, `source` for the document origin." - }, - "type": { - "type": "string", - "description": "Field data type. `string` for text values, `time` for date/time values." - } - } - } - } - } + "$ref": "#/components/schemas/DatasetMetadataBuiltInFieldsResponse" }, "examples": { "success": { @@ -11796,22 +10872,11 @@ } } }, - "404": { - "description": "`not_found` : Dataset not found.", + "401": { "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -11830,30 +10895,32 @@ ], "summary": "Update Built-in Metadata Field", "description": "Enable or disable built-in metadata fields for the knowledge base.", - "operationId": "toggleBuiltInMetadataField", + "operationId": "toggle_built_in_field", "parameters": [ { - "name": "dataset_id", + "name": "action", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "disable", + "enable" + ], + "description": "`enable` to activate built-in metadata fields, `disable` to deactivate them." }, - "description": "Knowledge base ID. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." + "description": "`enable` to activate built-in metadata fields, `disable` to deactivate them." }, { - "name": "action", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", - "enum": [ - "enable", - "disable" - ] + "format": "uuid", + "description": "Knowledge base ID." }, - "description": "`enable` to activate built-in metadata fields, `disable` to deactivate them." + "description": "Knowledge base ID. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } ], "responses": { @@ -11862,13 +10929,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "Operation result." - } - } + "$ref": "#/components/schemas/DatasetMetadataActionResponse" }, "examples": { "success": { @@ -11922,6 +10983,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -11940,7 +11007,7 @@ ], "summary": "Update Document Metadata in Batch", "description": "Update metadata values for multiple documents in a single request.", - "operationId": "batchUpdateDocumentMetadata", + "operationId": "update_documents_metadata", "parameters": [ { "name": "dataset_id", @@ -11948,7 +11015,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -11958,58 +11026,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "operation_data" - ], - "properties": { - "operation_data": { - "type": "array", - "items": { - "type": "object", - "required": [ - "document_id", - "metadata_list" - ], - "properties": { - "document_id": { - "type": "string", - "description": "ID of the document to update. See [List Documents](/en/api-reference/documents/list-documents)." - }, - "metadata_list": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string", - "description": "Metadata field ID. See [List Metadata Fields](/en/api-reference/metadata/list-metadata-fields)." - }, - "name": { - "type": "string", - "description": "Metadata field name." - }, - "value": { - "description": "Metadata value. Can be a string, number, or `null`." - } - } - }, - "description": "Metadata fields to set on the document." - }, - "partial_update": { - "type": "boolean", - "default": false, - "description": "Whether to partially update metadata, keeping existing values for unspecified fields." - } - } - }, - "description": "Document metadata update operations, one entry per document." - } - } + "$ref": "#/components/schemas/MetadataOperationData" } } } @@ -12020,13 +11037,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "Operation result." - } - } + "$ref": "#/components/schemas/DatasetMetadataActionResponse" }, "examples": { "success": { @@ -12113,6 +11124,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -12131,7 +11148,7 @@ ], "summary": "Get Available Models", "description": "Returns the available models of a given type. Use it to find the `text-embedding` and `rerank` models to configure on a knowledge base.", - "operationId": "getAvailableModels", + "operationId": "get_available_models", "parameters": [ { "name": "model_type", @@ -12140,13 +11157,14 @@ "schema": { "type": "string", "enum": [ - "text-embedding", - "rerank", "llm", - "tts", + "moderation", + "rerank", "speech2text", - "moderation" - ] + "text-embedding", + "tts" + ], + "description": "Type of model to retrieve." }, "description": "Type of model to retrieve. For knowledge base configuration, use `text-embedding` for embedding models or `rerank` for reranking models." } @@ -12157,133 +11175,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "List of model providers with their available models.", - "items": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "description": "Model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). Legacy providers may return the bare short form (e.g. `openai`)." - }, - "label": { - "type": "object", - "description": "Localized display name of the provider.", - "properties": { - "en_US": { - "type": "string", - "description": "English display name." - }, - "zh_Hans": { - "type": "string", - "description": "Chinese display name." - } - } - }, - "icon_small": { - "type": "object", - "description": "URL of the provider's small icon.", - "properties": { - "en_US": { - "type": "string", - "description": "Small icon URL." - }, - "zh_Hans": { - "type": "string", - "description": "Chinese icon URL." - } - } - }, - "status": { - "type": "string", - "description": "Provider status. `active` when credentials are configured and valid." - }, - "models": { - "type": "array", - "description": "List of available models from this provider.", - "items": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "Model identifier. Use this as the `embedding_model` value when creating or updating a knowledge base." - }, - "label": { - "type": "object", - "description": "Localized display name of the model.", - "properties": { - "en_US": { - "type": "string", - "description": "English model name." - }, - "zh_Hans": { - "type": "string", - "description": "Chinese model name." - } - } - }, - "model_type": { - "type": "string", - "description": "Type of the model, matching the `model_type` path parameter." - }, - "features": { - "type": "array", - "nullable": true, - "description": "Supported features of the model, `null` if none.", - "items": { - "type": "string" - } - }, - "fetch_from": { - "type": "string", - "description": "Where the model definition comes from. `predefined-model` for built-in models, `customizable-model` for user-configured models." - }, - "model_properties": { - "type": "object", - "description": "Model-specific properties such as `context_size`." - }, - "status": { - "type": "string", - "description": "Model availability status. `active` when ready to use." - }, - "deprecated": { - "type": "boolean", - "description": "Whether the model is deprecated." - }, - "load_balancing_enabled": { - "type": "boolean", - "description": "Whether load balancing is enabled for the model." - }, - "has_invalid_load_balancing_configs": { - "type": "boolean", - "description": "Whether the model has invalid load-balancing configurations." - } - } - } - }, - "tenant_id": { - "type": "string", - "description": "Workspace ID the provider configuration belongs to." - }, - "icon_small_dark": { - "type": "object", - "description": "Dark-mode icon URLs; `null` when the provider has none.", - "properties": { - "en_US": { - "type": "string" - }, - "zh_Hans": { - "type": "string" - } - } - } - } - } - } - } + "$ref": "#/components/schemas/ProviderWithModelsListResponse" }, "examples": { "success": { @@ -12329,6 +11221,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -12347,7 +11245,7 @@ ], "summary": "Upload Pipeline File", "description": "Uploads a file for use in a knowledge pipeline. Use the returned `id` as the `reference` of a `local_file` item in [Run Pipeline](/en/api-reference/knowledge-pipeline/run-pipeline).", - "operationId": "uploadPipelineFile", + "operationId": "knowledgebase_pipeline_file_upload", "requestBody": { "required": true, "content": { @@ -12374,39 +11272,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier of the uploaded file." - }, - "name": { - "type": "string", - "description": "Original file name." - }, - "size": { - "type": "integer", - "description": "File size in bytes." - }, - "extension": { - "type": "string", - "description": "File extension." - }, - "mime_type": { - "type": "string", - "nullable": true, - "description": "MIME type of the file. May be `null` if the upload did not include one." - }, - "created_by": { - "type": "string", - "description": "ID of the user who uploaded the file." - }, - "created_at": { - "type": "string", - "nullable": true, - "description": "Upload timestamp in ISO 8601 format. May be `null` while the record is being created." - } - } + "$ref": "#/components/schemas/PipelineUploadFileResponse" }, "examples": { "success": { @@ -12491,6 +11357,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - dataset API access or workspace access denied" } }, "x-mint": { @@ -12516,7 +11394,7 @@ ], "summary": "List Datasource Plugins", "description": "Returns the datasource nodes configured in the knowledge pipeline, each with the plugin it uses and the metadata needed to run it.", - "operationId": "listDatasourcePlugins", + "operationId": "list_rag_pipeline_datasource_plugins", "parameters": [ { "name": "dataset_id", @@ -12524,7 +11402,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID, from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -12533,9 +11412,11 @@ "in": "query", "schema": { "type": "boolean", - "default": true + "default": true, + "description": "Whether to retrieve nodes from the published or draft pipeline. `true` returns nodes from the published version, `false` returns nodes from the draft." }, - "description": "Whether to read nodes from the published pipeline version rather than the draft." + "description": "Whether to read nodes from the published pipeline version rather than the draft.", + "required": false } ], "responses": { @@ -12544,65 +11425,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "ID of the datasource node in the pipeline workflow. Pass this as `node_id` to [Run Datasource Node](/en/api-reference/knowledge-pipeline/run-datasource-node), or as `start_node_id` to [Run Pipeline](/en/api-reference/knowledge-pipeline/run-pipeline)." - }, - "plugin_id": { - "type": "string", - "description": "ID of the datasource plugin providing this node." - }, - "provider_name": { - "type": "string", - "description": "Provider name registered by the datasource plugin." - }, - "datasource_type": { - "type": "string", - "description": "Type of datasource. One of `local_file`, `online_document`, `online_drive`, `website_crawl`." - }, - "title": { - "type": "string", - "description": "Display title configured for the node." - }, - "user_input_variables": { - "type": "array", - "description": "Pipeline input variables the caller must supply for this datasource, derived from `{{#...#}}` references in the node's datasource parameters. Each item follows the pipeline variable schema used by the workflow.", - "items": { - "type": "object", - "additionalProperties": true - } - }, - "credentials": { - "type": "array", - "description": "Credentials available for authenticating with this datasource.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Credential ID. Pass this as `credential_id` to [Run Datasource Node](/en/api-reference/knowledge-pipeline/run-datasource-node) or in per-item `credential_id` fields of [Run Pipeline](/en/api-reference/knowledge-pipeline/run-pipeline)." - }, - "name": { - "type": "string", - "description": "Display name of the credential." - }, - "type": { - "type": "string", - "description": "Credential type defined by the datasource plugin." - }, - "is_default": { - "type": "boolean", - "description": "Whether this credential is the default for the provider." - } - } - } - } - } - } + "$ref": "#/components/schemas/DatasourcePluginListResponse" }, "examples": { "success": { @@ -12680,6 +11503,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -12698,7 +11527,7 @@ ], "summary": "Run Datasource Node", "description": "Runs a single datasource node in the knowledge pipeline and streams its execution events.", - "operationId": "runDatasourceNode", + "operationId": "run_datasource_node", "parameters": [ { "name": "dataset_id", @@ -12706,7 +11535,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID, from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." }, @@ -12715,7 +11545,8 @@ "in": "path", "required": true, "schema": { - "type": "string" + "type": "string", + "description": "ID of the datasource node to execute." }, "description": "ID of the datasource node to run, from [List Datasource Plugins](/en/api-reference/knowledge-pipeline/list-datasource-plugins)." } @@ -12725,38 +11556,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "inputs", - "datasource_type", - "is_published" - ], - "properties": { - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "Input variables for the datasource node." - }, - "datasource_type": { - "type": "string", - "enum": [ - "online_document", - "local_file", - "website_crawl", - "online_drive" - ], - "description": "Type of the datasource." - }, - "credential_id": { - "type": "string", - "nullable": true, - "description": "ID of the credential to authenticate with the datasource, from the `credentials` array of [List Datasource Plugins](/en/api-reference/knowledge-pipeline/list-datasource-plugins)." - }, - "is_published": { - "type": "boolean", - "description": "Whether to run the published version of the node instead of the draft." - } - } + "$ref": "#/components/schemas/DatasourceNodeRunPayload" } } } @@ -12823,6 +11623,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -12841,7 +11647,7 @@ ], "summary": "Run Pipeline", "description": "Runs the full knowledge pipeline over one or more datasources. `response_mode` selects a streaming or blocking response.", - "operationId": "runPipeline", + "operationId": "run_pipeline", "parameters": [ { "name": "dataset_id", @@ -12849,7 +11655,8 @@ "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Knowledge base ID." }, "description": "Knowledge base ID, from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases)." } @@ -12859,160 +11666,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "inputs", - "datasource_type", - "datasource_info_list", - "start_node_id", - "is_published", - "response_mode" - ], - "properties": { - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "Key-value pairs for pipeline input variables defined in the workflow. Pass `{}` if the pipeline has no input variables." - }, - "datasource_type": { - "type": "string", - "enum": [ - "local_file", - "online_document", - "website_crawl", - "online_drive" - ], - "description": "Type of the datasource. Determines which fields are expected in `datasource_info_list` items." - }, - "datasource_info_list": { - "type": "array", - "description": "List of datasource objects to process. The expected item structure depends on `datasource_type`.", - "items": { - "oneOf": [ - { - "title": "Local File", - "type": "object", - "required": [ - "reference" - ], - "properties": { - "reference": { - "type": "string", - "description": "Use the `id` returned by the [Upload Pipeline File](/en/api-reference/knowledge-pipeline/upload-pipeline-file) endpoint. `related_id` is accepted as an alias." - }, - "name": { - "type": "string", - "description": "Document title. Defaults to `\"untitled\"`." - } - } - }, - { - "title": "Online Document", - "type": "object", - "required": [ - "workspace_id", - "page" - ], - "properties": { - "workspace_id": { - "type": "string", - "description": "ID of the workspace or database in the external platform (e.g., a Notion workspace ID)." - }, - "page": { - "type": "object", - "description": "Page details.", - "required": [ - "page_id", - "type" - ], - "properties": { - "page_id": { - "type": "string", - "description": "Page identifier." - }, - "type": { - "type": "string", - "description": "Page type defined by the datasource plugin (e.g., `\"page\"`, `\"database\"`)." - }, - "page_name": { - "type": "string", - "description": "Display name. Defaults to `\"untitled\"`." - } - } - }, - "credential_id": { - "type": "string", - "description": "Credential for authenticating with the external platform. Managed via the Dify console. If omitted, the provider's default credential is used." - } - } - }, - { - "title": "Website Crawl", - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "type": "string", - "description": "URL to crawl." - }, - "title": { - "type": "string", - "description": "Used as the document name. Defaults to `\"untitled\"`." - } - } - }, - { - "title": "Online Drive", - "type": "object", - "required": [ - "id", - "type" - ], - "properties": { - "id": { - "type": "string", - "description": "File or folder ID." - }, - "type": { - "type": "string", - "enum": [ - "file", - "folder" - ], - "description": "Whether this entry is a single file or a folder to expand." - }, - "bucket": { - "type": "string", - "description": "Storage bucket name. Required by some drive providers (e.g., S3-compatible stores); omit if the provider does not use buckets." - }, - "name": { - "type": "string", - "description": "File name. Defaults to `\"untitled\"`." - } - } - } - ] - } - }, - "start_node_id": { - "type": "string", - "description": "ID of the node to start execution from, from [List Datasource Plugins](/en/api-reference/knowledge-pipeline/list-datasource-plugins)." - }, - "is_published": { - "type": "boolean", - "description": "Whether to run the published version of the pipeline instead of the current draft. Run the draft to test unpublished changes." - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" - ], - "description": "Response mode for the pipeline execution. `streaming` returns a Server-Sent Events stream, `blocking` waits and returns the complete result." - } - } + "$ref": "#/components/schemas/PipelineRunApiEntity" }, "examples": { "local_file": { @@ -13102,9 +11756,8 @@ }, "application/json": { "schema": { - "type": "object", "description": "Complete pipeline execution result. Returned when `response_mode` is `blocking`.", - "additionalProperties": true + "$ref": "#/components/schemas/PipelineRunJsonResponse" }, "examples": { "success": { @@ -13192,6 +11845,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" } }, "x-mint": { @@ -13202,610 +11861,444 @@ } } } - } - }, - "components": { - "securitySchemes": { - "ApiKeyAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "API_KEY", - "description": "Every request authenticates with an API key: `Authorization: Bearer {API_KEY}`. App endpoints take an app API key; knowledge endpoints take a knowledge base API key ([Get Started](/en/api-reference/guides/get-started)).\n\nKeep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP `401` (`unauthorized`)." - } }, - "responses": { - "SuccessResult": { - "description": "Operation successful.", - "content": { - "application/json": { + "/datasets/{dataset_id}/document/create_by_file": { + "post": { + "deprecated": true, + "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + "operationId": "create_document_by_file_75a87285", + "parameters": [ + { + "description": "Knowledge base ID.", + "in": "path", + "name": "dataset_id", + "required": true, "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "Operation result. Always `success`." - } - } - }, - "examples": { - "success": { - "summary": "Response Example", - "value": { - "result": "success" - } - } + "description": "Knowledge base ID.", + "format": "uuid", + "type": "string" } } - } - } - }, - "schemas": { - "ChatRequest": { - "type": "object", - "required": [ - "inputs", - "query", - "user" ], - "properties": { - "query": { - "type": "string", - "description": "The user's message." - }, - "inputs": { - "type": "object", - "description": "Values for the app's input variables, keyed by variable name. The expected names and types come from the `user_input_form` field of [Get App Parameters](/en/api-reference/applications/get-app-parameters).", - "additionalProperties": true - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" - ], - "description": "Mode of response return. Defaults to blocking when omitted.\n\n- `streaming` (recommended): the reply arrives as Server-Sent Events.\n- `blocking`: returns once generation completes. Long generations risk interruption: on Dify Cloud, the edge proxy may end the connection if the response doesn't arrive within its timeout.\n- Agent and New Agent apps support `streaming` only; a `blocking` request fails with 400." - }, - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. Conversations, messages, and files are visible only to requests carrying the same `user`. See [End User Identity](/en/api-reference/guides/end-user-identity)." - }, - "conversation_id": { - "type": "string", - "description": "ID of the conversation to continue. Omit it or pass an empty string to start a new conversation; the response returns a `conversation_id` to send with the next message. To resume an earlier conversation, get its ID from [List Conversations](/en/api-reference/conversations/list-conversations)." - }, - "files": { - "type": "array", - "description": "Files to attach to the message. For a local file, first upload it via [Upload File](/en/api-reference/files/upload-file), then reference the returned `id` as `upload_file_id` with `transfer_method: local_file`. New Agent apps accept file references but do not process their contents.", - "items": { - "type": "object", - "required": [ - "type", - "transfer_method" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "document", - "audio", - "video", - "custom" - ], - "description": "File type." - }, - "transfer_method": { - "type": "string", - "enum": [ - "remote_url", - "local_file" - ], - "description": "Transfer method: `remote_url` for file URL, `local_file` for uploaded file." - }, - "url": { - "type": "string", - "format": "url", - "description": "File URL (required when `transfer_method` is `remote_url`)." + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "data": { + "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/en/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", + "type": "string" + }, + "file": { + "description": "Document file to upload.", + "format": "binary", + "type": "string" + } }, - "upload_file_id": { - "type": "string", - "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API (required when `transfer_method` is `local_file`)." - } + "required": [ + "file" + ], + "type": "object" } } }, - "auto_generate_name": { - "type": "boolean", - "description": "Auto-generate conversation title. If `false`, use the [Rename Conversation](/en/api-reference/conversations/rename-conversation) API with `auto_generate: true` for async title generation.", - "default": true - }, - "workflow_id": { - "type": "string", - "description": "Chatflow apps only. Specify a published workflow version ID to execute. If not provided, the latest published version is used. On Dify Cloud, pinning a version requires a paid plan." - } - } - }, - "ChatCompletionResponse": { - "type": "object", - "properties": { - "event": { - "type": "string", - "description": "Event type, fixed as `message`." - }, - "task_id": { - "type": "string", - "format": "uuid", - "description": "Task ID for request tracking and stop response API." - }, - "id": { - "type": "string", - "format": "uuid", - "description": "Unique ID of this response event." - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "Unique message ID. Use this as the `message_id` parameter when calling feedback or suggested questions endpoints." + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" + } + } + }, + "description": "Document created successfully." }, - "conversation_id": { - "type": "string", - "format": "uuid", - "description": "Conversation ID." + "400": { + "content": { + "application/json": {} + }, + "description": "- `no_file_uploaded` : Please upload your file.\n- `too_many_files` : Only one file is allowed.\n- `filename_not_exists_error` : The specified filename does not exist.\n- `provider_not_initialize` : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.\n- `invalid_param` : Knowledge base does not exist, external datasets not supported, unsupported file type, missing required fields, or invalid doc_form (must be `text_model`, `hierarchical_model`, or `qa_model`)." }, - "mode": { - "type": "string", - "description": "App mode. `chat` for Chatbot apps, `agent-chat` for Agent apps, `advanced-chat` for Chatflow apps." + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" }, - "answer": { - "type": "string", - "description": "Complete response content." + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - dataset API access or workspace access denied" }, - "metadata": { - "type": "object", - "description": "Metadata including usage and retriever resources.", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" - }, - "retriever_resources": { - "type": "array", - "description": "List of retriever resources used.", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } + "413": { + "content": { + "application/json": {} + }, + "description": "`file_too_large` : File size exceeded." + } + }, + "summary": "Deprecated Compatibility Endpoint", + "tags": [ + "Documents" + ] + } + }, + "/datasets/{dataset_id}/document/create_by_text": { + "post": { + "deprecated": true, + "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + "operationId": "create_document_by_text_deprecated", + "parameters": [ + { + "description": "Knowledge base ID.", + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "description": "Knowledge base ID.", + "format": "uuid", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentTextCreatePayload" } } }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Message creation timestamp (Unix epoch seconds)." - } - } - }, - "ChunkChatEvent": { - "type": "object", - "description": "Base schema for Server-Sent Event chunks in streaming mode.", - "properties": { - "event": { - "type": "string", - "description": "The type of event.", - "enum": [ - "message", - "agent_message", - "agent_thought", - "tts_message", - "tts_message_end", - "message_file", - "message_end", - "message_replace", - "reasoning_chunk", - "workflow_started", - "workflow_finished", - "node_started", - "node_finished", - "node_retry", - "iteration_started", - "iteration_next", - "iteration_completed", - "loop_started", - "loop_next", - "loop_completed", - "workflow_paused", - "human_input_required", - "human_input_form_filled", - "human_input_form_timeout", - "agent_log", - "text_chunk", - "error", - "ping" - ] - } + "required": true }, - "discriminator": { - "propertyName": "event", - "mapping": { - "message": "#/components/schemas/StreamEventChatMessage", - "agent_message": "#/components/schemas/StreamEventChatAgentMessage", - "tts_message": "#/components/schemas/StreamEventChatTtsMessage", - "tts_message_end": "#/components/schemas/StreamEventChatTtsMessageEnd", - "agent_thought": "#/components/schemas/StreamEventChatAgentThought", - "message_file": "#/components/schemas/StreamEventChatMessageFile", - "message_end": "#/components/schemas/StreamEventChatMessageEnd", - "message_replace": "#/components/schemas/StreamEventChatMessageReplace", - "error": "#/components/schemas/StreamEventChatError", - "ping": "#/components/schemas/StreamEventChatPing", - "reasoning_chunk": "#/components/schemas/StreamEventChatReasoningChunk", - "workflow_started": "#/components/schemas/StreamEventWorkflowStarted", - "workflow_finished": "#/components/schemas/StreamEventWorkflowFinished", - "node_started": "#/components/schemas/StreamEventNodeStarted", - "node_finished": "#/components/schemas/StreamEventNodeFinished", - "node_retry": "#/components/schemas/StreamEventNodeRetry", - "iteration_started": "#/components/schemas/StreamEventIterationStarted", - "iteration_next": "#/components/schemas/StreamEventIterationNext", - "iteration_completed": "#/components/schemas/StreamEventIterationCompleted", - "loop_started": "#/components/schemas/StreamEventLoopStarted", - "loop_next": "#/components/schemas/StreamEventLoopNext", - "loop_completed": "#/components/schemas/StreamEventLoopCompleted", - "workflow_paused": "#/components/schemas/StreamEventWorkflowPaused", - "human_input_required": "#/components/schemas/StreamEventHumanInputRequired", - "human_input_form_filled": "#/components/schemas/StreamEventHumanInputFormFilled", - "human_input_form_timeout": "#/components/schemas/StreamEventHumanInputFormTimeout", - "agent_log": "#/components/schemas/StreamEventAgentLog", - "text_chunk": "#/components/schemas/StreamEventChatTextChunk" - } - } - }, - "StreamEventBase": { - "type": "object", - "description": "Base properties for stream events.", - "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "Task ID." + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" + } + } + }, + "description": "Document created successfully" }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "Unique message ID." + "400": { + "content": { + "application/json": {} + }, + "description": "Bad request - invalid parameters" }, - "conversation_id": { - "type": "string", - "format": "uuid", - "description": "Conversation ID." + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Creation timestamp." + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - dataset API access or workspace access denied" } - } - }, - "StreamEventChatMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, + }, + "tags": [ + "service_api" + ], + "summary": "Deprecated Compatibility Endpoint" + } + }, + "/datasets/{dataset_id}/documents/{document_id}/update_by_file": { + "post": { + "deprecated": true, + "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + "operationId": "update_document_by_file_deprecated_5dc5fe59", + "parameters": [ { - "$ref": "#/components/schemas/StreamEventBase" + "description": "Knowledge base ID.", + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "description": "Knowledge base ID.", + "format": "uuid", + "type": "string" + } }, { - "type": "object", - "properties": { - "answer": { - "type": "string", - "description": "LLM returned text chunk." - } + "description": "Document ID.", + "in": "path", + "name": "document_id", + "required": true, + "schema": { + "description": "Document ID.", + "format": "uuid", + "type": "string" } } - ] - }, - "StreamEventChatAgentMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "properties": { - "answer": { - "type": "string", - "description": "LLM returned text chunk (Agent mode)." + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "data": { + "description": "JSON string containing document update settings such as `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, and `embedding_model_provider`. `name` and `text` are not used for file updates.", + "type": "string" + }, + "file": { + "description": "Replacement document file to upload.", + "format": "binary", + "type": "string" + } + }, + "type": "object" } } - } - ] - }, - "StreamEventChatTtsMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" }, - { - "type": "object", - "description": "TTS audio stream event (base64 encoded Mp3). Available if auto-play enabled.", - "properties": { - "audio": { - "type": "string", - "format": "byte", - "description": "Base64-encoded MP3 audio chunk. Decode and concatenate all chunks in order to produce a complete audio file." + "required": false + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" + } } - } - } - ] - }, - "StreamEventChatTtsMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + }, + "description": "Document updated successfully." }, - { - "$ref": "#/components/schemas/StreamEventBase" + "400": { + "content": { + "application/json": {} + }, + "description": "- `too_many_files` : Only one file is allowed.\n- `filename_not_exists_error` : The specified filename does not exist.\n- `provider_not_initialize` : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.\n- `invalid_param` : Knowledge base does not exist, external datasets not supported, unsupported file type, or invalid doc_form (must be `text_model`, `hierarchical_model`, or `qa_model`)." }, - { - "type": "object", - "description": "TTS audio stream end event.", - "properties": { - "audio": { - "type": "string", - "description": "Empty string. Signals the end of the audio stream." - } - } - } - ] - }, - "StreamEventChatAgentThought": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - dataset API access or workspace access denied" }, - { - "type": "object", - "description": "Agent thought, LLM thinking, tool call details (Agent mode).", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Agent thought ID." - }, - "position": { - "type": "integer", - "description": "Position of this thought in the sequence for the message." - }, - "thought": { - "type": "string", - "description": "What LLM is thinking." - }, - "observation": { - "type": "string", - "description": "Response from tool calls." - }, - "tool": { - "type": "string", - "description": "List of tools called, split by `;`." - }, - "tool_input": { - "type": "string", - "description": "Input of tools in JSON format." - }, - "message_files": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - }, - "description": "File IDs of files related to this thought." - } - } - } - ] - }, - "StreamEventChatMessageFile": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "404": { + "content": { + "application/json": {} + }, + "description": "Document not found" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "413": { + "content": { + "application/json": {} + }, + "description": "`file_too_large` : File size exceeded." }, - { - "type": "object", - "description": "Message file event, a new file created by a tool.", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "File unique ID." - }, - "type": { - "type": "string", - "description": "File type, e.g. `image`." - }, - "belongs_to": { - "type": "string", - "description": "Who this file belongs to. Always `assistant` for tool-generated files." - }, - "url": { - "type": "string", - "format": "url", - "description": "Remote URL of the file." - } - } + "415": { + "content": { + "application/json": {} + }, + "description": "Unsupported file type" } + }, + "summary": "Deprecated Compatibility Endpoint", + "tags": [ + "Documents" ] - }, - "StreamEventChatMessageEnd": { - "allOf": [ + } + }, + "/datasets/{dataset_id}/documents/{document_id}/update_by_text": { + "post": { + "deprecated": true, + "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + "operationId": "update_document_by_text_deprecated", + "parameters": [ { - "$ref": "#/components/schemas/ChunkChatEvent" + "description": "Knowledge base ID.", + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "description": "Knowledge base ID.", + "format": "uuid", + "type": "string" + } }, { - "$ref": "#/components/schemas/StreamEventBase" + "description": "Document ID.", + "in": "path", + "name": "document_id", + "required": true, + "schema": { + "description": "Document ID.", + "format": "uuid", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentTextUpdate" + } + } }, - { - "type": "object", - "description": "Message end event, streaming has ended.", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Unique message ID." - }, - "metadata": { - "type": "object", - "description": "Metadata including usage and retriever resources.", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" - }, - "retriever_resources": { - "type": "array", - "description": "List of retriever resources used.", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } - } + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" } } - } - } - ] - }, - "StreamEventChatMessageReplace": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + }, + "description": "Document updated successfully" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "Forbidden - dataset API access or workspace access denied" }, + "404": { + "content": { + "application/json": {} + }, + "description": "Document not found" + } + }, + "tags": [ + "service_api" + ], + "summary": "Deprecated Compatibility Endpoint" + } + }, + "/datasets/{dataset_id}/hit-testing": { + "post": { + "deprecated": true, + "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + "operationId": "dataset_hit_testing_f584b2dd", + "parameters": [ { - "type": "object", - "description": "Message content replacement event (e.g., due to content moderation).", - "properties": { - "answer": { - "type": "string", - "description": "Replacement content." - }, - "reason": { - "type": "string", - "description": "Reason for the content replacement." - } + "description": "Knowledge base ID.", + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "description": "Knowledge base ID.", + "format": "uuid", + "type": "string" } } - ] - }, - "StreamEventChatError": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "Error event during streaming.", - "properties": { - "status": { - "type": "integer", - "description": "HTTP status code." - }, - "code": { - "type": "string", - "description": "Error code." - }, - "message": { - "type": "string", - "description": "Error message." + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HitTestingPayload" } } - } - ] - }, - "StreamEventChatPing": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "type": "object", - "description": "Ping event to keep connection alive. Delivered as an `event: ping` line with no `data:` payload. For Chatflow apps, a `ping` is also the first event of every stream." - } - ] - }, - "Usage": { - "type": "object", - "description": "Model usage information.", - "properties": { - "prompt_tokens": { - "type": "integer", - "description": "Number of tokens in the prompt." - }, - "prompt_unit_price": { - "type": "string", - "format": "decimal", - "description": "Unit price per prompt token." - }, - "prompt_price_unit": { - "type": "string", - "format": "decimal", - "description": "Price unit for prompt tokens." - }, - "prompt_price": { - "type": "string", - "format": "decimal", - "description": "Total price for prompt tokens." - }, - "completion_tokens": { - "type": "integer", - "description": "Number of tokens in the completion." - }, - "completion_unit_price": { - "type": "string", - "format": "decimal", - "description": "Unit price per completion token." }, - "completion_price_unit": { - "type": "string", - "format": "decimal", - "description": "Price unit for completion tokens." + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HitTestingResponse" + } + } + }, + "description": "Retrieval results." }, - "completion_price": { - "type": "string", - "format": "decimal", - "description": "Total price for completion tokens." + "400": { + "content": { + "application/json": {} + }, + "description": "- `dataset_not_initialized` : The dataset is still being initialized or indexing. Please wait a moment.\n- `provider_not_initialize` : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.\n- `provider_quota_exceeded` : Your quota for Dify Hosted OpenAI has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials.\n- `model_currently_not_support` : Dify Hosted OpenAI trial currently not support the GPT-4 model.\n- `completion_request_error` : Completion request failed.\n- `invalid_param` : Invalid parameter value." }, - "total_tokens": { - "type": "integer", - "description": "Total number of tokens used." + "401": { + "content": { + "application/json": {} + }, + "description": "Unauthorized - invalid API token" }, - "total_price": { - "type": "string", - "format": "decimal", - "description": "Total price for all tokens." + "403": { + "content": { + "application/json": {} + }, + "description": "`forbidden` : Insufficient permissions." }, - "currency": { - "type": "string", - "description": "Currency for pricing." + "404": { + "content": { + "application/json": {} + }, + "description": "`not_found` : Knowledge base not found." }, - "latency": { - "type": "number", - "format": "double", - "description": "Latency in seconds." + "500": { + "content": { + "application/json": {} + }, + "description": "`internal_server_error` : An internal error occurred during retrieval." } - } + }, + "summary": "Deprecated Compatibility Endpoint", + "tags": [ + "Knowledge Bases" + ] + } + } + }, + "components": { + "securitySchemes": { + "Bearer": { + "bearerFormat": "API_KEY", + "description": "Every request authenticates with an API key: `Authorization: Bearer {API_KEY}`. App endpoints take an app API key; knowledge endpoints take a knowledge base API key ([Get Started](/en/api-reference/guides/get-started)).\n\nKeep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP `401` (`unauthorized`).", + "scheme": "bearer", + "type": "http" + } + }, + "responses": { + "AppInvokeQuotaExceededError": { + "description": "AppInvokeQuotaExceededError" + }, + "Exception": { + "description": "Exception" + }, + "HTTPException": { + "description": "HTTPException" + }, + "MaskError": { + "description": "When any error occurs on mask" + }, + "ParseError": { + "description": "When a mask can't be parsed" + }, + "PluginRuntimeError": { + "description": "PluginRuntimeError" }, + "ValueError": { + "description": "ValueError" + } + }, + "schemas": { "RetrieverResource": { "type": "object", "description": "Citation and attribution information for a retriever resource.", @@ -13813,68 +12306,179 @@ "id": { "type": "string", "format": "uuid", - "description": "Unique ID of the retriever resource." + "description": "Unique ID of the retriever resource.", + "title": "Id" }, "message_id": { "type": "string", "format": "uuid", - "description": "ID of the message this resource belongs to." + "description": "ID of the message this resource belongs to.", + "title": "Message Id" }, "position": { "type": "integer", - "description": "Position of the resource in the list." + "description": "Position of the resource in the list.", + "title": "Position" }, "dataset_id": { - "type": "string", - "format": "uuid", - "description": "ID of the knowledge base." + "description": "ID of the knowledge base.", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Dataset Id" }, "dataset_name": { - "type": "string", - "description": "Name of the knowledge base." + "description": "Name of the knowledge base.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Dataset Name" }, "document_id": { - "type": "string", - "format": "uuid", - "description": "ID of the document." + "description": "ID of the document.", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Document Id" }, "document_name": { - "type": "string", - "description": "Name of the document." + "description": "Name of the document.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Document Name" }, "data_source_type": { - "type": "string", - "description": "Type of the data source." + "description": "Type of the data source.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Source Type" }, "segment_id": { - "type": "string", - "format": "uuid", - "description": "ID of the specific chunk within the document." + "description": "ID of the specific chunk within the document.", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Segment Id" }, "score": { - "type": "number", - "format": "float", - "description": "Similarity score of the resource." + "description": "Similarity score of the resource.", + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Score" }, "hit_count": { - "type": "integer", - "description": "Number of times this chunk was hit." + "description": "Number of times this chunk was hit.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Hit Count" }, "word_count": { - "type": "integer", - "description": "Word count of the chunk." + "description": "Word count of the chunk.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Word Count" }, "segment_position": { - "type": "integer", - "description": "Position of the chunk within the document." + "description": "Position of the chunk within the document.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Segment Position" }, "index_node_hash": { - "type": "string", - "description": "Hash of the index node." + "description": "Hash of the index node.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Index Node Hash" }, "content": { - "type": "string", - "description": "Content snippet from the resource." + "description": "Content snippet from the resource.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Content" }, "summary": { "type": "string", @@ -13882,92 +12486,24 @@ "description": "Summary of the chunk content." }, "created_at": { - "type": "integer", - "format": "int64", - "description": "Creation timestamp (Unix epoch seconds)." - } - } - }, - "FileUploadResponse": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Unique file ID." - }, - "reference": { - "type": "string", - "nullable": true, - "description": "Opaque file reference used internally when attaching files in agent and tool contexts. Always `null` for files uploaded through this endpoint." - }, - "name": { - "type": "string", - "description": "File name." - }, - "size": { - "type": "integer", - "description": "File size in bytes." - }, - "extension": { - "type": "string", - "nullable": true, - "description": "File extension." - }, - "mime_type": { - "type": "string", - "nullable": true, - "description": "MIME type of the file." - }, - "created_by": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "End-user ID of the uploader. Look up details with [Get End User Info](/en/api-reference/end-users/get-end-user-info)." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Upload timestamp (Unix epoch seconds)." - }, - "preview_url": { - "type": "string", - "nullable": true, - "description": "Preview URL for the file." - }, - "source_url": { - "type": "string", - "description": "Signed URL for downloading the file." - }, - "original_url": { - "type": "string", - "nullable": true, - "description": "Original URL of the file." - }, - "user_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "Unused; always `null`." - }, - "tenant_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "ID of the associated tenant." - }, - "conversation_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "ID of the associated conversation." - }, - "file_key": { - "type": "string", - "nullable": true, - "description": "Unused; always `null`." + "description": "Creation timestamp (Unix epoch seconds).", + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" } - } + }, + "required": [ + "position" + ], + "title": "RetrieverResource" }, "EndUserDetail": { "type": "object", @@ -13975,5696 +12511,12952 @@ "id": { "type": "string", "format": "uuid", - "description": "End user ID." + "description": "End user ID.", + "title": "Id" }, "tenant_id": { "type": "string", "format": "uuid", - "description": "Tenant ID." + "description": "Tenant ID.", + "title": "Tenant Id" }, "app_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "Application ID." + "description": "Application ID.", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "App Id" }, "type": { "type": "string", - "description": "End user type. Always `service-api` for Service API users." + "description": "End user type. Always `service-api` for Service API users.", + "title": "Type" }, "external_user_id": { - "type": "string", - "nullable": true, - "description": "The `user` identifier provided in API requests (e.g., the `user` field in [Send Chat Message](/en/api-reference/chat-messages/send-chat-message))." + "description": "The `user` identifier provided in API requests (e.g., the `user` field in [Send Chat Message](/en/api-reference/chat-messages/send-chat-message)).", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "External User Id" }, "name": { - "type": "string", - "nullable": true, - "description": "End user name." + "description": "End user name.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" }, "is_anonymous": { "type": "boolean", - "description": "Whether the user is anonymous. `true` when no `user` identifier was provided in the original API request." + "description": "Whether the user is anonymous. `true` when no `user` identifier was provided in the original API request.", + "title": "Is Anonymous" }, "session_id": { "type": "string", - "description": "Session identifier. Defaults to the `external_user_id` value." + "description": "Session identifier. Defaults to the `external_user_id` value.", + "title": "Session Id" }, "created_at": { "type": "string", "format": "date-time", - "description": "Creation timestamp." + "description": "Creation timestamp.", + "title": "Created At" }, "updated_at": { "type": "string", "format": "date-time", - "description": "Last update timestamp." + "description": "Last update timestamp.", + "title": "Updated At" } - } - }, - "MessageFeedbackRequest": { - "type": "object", - "description": "Request body for submitting message feedback.", + }, + "description": "Full EndUser record for API responses.\n\nNote: The SQLAlchemy model defines an `is_anonymous` property for Flask-Login semantics\n(always False). The database column is exposed as `_is_anonymous`, so this DTO maps\n`is_anonymous` from `_is_anonymous` to return the stored value.", "required": [ - "user" + "created_at", + "id", + "is_anonymous", + "session_id", + "tenant_id", + "type", + "updated_at" ], - "properties": { - "rating": { - "type": "string", - "enum": [ - "like", - "dislike", - null - ], - "nullable": true, - "description": "Feedback rating. Set to `null` to revoke previously submitted feedback." - }, - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. Must match the `user` that received the message, since feedback is scoped to that end user. See [End User Identity](/en/api-reference/guides/end-user-identity)." - }, - "content": { - "type": "string", - "description": "Optional text feedback providing additional detail." - } - } - }, - "AppFeedbacksResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "List of feedback items.", - "items": { - "$ref": "#/components/schemas/FeedbackItem" - } - } - } + "title": "EndUserDetail" }, - "FeedbackItem": { + "AppInfoResponse": { "type": "object", - "description": "A single feedback item.", "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Feedback ID." - }, - "app_id": { - "type": "string", - "format": "uuid", - "description": "Application ID." - }, - "conversation_id": { - "type": "string", - "format": "uuid", - "description": "Conversation ID." - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "Message ID." - }, - "rating": { - "type": "string", - "description": "Feedback rating. `like` for positive, `dislike` for negative." - }, - "content": { - "type": "string", - "nullable": true, - "description": "Optional text feedback." - }, - "from_source": { + "name": { "type": "string", - "description": "Feedback source. `user` for end-user feedback submitted via API, `admin` for feedback submitted from the console." + "description": "Application name.", + "title": "Name" }, - "from_end_user_id": { + "description": { "type": "string", - "format": "uuid", - "nullable": true, - "description": "End user ID who submitted the feedback. Present when `from_source` is `user`." + "description": "Application description." }, - "from_account_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "Account ID who submitted the feedback. Present when `from_source` is `admin`." + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Application tags." }, - "created_at": { + "mode": { "type": "string", - "format": "date-time", - "description": "Creation timestamp." + "description": "Application mode. `completion` for text generation apps, `chat` for basic chat apps, `agent-chat` for agent-based apps, `advanced-chat` for Chatflow apps, `workflow` for Workflow apps, `agent` for New Agent apps.", + "title": "Mode" }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "Last update timestamp." + "author_name": { + "description": "Name of the application author.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Author Name" } - } + }, + "required": [ + "author_name", + "description", + "mode", + "name", + "tags" + ], + "title": "AppInfoResponse" }, - "SuggestedQuestionsResponse": { + "AppMetaResponse": { "type": "object", "properties": { - "result": { - "type": "string", - "description": "Result status." - }, - "data": { - "type": "array", - "items": { - "type": "string" + "tool_icons": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "format": "url", + "type": "string" + }, + { + "$ref": "#/components/schemas/ToolIcon" + } + ] }, - "description": "List of suggested questions." + "description": "Tool icons. Keys are tool names.", + "title": "Tool Icons" } - } + }, + "title": "AppMetaResponse" }, - "ConversationHistoryResponse": { + "HumanInputContent": { "type": "object", + "description": "Execution content from a Human Input node, including form definition and submission data.", "properties": { - "limit": { - "type": "integer", - "description": "Number of items per page." + "workflow_run_id": { + "type": "string", + "description": "ID of the workflow run this content belongs to.", + "title": "Workflow Run Id" }, - "has_more": { + "submitted": { "type": "boolean", - "description": "Whether there are more messages." + "description": "Whether the human input form has been submitted.", + "title": "Submitted" }, - "data": { - "type": "array", - "description": "List of messages.", - "items": { - "$ref": "#/components/schemas/ConversationMessageItem" - } + "type": { + "description": "`human_input` for human input content.", + "$ref": "#/components/schemas/ExecutionContentType", + "default": "human_input" + }, + "form_definition": { + "description": "Form definition from the Human Input node. `null` when the content represents a submission response.", + "anyOf": [ + { + "$ref": "#/components/schemas/HumanInputFormDefinition" + }, + { + "type": "null" + } + ], + "default": null + }, + "form_submission_data": { + "description": "Submitted form data. `null` when the form has not been submitted yet.", + "anyOf": [ + { + "$ref": "#/components/schemas/HumanInputFormSubmissionData" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "submitted", + "workflow_run_id" + ], + "title": "HumanInputContent" }, - "ConversationMessageItem": { + "HumanInputFormDefinition": { "type": "object", + "description": "Definition of a human input form rendered by a Human Input node.", "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Message ID." - }, - "conversation_id": { - "type": "string", - "format": "uuid", - "description": "Conversation ID." - }, - "parent_message_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "Parent message ID for threaded conversations." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "Input variables for this message." - }, - "query": { + "form_id": { "type": "string", - "description": "User query text." + "description": "Unique form identifier.", + "title": "Form Id" }, - "answer": { + "node_id": { "type": "string", - "description": "Assistant answer text." + "description": "ID of the Human Input node that generated this form.", + "title": "Node Id" }, - "status": { + "node_title": { "type": "string", - "description": "Message status. `normal` for successful messages, `error` when generation failed." + "description": "Title of the Human Input node.", + "title": "Node Title" }, - "error": { + "form_content": { "type": "string", - "nullable": true, - "description": "Error message if `status` is `error`." - }, - "message_files": { - "type": "array", - "description": "Files attached to this message.", - "items": { - "$ref": "#/components/schemas/MessageFileItem" - } - }, - "feedback": { - "type": "object", - "nullable": true, - "description": "User feedback for this message.", - "properties": { - "rating": { - "type": "string", - "description": "Feedback rating. `like` for positive, `dislike` for negative." - } - } + "description": "Markdown or text content displayed with the form.", + "title": "Form Content" }, - "retriever_resources": { + "inputs": { "type": "array", - "description": "Retriever resources used for this message.", + "description": "Input fields in the form.", "items": { - "$ref": "#/components/schemas/RetrieverResource" - } + "$ref": "#/components/schemas/FormInputConfig" + }, + "title": "Inputs" }, - "agent_thoughts": { + "actions": { "type": "array", - "description": "Agent thoughts for this message.", + "description": "Action buttons available on the form.", "items": { - "$ref": "#/components/schemas/AgentThoughtItem" - } - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Creation timestamp (Unix epoch seconds)." + "$ref": "#/components/schemas/UserActionConfig" + }, + "title": "Actions" }, - "extra_contents": { - "type": "array", - "description": "Additional execution content associated with this message, such as human input form data from Human Input nodes in Chatflow workflows.", - "items": { - "$ref": "#/components/schemas/HumanInputContent" - } + "display_in_ui": { + "type": "boolean", + "description": "Whether the form should be displayed in the UI.", + "default": false, + "title": "Display In Ui" }, - "message_tokens": { - "type": "integer", - "description": "Number of tokens in the input message." + "form_token": { + "description": "Token for form submission authentication.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Form Token" }, - "answer_tokens": { - "type": "integer", - "description": "Number of tokens in the generated answer." + "resolved_default_values": { + "type": "object", + "additionalProperties": true, + "description": "Resolved default values for form inputs, keyed by output variable name.", + "title": "Resolved Default Values" }, - "total_tokens": { + "expiration_time": { "type": "integer", - "description": "Total tokens used, the sum of `message_tokens` and `answer_tokens`." - }, - "provider_response_latency": { - "type": "number", - "format": "double", - "description": "Model provider response latency in seconds." - }, - "total_price": { - "type": "string", - "format": "decimal", - "nullable": true, - "description": "Total price for the tokens used, or `null` when pricing is unavailable." - }, - "currency": { - "type": "string", - "nullable": true, - "description": "Currency for `total_price` (for example, `USD`), or `null` when pricing is unavailable." + "description": "Unix timestamp when the form expires.", + "title": "Expiration Time" } - } + }, + "required": [ + "expiration_time", + "form_content", + "form_id", + "node_id", + "node_title" + ], + "title": "HumanInputFormDefinition" }, - "MessageFileItem": { + "HumanInputFormSubmissionData": { "type": "object", - "description": "A file attached to a message.", + "description": "Data from a submitted human input form.", "properties": { - "id": { + "node_id": { "type": "string", - "format": "uuid", - "description": "File ID." + "description": "ID of the Human Input node.", + "title": "Node Id" }, - "filename": { + "node_title": { "type": "string", - "description": "Original filename." + "description": "Title of the Human Input node.", + "title": "Node Title" }, - "type": { + "rendered_content": { "type": "string", - "description": "File type, e.g., `image`." + "description": "Rendered content of the form submission.", + "title": "Rendered Content" }, - "url": { + "action_id": { "type": "string", - "format": "url", - "nullable": true, - "description": "Preview URL for the file." + "description": "ID of the action button that was clicked.", + "title": "Action Id" }, - "mime_type": { + "action_text": { "type": "string", - "nullable": true, - "description": "MIME type of the file." + "description": "Display text of the action button that was clicked.", + "title": "Action Text" }, - "size": { - "type": "integer", - "nullable": true, - "description": "File size in bytes." + "submitted_data": { + "anyOf": [ + { + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Submitted Data" + } + }, + "required": [ + "action_id", + "action_text", + "node_id", + "node_title", + "rendered_content" + ], + "title": "HumanInputFormSubmissionData" + }, + "WorkflowBlockingResponse": { + "anyOf": [ + { + "$ref": "#/components/schemas/WorkflowFinishedBlockingResponse" }, - "transfer_method": { - "type": "string", - "description": "Transfer method used. `remote_url` for URL-based files, `local_file` for uploaded files, `tool_file` for tool-generated files." - }, - "belongs_to": { - "type": "string", - "nullable": true, - "description": "Who this file belongs to. `user` for user-uploaded files, `assistant` for assistant-generated files." - }, - "upload_file_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "Upload file ID if transferred via `local_file`." + { + "$ref": "#/components/schemas/WorkflowPausedBlockingResponse" } - } + ], + "description": "Blocking workflow response for a finished or paused execution.", + "title": "WorkflowBlockingResponse" }, - "AgentThoughtItem": { + "RetrievalModel": { "type": "object", - "description": "An agent thought step in the message.", + "required": [ + "reranking_enable", + "score_threshold_enabled", + "search_method", + "top_k" + ], "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Agent thought ID." + "search_method": { + "description": "Search method used for retrieval.", + "$ref": "#/components/schemas/RetrievalMethod" }, - "chain_id": { - "type": "string", - "nullable": true, - "description": "Chain ID for this thought." + "reranking_enable": { + "type": "boolean", + "description": "Whether reranking is enabled.", + "title": "Reranking Enable" }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "Unique message ID this thought belongs to." + "reranking_model": { + "description": "Reranking model configuration.", + "anyOf": [ + { + "$ref": "#/components/schemas/RerankingModel" + }, + { + "type": "null" + } + ], + "default": null }, - "position": { + "reranking_mode": { + "description": "Reranking mode. Required when `reranking_enable` is `true`.", + "anyOf": [ + { + "enum": [ + "reranking_model", + "weighted_score" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Reranking Mode" + }, + "top_k": { "type": "integer", - "description": "Position of this thought." + "description": "Maximum number of results to return.", + "title": "Top K" }, - "thought": { - "type": "string", - "description": "What LLM is thinking." + "score_threshold_enabled": { + "type": "boolean", + "description": "Whether score threshold filtering is enabled.", + "title": "Score Threshold Enabled" }, - "tool": { - "type": "string", - "description": "Tools called, split by `;`." + "score_threshold": { + "description": "Minimum similarity score for results. Only effective when `score_threshold_enabled` is `true`.", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Score Threshold" }, - "tool_labels": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Labels for tools used." + "weights": { + "description": "Weight configuration for hybrid search.", + "anyOf": [ + { + "$ref": "#/components/schemas/WeightModel" + }, + { + "type": "null" + } + ], + "default": null }, - "tool_input": { - "type": "string", - "description": "Input of tools in JSON format." + "metadata_filtering_conditions": { + "description": "Restrict retrieval to chunks whose document metadata matches the given conditions. Conditions are evaluated server-side against document metadata fields.", + "anyOf": [ + { + "$ref": "#/components/schemas/MetadataFilteringCondition" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "RetrievalModel" + }, + "AgentThought": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Answer" }, - "observation": { - "type": "string", - "description": "Response from tool calls." + "chain_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Chain Id" + }, + "created_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" }, "files": { - "type": "array", "items": { "type": "string" }, - "description": "File IDs related to this thought." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Creation timestamp." - } - } - }, - "ConversationsListResponse": { - "type": "object", - "properties": { - "limit": { - "type": "integer", - "description": "Number of items per page." - }, - "has_more": { - "type": "boolean", - "description": "Whether there are more conversations." + "title": "Files", + "type": "array" }, - "data": { - "type": "array", - "description": "List of conversations.", - "items": { - "$ref": "#/components/schemas/ConversationListItem" - } - } - } - }, - "ConversationListItem": { - "type": "object", - "properties": { "id": { - "type": "string", - "format": "uuid", - "description": "Conversation ID." + "title": "Id", + "type": "string" }, - "name": { - "type": "string", - "description": "Conversation name." + "message_id": { + "title": "Message Id", + "type": "string" }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "Input variables for the conversation." + "observation": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Observation" }, - "status": { - "type": "string", - "description": "Conversation status. `normal` for active conversations." + "position": { + "title": "Position", + "type": "integer" }, - "introduction": { - "type": "string", - "description": "Conversation introduction." + "thought": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Thought" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Creation timestamp." + "tool": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tool" }, - "updated_at": { - "type": "integer", - "format": "int64", - "description": "Last update timestamp." + "tool_input": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tool Input" + }, + "tool_labels": { + "$ref": "#/components/schemas/JSONValue" } - } + }, + "required": [ + "files", + "id", + "message_id", + "position", + "tool_labels" + ], + "title": "AgentThought", + "type": "object" }, - "ConversationRenameRequest": { - "type": "object", - "description": "Request body for renaming a conversation.", + "Annotation": { "properties": { - "name": { - "type": "string", - "description": "New conversation name. Required unless `auto_generate` is `true`." + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Answer" }, - "auto_generate": { - "type": "boolean", - "default": false, - "description": "Automatically generate the conversation name. When `true`, the `name` field is ignored." + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" }, - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity)." + "hit_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Hit Count" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "question": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Question" } - } + }, + "required": [ + "id" + ], + "title": "Annotation", + "type": "object" }, - "ConversationVariablesResponse": { - "type": "object", + "AnnotationCreatePayload": { "properties": { - "limit": { - "type": "integer", - "description": "Number of items per page." - }, - "has_more": { - "type": "boolean", - "description": "Whether there is a next page." + "answer": { + "description": "Annotation answer.", + "title": "Answer", + "type": "string" }, - "data": { - "type": "array", - "description": "List of conversation variables.", - "items": { - "$ref": "#/components/schemas/ConversationVariableItem" - } + "question": { + "description": "Annotation question.", + "title": "Question", + "type": "string" } - } + }, + "required": [ + "answer", + "question" + ], + "title": "AnnotationCreatePayload", + "type": "object" }, - "ConversationVariableItem": { - "type": "object", + "AnnotationJobStatusDetailResponse": { "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Variable ID." - }, - "name": { - "type": "string", - "description": "Variable name." - }, - "value_type": { - "type": "string", - "description": "Variable value type. Possible values: `string`, `number`, `object`, `secret`, `file`, `boolean`, `array[any]`, `array[string]`, `array[number]`, `array[object]`, `array[file]`, `array[boolean]`." - }, - "value": { - "type": "string", - "description": "Variable value (can be a JSON string for complex types)." - }, - "description": { - "type": "string", - "description": "Variable description." + "error_msg": { + "default": "", + "title": "Error Msg", + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Creation timestamp." + "job_id": { + "format": "uuid", + "title": "Job Id", + "type": "string" }, - "updated_at": { - "type": "integer", - "format": "int64", - "description": "Last update timestamp." + "job_status": { + "title": "Job Status", + "type": "string" } - } - }, - "ConversationVariableUpdateRequest": { - "type": "object", - "description": "Request body for updating a conversation variable.", + }, "required": [ - "value" + "job_id", + "job_status" ], + "title": "AnnotationJobStatusDetailResponse", + "type": "object" + }, + "AnnotationJobStatusResponse": { "properties": { - "value": { - "description": "The new value for the variable. Must match the variable's expected type." + "job_id": { + "format": "uuid", + "title": "Job Id", + "type": "string" }, - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity)." + "job_status": { + "title": "Job Status", + "type": "string" } - } - }, - "AudioToTextRequest": { - "type": "object", - "description": "Request body for audio-to-text conversion.", + }, "required": [ - "file" + "job_id", + "job_status" ], - "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "Audio file to transcribe. Accepted MIME types: `audio/mp3`, `audio/m4a` (also accepted as `audio/x-m4a`), `audio/wav`, `audio/amr`, `audio/mpga`. Other types, including the common `audio/mpeg`, are rejected with `unsupported_audio_type`. Maximum size `30 MB`." - }, - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity)." - } - } - }, - "AudioToTextResponse": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "Output text from speech recognition." - } - } + "title": "AnnotationJobStatusResponse", + "type": "object" }, - "TextToAudioRequest": { - "type": "object", - "description": "Request body for text-to-audio conversion. Provide either `message_id` or `text`.", + "AnnotationList": { "properties": { - "message_id": { - "type": "string", - "format": "uuid", - "description": "ID of the message whose answer to voice. Takes priority over `text` when both are provided. Get message IDs from [List Conversation Messages](/en/api-reference/conversations/list-conversation-messages)." + "data": { + "items": { + "$ref": "#/components/schemas/Annotation" + }, + "title": "Data", + "type": "array" }, - "text": { - "type": "string", - "description": "Text to synthesize into speech." + "has_more": { + "title": "Has More", + "type": "boolean" }, - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity)." + "limit": { + "title": "Limit", + "type": "integer" }, - "voice": { - "type": "string", - "description": "Voice to use for text-to-speech. Available voices depend on the TTS provider configured for this app. Use the `voice` value from [Get App Parameters](/en/api-reference/applications/get-app-parameters) → `text_to_speech.voice` for the default." + "page": { + "title": "Page", + "type": "integer" }, - "streaming": { - "type": "boolean", - "description": "Accepted for backward compatibility but has no effect. Whether the audio is streamed is determined by the configured TTS provider's output, not by this field." + "total": { + "title": "Total", + "type": "integer" } - } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "title": "AnnotationList", + "type": "object" }, - "AppInfoResponse": { - "type": "object", + "AnnotationListQuery": { "properties": { - "name": { - "type": "string", - "description": "Application name." - }, - "description": { - "type": "string", - "description": "Application description." - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Application tags." + "keyword": { + "default": "", + "description": "Keyword to filter annotations by question or answer content.", + "title": "Keyword", + "type": "string" }, - "mode": { - "type": "string", - "description": "Application mode. `completion` for text generation apps, `chat` for basic chat apps, `agent-chat` for agent-based apps, `advanced-chat` for Chatflow apps, `workflow` for Workflow apps, `agent` for New Agent apps." + "limit": { + "default": 20, + "description": "Number of items per page.", + "minimum": 1, + "title": "Limit", + "type": "integer" }, - "author_name": { - "type": "string", - "description": "Name of the application author." + "page": { + "default": 1, + "description": "Page number for pagination.", + "minimum": 1, + "title": "Page", + "type": "integer" } - } + }, + "title": "AnnotationListQuery", + "type": "object" }, - "UserInputFormItem": { - "type": "object", - "oneOf": [ - { - "$ref": "#/components/schemas/TextInputControlWrapper" + "AnnotationReplyActionPayload": { + "properties": { + "embedding_model_name": { + "description": "Name of the embedding model to use for annotation matching.", + "title": "Embedding Model Name", + "type": "string" }, - { - "$ref": "#/components/schemas/ParagraphControlWrapper" + "embedding_provider_name": { + "description": "Name of the embedding model provider.", + "title": "Embedding Provider Name", + "type": "string" }, - { - "$ref": "#/components/schemas/SelectControlWrapper" - } - ] - }, - "TextInputControlWrapper": { - "title": "Text Input", - "type": "object", - "properties": { - "text-input": { - "$ref": "#/components/schemas/TextInputControl" - } - } - }, - "ParagraphControlWrapper": { - "title": "Paragraph", - "type": "object", - "properties": { - "paragraph": { - "$ref": "#/components/schemas/ParagraphControl" + "score_threshold": { + "description": "Minimum similarity score for an annotation to be considered a match. Higher values require closer matches.", + "format": "float", + "title": "Score Threshold", + "type": "number" } - } + }, + "required": [ + "embedding_model_name", + "embedding_provider_name", + "score_threshold" + ], + "title": "AnnotationReplyActionPayload", + "type": "object" }, - "SelectControlWrapper": { - "title": "Select", - "type": "object", + "AppFeedbackListResponse": { "properties": { - "select": { - "$ref": "#/components/schemas/SelectControl" + "data": { + "items": { + "$ref": "#/components/schemas/AppFeedbackResponse" + }, + "title": "Data", + "type": "array" } - } + }, + "required": [ + "data" + ], + "title": "AppFeedbackListResponse", + "type": "object" }, - "TextInputControl": { - "type": "object", + "AppFeedbackResponse": { "properties": { - "label": { - "type": "string", - "description": "Display label for the form field." + "app_id": { + "format": "uuid", + "title": "App Id", + "type": "string" }, - "variable": { - "type": "string", - "description": "Variable name used as the key in the `inputs` object." + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Content" }, - "required": { - "type": "boolean", - "description": "Whether this field must be filled before submission." + "conversation_id": { + "format": "uuid", + "title": "Conversation Id", + "type": "string" }, - "default": { - "type": "string", - "description": "Default value pre-filled in the form field." - } - } - }, - "ParagraphControl": { - "type": "object", - "properties": { - "label": { - "type": "string", - "description": "Display label for the form field." + "created_at": { + "title": "Created At", + "type": "string" }, - "variable": { - "type": "string", - "description": "Variable name used as the key in the `inputs` object." + "from_account_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "From Account Id" }, - "required": { - "type": "boolean", - "description": "Whether this field must be filled before submission." + "from_end_user_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "From End User Id" }, - "default": { - "type": "string", - "description": "Default value pre-filled in the form field." - } - } - }, - "SelectControl": { - "type": "object", - "properties": { - "label": { - "type": "string", - "description": "Display label for the form field." + "from_source": { + "title": "From Source", + "type": "string" }, - "variable": { - "type": "string", - "description": "Variable name used as the key in the `inputs` object." + "id": { + "format": "uuid", + "title": "Id", + "type": "string" }, - "required": { - "type": "boolean", - "description": "Whether a selection must be made before submission." + "message_id": { + "format": "uuid", + "title": "Message Id", + "type": "string" }, - "default": { - "type": "string", - "description": "Default selected value." + "rating": { + "title": "Rating", + "type": "string" }, - "options": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of selectable values for this form control." + "updated_at": { + "title": "Updated At", + "type": "string" } - } + }, + "required": [ + "app_id", + "conversation_id", + "created_at", + "from_source", + "id", + "message_id", + "rating", + "updated_at" + ], + "title": "AppFeedbackResponse", + "type": "object" }, - "AppMetaResponse": { - "type": "object", + "AudioBinaryResponse": { + "format": "binary", + "title": "AudioBinaryResponse", + "type": "string" + }, + "AudioTranscriptResponse": { "properties": { - "tool_icons": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "title": "Icon URL", - "type": "string", - "format": "url", - "description": "URL of the icon." - }, - { - "$ref": "#/components/schemas/ToolIconDetail" - } - ] - }, - "description": "Tool icons. Keys are tool names." + "text": { + "title": "Text", + "type": "string" } - } + }, + "required": [ + "text" + ], + "title": "AudioTranscriptResponse", + "type": "object" }, - "ToolIconDetail": { - "title": "Emoji Icon", - "type": "object", - "description": "Detail of a tool icon using emoji.", + "BinaryFileResponse": { + "format": "binary", + "title": "BinaryFileResponse", + "type": "string" + }, + "BlockingMetadataResponse": { + "additionalProperties": true, "properties": { - "background": { - "type": "string", - "description": "Background color in hex format." + "retriever_resources": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/BlockingRetrieverResourceResponse" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Retriever Resources" }, - "content": { - "type": "string", - "description": "Emoji content." + "usage": { + "anyOf": [ + { + "$ref": "#/components/schemas/BlockingUsageResponse" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "title": "BlockingMetadataResponse", + "type": "object" }, - "WebAppSettingsResponse": { - "type": "object", + "BlockingRetrieverResourceResponse": { + "additionalProperties": true, "properties": { - "title": { - "type": "string", - "description": "Web app title." - }, - "chat_color_theme": { - "type": "string", - "description": "Chat color theme." + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Content" }, - "chat_color_theme_inverted": { - "type": "boolean", - "description": "Whether the chat color theme is inverted." + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" }, - "icon_type": { - "type": "string", - "description": "Type of icon used. `emoji` for emoji icons, `image` for uploaded image icons." + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Source Type" }, - "icon": { - "type": "string", - "description": "Icon content (emoji or image ID)." + "dataset_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Dataset Id" }, - "icon_background": { - "type": "string", - "description": "Icon background color." + "dataset_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Dataset Name" }, - "icon_url": { - "type": "string", - "format": "url", - "nullable": true, - "description": "URL of the icon image." + "document_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Document Id" }, - "description": { - "type": "string", - "description": "Web app description." + "document_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Document Name" }, - "copyright": { - "type": "string", - "description": "Copyright text." + "hit_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Hit Count" }, - "privacy_policy": { - "type": "string", - "description": "Privacy policy URL." + "id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Id" }, - "input_placeholder": { - "type": "string", - "nullable": true, - "description": "Placeholder text shown in the web app message input box. `null` when not configured." + "index_node_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Index Node Hash" }, - "custom_disclaimer": { - "type": "string", - "description": "Custom disclaimer text." + "message_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Message Id" }, - "default_language": { - "type": "string", - "description": "Default language code." + "position": { + "title": "Position", + "type": "integer" }, - "show_workflow_steps": { - "type": "boolean", - "description": "Whether to show workflow steps." + "score": { + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Score" }, - "use_icon_as_answer_icon": { - "type": "boolean", - "description": "Whether to use the app icon as the answer icon." + "segment_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Segment Id" + }, + "segment_position": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Segment Position" + }, + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Summary" + }, + "word_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Word Count" } - } + }, + "required": [ + "position" + ], + "title": "BlockingRetrieverResourceResponse", + "type": "object" }, - "AnnotationListResponse": { - "type": "object", + "BlockingUsageResponse": { + "additionalProperties": true, "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AnnotationItem" - }, - "description": "List of annotation items for the current page." + "completion_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Completion Price" }, - "has_more": { - "type": "boolean", - "description": "`true` if more pages are available beyond the current result set." + "completion_price_unit": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Completion Price Unit" }, - "limit": { - "type": "integer", - "description": "Number of items per page." + "completion_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Completion Tokens" }, - "total": { - "type": "integer", - "description": "Total number of annotations matching the query." + "completion_unit_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Completion Unit Price" }, - "page": { - "type": "integer", - "description": "Current page number." - } - } - }, - "AnnotationItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Unique annotation identifier." + "currency": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Currency" }, - "question": { - "type": "string", - "nullable": true, - "description": "Question text that triggers this annotation." + "latency": { + "anyOf": [ + { + "format": "double", + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Latency" }, - "answer": { - "type": "string", - "nullable": true, - "description": "Predefined answer returned when the annotation is matched." + "prompt_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Prompt Price" }, - "hit_count": { - "type": "integer", - "nullable": true, - "description": "Number of times this annotation has been matched and returned as a reply." + "prompt_price_unit": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Prompt Price Unit" }, - "created_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "Creation timestamp (Unix epoch seconds)." - } - } - }, - "CreateAnnotationRequest": { - "type": "object", - "description": "Request body for creating a new annotation.", - "required": [ - "question", - "answer" - ], - "properties": { - "question": { - "type": "string", - "description": "Question text the app matches incoming user input against." + "prompt_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Prompt Tokens" }, - "answer": { - "type": "string", - "description": "Answer returned when this annotation is matched." - } - } - }, - "UpdateAnnotationRequest": { - "type": "object", - "description": "Request body for updating an annotation.", - "required": [ - "question", - "answer" - ], - "properties": { - "question": { - "type": "string", - "description": "New question text for the annotation." + "prompt_unit_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Prompt Unit Price" }, - "answer": { - "type": "string", - "description": "New answer text for the annotation." + "total_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Total Price" + }, + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Total Tokens" } - } + }, + "title": "BlockingUsageResponse", + "type": "object" }, - "InitialAnnotationReplySettingsRequest": { - "type": "object", - "description": "Request body for configuring annotation reply settings.", - "required": [ - "score_threshold", - "embedding_provider_name", - "embedding_model_name" + "ButtonStyle": { + "description": "Button styles for user actions.", + "enum": [ + "accent", + "default", + "ghost", + "primary" ], - "properties": { - "embedding_provider_name": { - "type": "string", - "description": "Embedding model provider (for example, `openai`). Get available providers from [Get Available Models](/en/api-reference/models/get-available-models)." + "title": "ButtonStyle", + "type": "string" + }, + "ChatBlockingResponse": { + "description": "Blocking chat response for a completed message or paused Chatflow.", + "discriminator": { + "mapping": { + "message": "#/components/schemas/ChatMessageBlockingResponse", + "workflow_paused": "#/components/schemas/ChatPausedBlockingResponse" }, - "embedding_model_name": { - "type": "string", - "description": "Embedding model used to vectorize annotations for matching (for example, `text-embedding-3-small`)." + "propertyName": "event" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ChatMessageBlockingResponse" }, - "score_threshold": { - "type": "number", - "format": "float", - "description": "Minimum similarity score for an annotation to be considered a match. Higher values require closer matches." + { + "$ref": "#/components/schemas/ChatPausedBlockingResponse" } - } + ], + "title": "ChatBlockingResponse" }, - "InitialAnnotationReplySettingsResponse": { - "type": "object", + "ChatMessageBlockingResponse": { + "additionalProperties": true, "properties": { - "job_id": { - "type": "string", + "answer": { + "title": "Answer", + "type": "string" + }, + "conversation_id": { "format": "uuid", - "description": "Asynchronous job ID. Use with [Get Annotation Reply Job Status](/en/api-reference/annotations/get-annotation-reply-job-status) to track progress." + "title": "Conversation Id", + "type": "string" }, - "job_status": { - "type": "string", - "description": "Current job status: `waiting` (queued) or `processing` (in progress). `completed` and `error` are returned only by [Get Annotation Reply Job Status](/en/api-reference/annotations/get-annotation-reply-job-status)." - } - } - }, - "InitialAnnotationReplySettingsStatusResponse": { - "type": "object", - "properties": { - "job_id": { - "type": "string", + "created_at": { + "format": "int64", + "title": "Created At", + "type": "integer" + }, + "event": { + "const": "message", + "title": "Event", + "type": "string" + }, + "id": { "format": "uuid", - "description": "Job ID from the [Configure Annotation Reply](/en/api-reference/annotations/configure-annotation-reply) call." + "title": "Id", + "type": "string" }, - "job_status": { - "type": "string", - "description": "Current job status. `waiting` for queued, `processing` for in progress, `completed` when finished, `error` if failed." + "message_id": { + "format": "uuid", + "title": "Message Id", + "type": "string" }, - "error_msg": { - "type": "string", - "description": "Error message describing why the job failed. Empty string when `job_status` is not `error`." + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "title": "Mode", + "type": "string" + }, + "task_id": { + "format": "uuid", + "title": "Task Id", + "type": "string" } - } + }, + "required": [ + "answer", + "conversation_id", + "created_at", + "event", + "id", + "message_id", + "metadata", + "mode", + "task_id" + ], + "title": "ChatMessageBlockingResponse", + "type": "object" }, - "AppParametersResponse": { - "type": "object", + "ChatPauseReasonResponse": { + "additionalProperties": true, + "description": "Public pause reason emitted by a blocking Chatflow execution.", "properties": { - "opening_statement": { - "type": "string", - "nullable": true, - "description": "Opening statement text." + "TYPE": { + "title": "Type", + "type": "string" }, - "suggested_questions": { - "type": "array", + "actions": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "title": "Actions", + "type": "array" + }, + "approval_channels": { "items": { "type": "string" }, - "description": "List of suggested questions." + "title": "Approval Channels", + "type": "array" }, - "suggested_questions_after_answer": { - "type": "object", - "description": "Configuration for suggested questions after an answer.", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether this feature is enabled." + "display_in_ui": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Display In Ui" }, - "speech_to_text": { - "type": "object", - "description": "Speech-to-text feature configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether this feature is enabled." + "expiration_time": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Expiration Time" }, - "text_to_speech": { - "type": "object", - "description": "Text-to-speech feature configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether this feature is enabled." - }, - "voice": { - "type": "string", - "description": "Voice identifier for TTS." + "form_content": { + "anyOf": [ + { + "type": "string" }, - "language": { - "type": "string", - "description": "Language for TTS." + { + "type": "null" + } + ], + "default": null, + "title": "Form Content" + }, + "form_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" }, - "autoPlay": { - "type": "string", - "description": "Auto-play setting. `enabled` to auto-play audio, `disabled` to require manual play." + { + "type": "null" } - } + ], + "default": null, + "title": "Form Id" }, - "retriever_resource": { - "type": "object", - "description": "Knowledge retrieval citation resource configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether this feature is enabled." + "form_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Form Token" }, - "annotation_reply": { - "type": "object", - "description": "Annotation reply feature configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether this feature is enabled." + "inputs": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "title": "Inputs", + "type": "array" + }, + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Message" }, - "more_like_this": { - "type": "object", - "description": "More-like-this feature configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether this feature is enabled." + "node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Node Id" }, - "sensitive_word_avoidance": { - "type": "object", - "description": "Content moderation feature configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether this feature is enabled." + "node_title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Node Title" }, - "user_input_form": { - "type": "array", + "resolved_default_values": { + "additionalProperties": true, + "title": "Resolved Default Values", + "type": "object" + } + }, + "required": [ + "TYPE" + ], + "title": "ChatPauseReasonResponse", + "type": "object" + }, + "ChatPausedBlockingDataResponse": { + "additionalProperties": true, + "properties": { + "answer": { + "title": "Answer", + "type": "string" + }, + "conversation_id": { + "format": "uuid", + "title": "Conversation Id", + "type": "string" + }, + "created_at": { + "format": "int64", + "title": "Created At", + "type": "integer" + }, + "elapsed_time": { + "format": "float", + "title": "Elapsed Time", + "type": "number" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "message_id": { + "format": "uuid", + "title": "Message Id", + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "title": "Mode", + "type": "string" + }, + "paused_nodes": { "items": { - "type": "object", - "oneOf": [ - { - "title": "Text Input", - "type": "object", - "properties": { - "text-input": { - "type": "object", + "type": "string" + }, + "title": "Paused Nodes", + "type": "array" + }, + "reasons": { + "items": { + "$ref": "#/components/schemas/ChatPauseReasonResponse" + }, + "title": "Reasons", + "type": "array" + }, + "status": { + "const": "paused", + "title": "Status", + "type": "string" + }, + "total_steps": { + "title": "Total Steps", + "type": "integer" + }, + "total_tokens": { + "title": "Total Tokens", + "type": "integer" + }, + "workflow_run_id": { + "format": "uuid", + "title": "Workflow Run Id", + "type": "string" + } + }, + "required": [ + "answer", + "conversation_id", + "created_at", + "elapsed_time", + "id", + "message_id", + "metadata", + "mode", + "paused_nodes", + "reasons", + "status", + "total_steps", + "total_tokens", + "workflow_run_id" + ], + "title": "ChatPausedBlockingDataResponse", + "type": "object" + }, + "ChatPausedBlockingResponse": { + "additionalProperties": true, + "properties": { + "answer": { + "title": "Answer", + "type": "string" + }, + "conversation_id": { + "format": "uuid", + "title": "Conversation Id", + "type": "string" + }, + "created_at": { + "format": "int64", + "title": "Created At", + "type": "integer" + }, + "data": { + "$ref": "#/components/schemas/ChatPausedBlockingDataResponse" + }, + "event": { + "const": "workflow_paused", + "title": "Event", + "type": "string" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "message_id": { + "format": "uuid", + "title": "Message Id", + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "title": "Mode", + "type": "string" + }, + "task_id": { + "format": "uuid", + "title": "Task Id", + "type": "string" + }, + "workflow_run_id": { + "format": "uuid", + "title": "Workflow Run Id", + "type": "string" + } + }, + "required": [ + "answer", + "conversation_id", + "created_at", + "data", + "event", + "id", + "message_id", + "metadata", + "mode", + "task_id", + "workflow_run_id" + ], + "title": "ChatPausedBlockingResponse", + "type": "object" + }, + "ChatRequestPayload": { + "properties": { + "auto_generate_name": { + "default": true, + "description": "Auto-generate the conversation title. If `false`, use the Rename Conversation API with `auto_generate: true` to generate the title asynchronously.", + "title": "Auto Generate Name", + "type": "boolean" + }, + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Conversation ID to continue a conversation. Omit this field or pass an empty string to start a new conversation, then pass the returned `conversation_id` in subsequent requests.", + "title": "Conversation Id" + }, + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { "properties": { - "label": { - "type": "string", - "description": "Display label for the input field." + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" }, - "variable": { - "type": "string", - "description": "Variable name used in the workflow." + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" }, - "required": { - "type": "boolean", - "description": "Whether this field is required." + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "default": { - "type": "string", - "description": "Default value for the input field." + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" } - } - } - } - }, - { - "title": "Paragraph", - "type": "object", - "properties": { - "paragraph": { - "type": "object", + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { "properties": { - "label": { - "type": "string", - "description": "Display label for the paragraph field." + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" }, - "variable": { - "type": "string", - "description": "Variable name used in the workflow." + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" }, - "required": { - "type": "boolean", - "description": "Whether this field is required." + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "default": { - "type": "string", - "description": "Default value for the paragraph field." + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" } - } - } - } - }, - { - "title": "Select", - "type": "object", - "properties": { - "select": { - "type": "object", + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { "properties": { - "label": { - "type": "string", - "description": "Display label for the select field." + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" }, - "variable": { - "type": "string", - "description": "Variable name used in the workflow." + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" }, - "required": { - "type": "boolean", - "description": "Whether this field is required." + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "default": { - "type": "string", - "description": "Default selected value." + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" }, - "options": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of selectable values for this form control." + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" } - } - } - } - } - ] - }, - "description": "User input form configuration." - }, - "file_upload": { - "type": "object", - "description": "File upload configuration.", - "properties": { - "image": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether image upload is enabled." - }, - "number_limits": { - "type": "integer", - "description": "Maximum number of images that can be uploaded." - }, - "detail": { - "type": "string", - "description": "Image detail level for vision models." - }, - "transfer_methods": { - "type": "array", - "items": { - "type": "string" + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" }, - "description": "Allowed transfer methods for image upload. `remote_url` for file URL, `local_file` for uploaded file." - } - } + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" } - } + ], + "default": null, + "description": "File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`.", + "title": "Files" }, - "system_parameters": { - "type": "object", - "description": "System-level parameter limits.", - "properties": { - "file_size_limit": { - "type": "integer", - "description": "Maximum general file size in MB." - }, - "image_file_size_limit": { - "type": "integer", - "description": "Maximum image file size in MB." - }, - "audio_file_size_limit": { - "type": "integer", - "description": "Maximum audio file size in MB." + "inputs": { + "additionalProperties": true, + "description": "Values for app-defined variables. Refer to the `user_input_form` field in the [Get App Parameters](/en/api-reference/applications/get-app-parameters) response to discover expected variable names and types.", + "title": "Inputs", + "type": "object" + }, + "query": { + "description": "User input or question content.", + "title": "Query", + "type": "string" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "video_file_size_limit": { - "type": "integer", - "description": "Maximum video file size in MB." + { + "type": "null" + } + ], + "default": null, + "description": "Response mode. `streaming` uses Server-Sent Events; `blocking` returns after completion. New Agent app mode supports streaming only. When omitted, non-Agent apps run in blocking mode and new Agent apps stream.", + "title": "Response Mode" + }, + "workflow_id": { + "anyOf": [ + { + "type": "string" }, - "workflow_file_upload_limit": { - "type": "integer", - "description": "Maximum number of files per workflow execution." + { + "type": "null" } - } + ], + "default": null, + "description": "Published workflow version ID to execute for advanced chat. If omitted, the app's current published workflow is used.", + "title": "Workflow Id" } - } + }, + "required": [ + "inputs", + "query" + ], + "title": "ChatRequestPayload", + "type": "object" }, - "StreamEventWorkflowStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChatRequestPayloadWithUser": { + "properties": { + "auto_generate_name": { + "default": true, + "description": "Auto-generate the conversation title. If `false`, use the Rename Conversation API with `auto_generate: true` to generate the title asynchronously.", + "title": "Auto Generate Name", + "type": "boolean" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Conversation ID to continue a conversation. Omit this field or pass an empty string to start a new conversation, then pass the returned `conversation_id` in subsequent requests.", + "title": "Conversation Id" }, - { - "type": "object", - "description": "Workflow execution started.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Workflow run ID." - }, - "workflow_id": { - "type": "string", - "description": "Associated workflow ID." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "Input variables for this workflow execution." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Start timestamp (Unix epoch seconds)." - }, - "reason": { - "type": "string", - "description": "Reason for workflow start. `initial` for first start, `resumption` when resuming after a pause (e.g., after human input)." - } - } + { + "type": "null" } - } - } - ] - }, - "StreamEventWorkflowFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + ], + "default": null, + "description": "File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`.", + "title": "Files" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "inputs": { + "additionalProperties": true, + "description": "Values for app-defined variables. Refer to the `user_input_form` field in the [Get App Parameters](/en/api-reference/applications/get-app-parameters) response to discover expected variable names and types.", + "title": "Inputs", + "type": "object" }, - { - "type": "object", - "description": "Workflow execution finished.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." + "query": { + "description": "User input or question content.", + "title": "Query", + "type": "string" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Workflow run ID." - }, - "workflow_id": { - "type": "string", - "description": "Associated workflow ID." - }, - "status": { - "type": "string", - "description": "Execution status. `running` while in progress, `succeeded` on success, `failed` on failure, `stopped` if manually stopped, `partial-succeeded` if partially completed, `paused` when waiting for human input." - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Workflow output data." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if execution failed." - }, - "elapsed_time": { - "type": "number", - "description": "Total execution time in seconds." - }, - "total_tokens": { - "type": "integer", - "description": "Total tokens consumed." - }, - "total_steps": { - "type": "integer", - "description": "Total steps executed." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Start timestamp (Unix epoch seconds)." - }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "Finish timestamp (Unix epoch seconds)." - }, - "exceptions_count": { - "type": "integer", - "nullable": true, - "description": "Number of exceptions during execution." - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "Files generated during workflow execution." - } - } + { + "type": "null" } - } - } - ] - }, - "StreamEventNodeStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + ], + "default": null, + "description": "Response mode. `streaming` uses Server-Sent Events; `blocking` returns after completion. New Agent app mode supports streaming only. When omitted, non-Agent apps run in blocking mode and new Agent apps stream.", + "title": "Response Mode" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" }, - { - "type": "object", - "description": "Node execution started.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." + "workflow_id": { + "anyOf": [ + { + "type": "string" }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Node execution ID." - }, - "node_id": { - "type": "string", - "description": "Node ID in the workflow graph." - }, - "node_type": { - "type": "string", - "description": "Node type (e.g., `llm`, `knowledge-retrieval`, `code`)." - }, - "title": { - "type": "string", - "description": "Node title." - }, - "index": { - "type": "integer", - "description": "Execution index." - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "ID of the predecessor node." - }, - "inputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Node input data. May be `null` in simplified API responses." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Start timestamp (Unix epoch seconds)." - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "Additional metadata." - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "Iteration ID if this node runs inside an iteration." - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "Loop ID if this node runs inside a loop." - } - } + { + "type": "null" } - } + ], + "default": null, + "description": "Published workflow version ID to execute for advanced chat. If omitted, the app's current published workflow is used.", + "title": "Workflow Id" } - ] + }, + "required": [ + "inputs", + "query", + "user" + ], + "title": "ChatRequestPayload", + "type": "object" }, - "StreamEventNodeFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "Node execution finished.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Node execution ID." - }, - "node_id": { - "type": "string", - "description": "Node ID in the workflow graph." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Node title." - }, - "index": { - "type": "integer", - "description": "Execution index." - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "ID of the predecessor node." - }, - "inputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Node input data. May be `null` in simplified API responses." - }, - "process_data": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Node processing data. May be `null` in simplified API responses." - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Node output data. May be `null` in simplified API responses." - }, - "status": { - "type": "string", - "description": "Node execution status. `running` while in progress, `succeeded` on success, `failed` on failure, `exception` if an exception occurred." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if node failed." - }, - "elapsed_time": { - "type": "number", - "description": "Node execution time in seconds." - }, - "execution_metadata": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Execution metadata (e.g., token usage, model info). May be `null` in simplified API responses." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Start timestamp (Unix epoch seconds)." - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "Finish timestamp (Unix epoch seconds)." - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "Files generated by this node." - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "Iteration ID if this node runs inside an iteration." - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "Loop ID if this node runs inside a loop." - } - } - } - } + "ChildChunkCreatePayload": { + "properties": { + "content": { + "description": "Child chunk text content.", + "title": "Content", + "type": "string" } - ] + }, + "required": [ + "content" + ], + "title": "ChildChunkCreatePayload", + "type": "object" }, - "StreamEventNodeRetry": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "Node retry attempt.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Node execution ID." - }, - "node_id": { - "type": "string", - "description": "Node ID in the workflow graph." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Node title." - }, - "index": { - "type": "integer", - "description": "Execution index." - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "ID of the predecessor node." - }, - "inputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Node input data." - }, - "process_data": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Node processing data." - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Node output data." - }, - "status": { - "type": "string", - "description": "Node execution status. `running` while in progress, `succeeded` on success, `failed` on failure, `exception` if an exception occurred." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message for this retry attempt." - }, - "elapsed_time": { - "type": "number", - "description": "Execution time for this attempt in seconds." - }, - "execution_metadata": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Execution metadata." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Start timestamp (Unix epoch seconds)." - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "Finish timestamp (Unix epoch seconds)." - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "Files generated during this retry." - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "Iteration ID if applicable." - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "Loop ID if applicable." - }, - "retry_index": { - "type": "integer", - "description": "Retry attempt index, starts at `0`." - } - } - } - } + "ChildChunkDetailResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/ChildChunkResponse" } - ] + }, + "required": [ + "data" + ], + "title": "ChildChunkDetailResponse", + "type": "object" }, - "StreamEventIterationStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "Iteration loop started.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." + "ChildChunkListQuery": { + "properties": { + "keyword": { + "anyOf": [ + { + "type": "string" }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Iteration execution ID." - }, - "node_id": { - "type": "string", - "description": "Iteration node ID." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Iteration node title." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Start timestamp (Unix epoch seconds)." - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "Additional metadata." - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "Iteration metadata." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "Iteration input data." - } - } + { + "type": "null" } - } - } - ] - }, - "StreamEventIterationNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + ], + "default": null, + "description": "Search keyword.", + "title": "Keyword" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "limit": { + "default": 20, + "description": "Number of items per page. Server caps at `100`.", + "minimum": 1, + "title": "Limit", + "type": "integer" }, - { - "type": "object", - "description": "Iteration progressed to next item.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Iteration execution ID." - }, - "node_id": { - "type": "string", - "description": "Iteration node ID." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Iteration node title." - }, - "index": { - "type": "integer", - "description": "Current iteration index (0-based)." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Timestamp (Unix epoch seconds)." - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "Additional metadata." - } - } - } - } + "page": { + "default": 1, + "description": "Page number to retrieve.", + "minimum": 1, + "title": "Page", + "type": "integer" } - ] + }, + "title": "ChildChunkListQuery", + "type": "object" }, - "StreamEventIterationCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChildChunkListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ChildChunkResponse" + }, + "title": "Data", + "type": "array" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "limit": { + "title": "Limit", + "type": "integer" }, - { - "type": "object", - "description": "Iteration loop completed.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Iteration execution ID." - }, - "node_id": { - "type": "string", - "description": "Iteration node ID." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Iteration node title." - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Iteration output data." - }, - "status": { - "type": "string", - "description": "Iteration execution status. `running` while in progress, `succeeded` on success, `failed` on failure, `exception` if an exception occurred." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if iteration failed." - }, - "elapsed_time": { - "type": "number", - "description": "Total iteration time in seconds." - }, - "total_tokens": { - "type": "integer", - "description": "Total tokens consumed across all iterations." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Start timestamp (Unix epoch seconds)." - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "Finish timestamp (Unix epoch seconds)." - }, - "steps": { - "type": "integer", - "description": "Total number of iteration steps executed." - } - } - } - } - } - ] - }, - "StreamEventLoopStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "page": { + "title": "Page", + "type": "integer" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "total": { + "title": "Total", + "type": "integer" }, - { - "type": "object", - "description": "Loop started.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Loop execution ID." - }, - "node_id": { - "type": "string", - "description": "Loop node ID." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Loop node title." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Start timestamp (Unix epoch seconds)." - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "Additional metadata." - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "Loop metadata." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "Loop input data." - } - } - } - } + "total_pages": { + "title": "Total Pages", + "type": "integer" } - ] + }, + "required": [ + "data", + "limit", + "page", + "total", + "total_pages" + ], + "title": "ChildChunkListResponse", + "type": "object" }, - "StreamEventLoopNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChildChunkResponse": { + "properties": { + "content": { + "title": "Content", + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "created_at": { + "title": "Created At", + "type": "integer" }, - { - "type": "object", - "description": "Loop progressed to next iteration.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Loop execution ID." - }, - "node_id": { - "type": "string", - "description": "Loop node ID." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Loop node title." - }, - "index": { - "type": "integer", - "description": "Current loop index (0-based)." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Timestamp (Unix epoch seconds)." - }, - "pre_loop_output": { - "description": "Output from the previous loop iteration." - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "Additional metadata." - } - } - } - } - } - ] - }, - "StreamEventLoopCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "id": { + "title": "Id", + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "position": { + "title": "Position", + "type": "integer" }, - { - "type": "object", - "description": "Loop completed.", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Loop execution ID." - }, - "node_id": { - "type": "string", - "description": "Loop node ID." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Loop node title." - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "Loop output data." - }, - "status": { - "type": "string", - "description": "Loop execution status. `running` while in progress, `succeeded` on success, `failed` on failure, `exception` if an exception occurred." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if loop failed." - }, - "elapsed_time": { - "type": "number", - "description": "Total loop execution time in seconds." - }, - "total_tokens": { - "type": "integer", - "description": "Total tokens consumed across all loop iterations." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Start timestamp (Unix epoch seconds)." - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "Finish timestamp (Unix epoch seconds)." - }, - "steps": { - "type": "integer", - "description": "Total number of loop steps executed." - } - } - } - } + "segment_id": { + "title": "Segment Id", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + }, + "updated_at": { + "title": "Updated At", + "type": "integer" + }, + "word_count": { + "title": "Word Count", + "type": "integer" } - ] + }, + "required": [ + "content", + "created_at", + "id", + "position", + "segment_id", + "type", + "updated_at", + "word_count" + ], + "title": "ChildChunkResponse", + "type": "object" }, - "StreamEventHumanInputRequired": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChildChunkUpdatePayload": { + "properties": { + "content": { + "description": "Child chunk text content.", + "title": "Content", + "type": "string" + } + }, + "required": [ + "content" + ], + "title": "ChildChunkUpdatePayload", + "type": "object" + }, + "CompletionBlockingResponse": { + "additionalProperties": true, + "properties": { + "answer": { + "title": "Answer", + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "created_at": { + "format": "int64", + "title": "Created At", + "type": "integer" }, - { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." - }, - "data": { - "type": "object", - "properties": { - "form_id": { - "type": "string", - "description": "Identifier for the form instance, surfaced in error messages and logs. Use `form_token` for Service API calls." - }, - "node_id": { - "type": "string", - "description": "ID of the Human Input node that produced this form." - }, - "node_title": { - "type": "string", - "description": "Display title of the Human Input node." - }, - "form_content": { - "type": "string", - "description": "Pre-rendered form body with workflow variables substituted." - }, - "inputs": { - "type": "array", - "items": { - "type": "object", + "event": { + "title": "Event", + "type": "string" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "message_id": { + "format": "uuid", + "title": "Message Id", + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "title": "Mode", + "type": "string" + }, + "task_id": { + "format": "uuid", + "title": "Task Id", + "type": "string" + } + }, + "required": [ + "answer", + "created_at", + "event", + "id", + "message_id", + "metadata", + "mode", + "task_id" + ], + "title": "CompletionBlockingResponse", + "type": "object" + }, + "CompletionRequestPayload": { + "properties": { + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, "type": { - "type": "string", - "description": "Form input control type. Available values: `paragraph` (multi-line text input), `select` (single-choice from a list), `file` (single file upload), and `file-list` (multiple file uploads)." + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "output_variable_name": { - "type": "string", - "description": "Variable name used to reference this input's submitted value inside the workflow. Corresponds to the key in the submission `inputs` object." + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" }, - "default": { - "type": "object", - "nullable": true, - "description": "Default value resolved from the workflow context. `null` when no default is configured.", - "properties": { - "type": { - "type": "string", - "description": "Source of the default. `constant` means `value` is used as a literal string; `variable` means `selector` points to a workflow variable." - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Variable reference path (for example, `[\"node_id\", \"var_name\"]`) when `type` is `variable`. Must contain at least two elements." - }, - "value": { - "type": "string", - "description": "Literal default value when `type` is `constant`. Always a string." - } - } + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" } - } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" }, - "description": "Form input fields the recipient fills in." - }, - "actions": { - "type": "array", - "items": { - "type": "object", + { "properties": { - "id": { - "type": "string", - "maxLength": 20, - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Identifier of the action button. Pass as `action` on [Submit Human Input Form](/en/api-reference/human-input/submit-human-input-form) when the recipient selects this button." + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" }, - "title": { - "type": "string", - "maxLength": 100, - "description": "Button label shown to the recipient." + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" }, - "button_style": { - "type": "string", - "description": "Visual style of the button. Available values: `primary`, `default`, `accent`, `ghost`." + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" } - } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" }, - "description": "Available user actions (buttons) the recipient can select when submitting." - }, - "display_in_ui": { - "type": "boolean", - "description": "Whether the form is also shown in the Dify console UI." - }, - "form_token": { - "type": "string", - "nullable": true, - "description": "Access token for [Get Human Input Form](/en/api-reference/human-input/get-human-input-form) and [Submit Human Input Form](/en/api-reference/human-input/submit-human-input-form). `null` when the Human Input node uses Email or Console delivery (the Service API can only operate on web app-delivered forms)." - }, - "resolved_default_values": { - "type": "object", - "additionalProperties": { - "type": "string" + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" }, - "description": "Pre-filled default values for the form inputs, keyed by input `output_variable_name`. All values are stringified." - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp (seconds) after which the form can no longer be submitted." - } - } + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" } - } - } - ] - }, - "StreamEventWorkflowPaused": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" + ], + "default": null, + "description": "File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`.", + "title": "Files" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Persistent identifier for this workflow run record. Use this with [Get Workflow Run Detail](/en/api-reference/workflow-runs/get-workflow-run-detail) to retrieve results after execution." - }, - "paused_nodes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of paused node IDs." - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "description": "Partial outputs at pause time." - }, - "reasons": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "Reasons for pausing." - }, - "status": { - "type": "string", - "description": "Workflow execution status." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Creation timestamp." - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "Total elapsed time in seconds." - }, - "total_tokens": { - "type": "integer", - "description": "Total tokens consumed." - }, - "total_steps": { - "type": "integer", - "description": "Total steps executed." - } - } - } - } - } - ] - }, - "StreamEventHumanInputFormFilled": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "inputs": { + "additionalProperties": true, + "description": "Values for app-defined variables. Refer to the `user_input_form` field in the [Get App Parameters](/en/api-reference/applications/get-app-parameters) response to discover expected variable names and types.", + "title": "Inputs", + "type": "object" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "query": { + "default": "", + "description": "User input or prompt content.", + "title": "Query", + "type": "string" }, - { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "ID of the Human Input node whose form was filled." - }, - "node_title": { - "type": "string", - "description": "Display title of the Human Input node." - }, - "rendered_content": { - "type": "string", - "description": "Form body rendered with the recipient's submitted values (`form_content` on `human_input_required` is the unfilled template)." - }, - "action_id": { - "type": "string", - "description": "Identifier of the action the recipient selected (matches the `action` value passed to [Submit Human Input Form](/en/api-reference/human-input/submit-human-input-form))." - }, - "action_text": { - "type": "string", - "description": "Display text of the selected action." - }, - "submitted_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Values the recipient submitted, keyed by each form input's `output_variable_name`." - } - } + { + "type": "null" } - } + ], + "default": null, + "description": "Response mode. `streaming` uses Server-Sent Events; `blocking` returns after completion. When omitted, the request runs in blocking mode.", + "title": "Response Mode" } - ] + }, + "required": [ + "inputs" + ], + "title": "CompletionRequestPayload", + "type": "object" }, - "StreamEventHumanInputFormTimeout": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "Workflow execution run ID." - }, - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "ID of the Human Input node whose form expired." - }, - "node_title": { - "type": "string", - "description": "Display title of the Human Input node." - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp (seconds) when the form expired." - } - } + "CompletionRequestPayloadWithUser": { + "properties": { + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" } - } + ], + "default": null, + "description": "File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`.", + "title": "Files" + }, + "inputs": { + "additionalProperties": true, + "description": "Values for app-defined variables. Refer to the `user_input_form` field in the [Get App Parameters](/en/api-reference/applications/get-app-parameters) response to discover expected variable names and types.", + "title": "Inputs", + "type": "object" + }, + "query": { + "default": "", + "description": "User input or prompt content.", + "title": "Query", + "type": "string" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Response mode. `streaming` uses Server-Sent Events; `blocking` returns after completion. When omitted, the request runs in blocking mode.", + "title": "Response Mode" + }, + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" } - ] + }, + "required": [ + "inputs", + "user" + ], + "title": "CompletionRequestPayload", + "type": "object" + }, + "Condition": { + "description": "Condition detail", + "properties": { + "comparison_operator": { + "description": "Comparison to apply. String operators (`contains`, `not contains`, `start with`, `end with`, `is`, `is not`, `empty`, `not empty`, `in`, `not in`) act on string or array metadata; numeric operators (`=`, `≠`, `>`, `<`, `≥`, `≤`) act on numeric metadata; time operators (`before`, `after`) act on time metadata.", + "enum": [ + "<", + "=", + ">", + "after", + "before", + "contains", + "empty", + "end with", + "in", + "is", + "is not", + "not contains", + "not empty", + "not in", + "start with", + "≠", + "≤", + "≥" + ], + "title": "Comparison Operator", + "type": "string" + }, + "name": { + "description": "Metadata field name to compare against.", + "title": "Name", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Value to compare against. Type depends on `comparison_operator`: string for most string operators, array of strings for `in` and `not in`, number for numeric operators, and omit or use `null` for `empty` and `not empty`.", + "title": "Value" + } + }, + "required": [ + "comparison_operator", + "name" + ], + "title": "Condition", + "type": "object" + }, + "ConversationInfiniteScrollPagination": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/SimpleConversation" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "limit": { + "title": "Limit", + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit" + ], + "title": "ConversationInfiniteScrollPagination", + "type": "object" + }, + "ConversationListQuery": { + "properties": { + "last_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The ID of the last record on the current page. Used to fetch the next page.", + "title": "Last Id" + }, + "limit": { + "default": 20, + "description": "Number of records to return.", + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + }, + "sort_by": { + "default": "-updated_at", + "description": "Sorting field. Use the `-` prefix for descending order.", + "enum": [ + "-created_at", + "-updated_at", + "created_at", + "updated_at" + ], + "title": "Sort By", + "type": "string" + } + }, + "title": "ConversationListQuery", + "type": "object" }, - "StreamEventAgentLog": { - "allOf": [ + "ConversationRenamePayload": { + "anyOf": [ { - "$ref": "#/components/schemas/ChunkChatEvent" + "properties": { + "auto_generate": { + "description": "Automatically generate the conversation name. When `true`, the `name` field is ignored.", + "enum": [ + true + ], + "title": "Auto Generate", + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Conversation name. Required when `auto_generate` is `false`.", + "title": "Name" + } + }, + "required": [ + "auto_generate" + ], + "type": "object" }, { - "$ref": "#/components/schemas/StreamEventBase" + "properties": { + "auto_generate": { + "default": false, + "description": "Automatically generate the conversation name. When `true`, the `name` field is ignored.", + "enum": [ + false + ], + "title": "Auto Generate", + "type": "boolean" + }, + "name": { + "pattern": ".*\\S.*", + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + ], + "properties": { + "auto_generate": { + "default": false, + "description": "Automatically generate the conversation name. When `true`, the `name` field is ignored.", + "title": "Auto Generate", + "type": "boolean" }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Conversation name. Required when `auto_generate` is `false`.", + "title": "Name" + } + }, + "title": "ConversationRenamePayload", + "type": "object" + }, + "ConversationRenamePayloadWithUser": { + "anyOf": [ { - "type": "object", - "description": "Agent log from an agent node within the workflow.", "properties": { - "data": { - "type": "object", - "properties": { - "node_execution_id": { - "type": "string", - "description": "Node execution ID." - }, - "id": { - "type": "string", - "description": "Log entry ID." - }, - "label": { - "type": "string", - "description": "Log entry label." - }, - "parent_id": { - "type": "string", - "nullable": true, - "description": "Parent log entry ID for nested entries." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if applicable." - }, - "status": { - "type": "string", - "description": "Log entry status." - }, - "data": { - "type": "object", - "additionalProperties": true, - "description": "Log entry data." + "auto_generate": { + "description": "Automatically generate the conversation name. When `true`, the `name` field is ignored.", + "enum": [ + true + ], + "title": "Auto Generate", + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "Additional metadata." + { + "type": "null" + } + ], + "default": null, + "description": "Conversation name. Required when `auto_generate` is `false`.", + "title": "Name" + }, + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" + } + }, + "required": [ + "auto_generate" + ], + "type": "object" + }, + { + "properties": { + "auto_generate": { + "default": false, + "description": "Automatically generate the conversation name. When `true`, the `name` field is ignored.", + "enum": [ + false + ], + "title": "Auto Generate", + "type": "boolean" + }, + "name": { + "pattern": ".*\\S.*", + "title": "Name", + "type": "string" + }, + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + ], + "properties": { + "auto_generate": { + "default": false, + "description": "Automatically generate the conversation name. When `true`, the `name` field is ignored.", + "title": "Auto Generate", + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Conversation name. Required when `auto_generate` is `false`.", + "title": "Name" + }, + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" + } + }, + "title": "ConversationRenamePayload", + "type": "object" + }, + "ConversationVariableInfiniteScrollPaginationResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ConversationVariableResponse" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "limit": { + "title": "Limit", + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit" + ], + "title": "ConversationVariableInfiniteScrollPaginationResponse", + "type": "object" + }, + "ConversationVariableResponse": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Updated At" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Value" + }, + "value_type": { + "title": "Value Type", + "type": "string" + } + }, + "required": [ + "id", + "name", + "value_type" + ], + "title": "ConversationVariableResponse", + "type": "object" + }, + "ConversationVariableUpdatePayload": { + "properties": { + "value": { + "description": "The new value for the variable. Must match the variable's expected type.", + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "ConversationVariableUpdatePayload", + "type": "object" + }, + "ConversationVariableUpdatePayloadWithUser": { + "properties": { + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" + }, + "value": { + "description": "The new value for the variable. Must match the variable's expected type.", + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "ConversationVariableUpdatePayload", + "type": "object" + }, + "ConversationVariablesQuery": { + "properties": { + "last_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The ID of the last record on the current page. Used to fetch the next page.", + "title": "Last Id" + }, + "limit": { + "default": 20, + "description": "Number of records to return.", + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + }, + "variable_name": { + "anyOf": [ + { + "maxLength": 255, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Filter variables by a specific name.", + "title": "Variable Name" + } + }, + "title": "ConversationVariablesQuery", + "type": "object" + }, + "CustomConfigurationStatus": { + "description": "Enum class for custom configuration status.", + "enum": [ + "active", + "no-configure" + ], + "title": "CustomConfigurationStatus", + "type": "string" + }, + "DatasetBoundTagListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DatasetBoundTagResponse" + }, + "title": "Data", + "type": "array" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "data", + "total" + ], + "title": "DatasetBoundTagListResponse", + "type": "object" + }, + "DatasetBoundTagResponse": { + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "title": "DatasetBoundTagResponse", + "type": "object" + }, + "DatasetCreatePayload": { + "properties": { + "description": { + "default": "", + "description": "Description of the knowledge base.", + "maxLength": 400, + "title": "Description", + "type": "string" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Embedding model name. Use the `model` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "title": "Embedding Model" + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Embedding model provider. Use the `provider` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "title": "Embedding Model Provider" + }, + "external_knowledge_api_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ID of the external knowledge API.", + "title": "External Knowledge Api Id" + }, + "external_knowledge_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ID of the external knowledge base.", + "title": "External Knowledge Id" + }, + "indexing_technique": { + "anyOf": [ + { + "enum": [ + "economy", + "high_quality" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "`high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing.", + "title": "Indexing Technique" + }, + "name": { + "description": "Name of the knowledge base.", + "maxLength": 40, + "minLength": 1, + "title": "Name", + "type": "string" + }, + "permission": { + "anyOf": [ + { + "$ref": "#/components/schemas/PermissionEnum" + }, + { + "type": "null" + } + ], + "default": "only_me", + "description": "Controls who can access this knowledge base. `only_me` restricts access to the creator, `all_team_members` grants workspace-wide access, and `partial_members` grants access to specified members." + }, + "provider": { + "default": "vendor", + "description": "Knowledge base provider: `vendor` for internal knowledge bases, `external` for external ones.", + "enum": [ + "external", + "vendor" + ], + "title": "Provider", + "type": "string" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + }, + "summary_index_setting": { + "anyOf": [ + { + "properties": { + "enable": { + "description": "Whether to enable summary indexing.", + "type": "boolean" + }, + "model_name": { + "description": "Name of the model used for generating summaries.", + "type": "string" + }, + "model_provider_name": { + "description": "Provider of the summary generation model.", + "type": "string" + }, + "summary_prompt": { + "description": "Custom prompt template for summary generation.", + "type": "string" + } + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Summary index configuration.", + "title": "Summary Index Setting" + } + }, + "required": [ + "name" + ], + "title": "DatasetCreatePayload", + "type": "object" + }, + "DatasetDetailResponse": { + "properties": { + "app_count": { + "title": "App Count", + "type": "integer" + }, + "author_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Author Name" + }, + "built_in_field_enabled": { + "title": "Built In Field Enabled", + "type": "boolean" + }, + "chunk_structure": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Chunk Structure" + }, + "created_at": { + "title": "Created At", + "type": "integer" + }, + "created_by": { + "title": "Created By", + "type": "string" + }, + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Source Type" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "doc_form": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Doc Form" + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DatasetDocMetadataResponse" + }, + "title": "Doc Metadata", + "type": "array" + }, + "document_count": { + "title": "Document Count", + "type": "integer" + }, + "embedding_available": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Embedding Available" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Embedding Model" + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Embedding Model Provider" + }, + "enable_api": { + "title": "Enable Api", + "type": "boolean" + }, + "external_knowledge_info": { + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + }, + "external_retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/DatasetExternalRetrievalModelResponse" + }, + { + "type": "null" + } + ] + }, + "icon_info": { + "$ref": "#/components/schemas/DatasetIconInfoResponse" + }, + "id": { + "title": "Id", + "type": "string" + }, + "indexing_technique": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Indexing Technique" + }, + "is_multimodal": { + "title": "Is Multimodal", + "type": "boolean" + }, + "is_published": { + "title": "Is Published", + "type": "boolean" + }, + "maintainer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Maintainer" + }, + "name": { + "title": "Name", + "type": "string" + }, + "permission": { + "title": "Permission", + "type": "string" + }, + "permission_keys": { + "items": { + "type": "string" + }, + "title": "Permission Keys", + "type": "array" + }, + "pipeline_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Pipeline Id" + }, + "provider": { + "title": "Provider", + "type": "string" + }, + "retrieval_model_dict": { + "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + }, + "runtime_mode": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Runtime Mode" + }, + "summary_index_setting": { + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + }, + "tags": { + "items": { + "$ref": "#/components/schemas/DatasetTagResponse" + }, + "title": "Tags", + "type": "array" + }, + "total_available_documents": { + "title": "Total Available Documents", + "type": "integer" + }, + "total_documents": { + "title": "Total Documents", + "type": "integer" + }, + "updated_at": { + "title": "Updated At", + "type": "integer" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated By" + }, + "word_count": { + "title": "Word Count", + "type": "integer" + } + }, + "required": [ + "app_count", + "author_name", + "built_in_field_enabled", + "chunk_structure", + "created_at", + "created_by", + "data_source_type", + "description", + "doc_form", + "doc_metadata", + "document_count", + "embedding_model", + "embedding_model_provider", + "enable_api", + "external_retrieval_model", + "id", + "indexing_technique", + "is_multimodal", + "is_published", + "name", + "permission", + "pipeline_id", + "provider", + "retrieval_model_dict", + "runtime_mode", + "tags", + "total_available_documents", + "total_documents", + "updated_at", + "updated_by", + "word_count" + ], + "title": "DatasetDetailResponse", + "type": "object" + }, + "DatasetDetailWithPartialMembersResponse": { + "properties": { + "app_count": { + "title": "App Count", + "type": "integer" + }, + "author_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Author Name" + }, + "built_in_field_enabled": { + "title": "Built In Field Enabled", + "type": "boolean" + }, + "chunk_structure": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Chunk Structure" + }, + "created_at": { + "title": "Created At", + "type": "integer" + }, + "created_by": { + "title": "Created By", + "type": "string" + }, + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Data Source Type" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "doc_form": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Doc Form" + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DatasetDocMetadataResponse" + }, + "title": "Doc Metadata", + "type": "array" + }, + "document_count": { + "title": "Document Count", + "type": "integer" + }, + "embedding_available": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Embedding Available" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Embedding Model" + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Embedding Model Provider" + }, + "enable_api": { + "title": "Enable Api", + "type": "boolean" + }, + "external_knowledge_info": { + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + }, + "external_retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/DatasetExternalRetrievalModelResponse" + }, + { + "type": "null" + } + ] + }, + "icon_info": { + "$ref": "#/components/schemas/DatasetIconInfoResponse" + }, + "id": { + "title": "Id", + "type": "string" + }, + "indexing_technique": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Indexing Technique" + }, + "is_multimodal": { + "title": "Is Multimodal", + "type": "boolean" + }, + "is_published": { + "title": "Is Published", + "type": "boolean" + }, + "maintainer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Maintainer" + }, + "name": { + "title": "Name", + "type": "string" + }, + "partial_member_list": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Partial Member List" + }, + "permission": { + "title": "Permission", + "type": "string" + }, + "permission_keys": { + "items": { + "type": "string" + }, + "title": "Permission Keys", + "type": "array" + }, + "pipeline_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Pipeline Id" + }, + "provider": { + "title": "Provider", + "type": "string" + }, + "retrieval_model_dict": { + "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + }, + "runtime_mode": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Runtime Mode" + }, + "summary_index_setting": { + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + }, + "tags": { + "items": { + "$ref": "#/components/schemas/DatasetTagResponse" + }, + "title": "Tags", + "type": "array" + }, + "total_available_documents": { + "title": "Total Available Documents", + "type": "integer" + }, + "total_documents": { + "title": "Total Documents", + "type": "integer" + }, + "updated_at": { + "title": "Updated At", + "type": "integer" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated By" + }, + "word_count": { + "title": "Word Count", + "type": "integer" + } + }, + "required": [ + "app_count", + "author_name", + "built_in_field_enabled", + "chunk_structure", + "created_at", + "created_by", + "data_source_type", + "description", + "doc_form", + "doc_metadata", + "document_count", + "embedding_model", + "embedding_model_provider", + "enable_api", + "external_retrieval_model", + "id", + "indexing_technique", + "is_multimodal", + "is_published", + "name", + "permission", + "pipeline_id", + "provider", + "retrieval_model_dict", + "runtime_mode", + "tags", + "total_available_documents", + "total_documents", + "updated_at", + "updated_by", + "word_count" + ], + "title": "DatasetDetailWithPartialMembersResponse", + "type": "object" + }, + "DatasetDocMetadataResponse": { + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "title": "DatasetDocMetadataResponse", + "type": "object" + }, + "DatasetExternalKnowledgeInfoResponse": { + "properties": { + "external_knowledge_api_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "External Knowledge Api Endpoint" + }, + "external_knowledge_api_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "External Knowledge Api Id" + }, + "external_knowledge_api_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "External Knowledge Api Name" + }, + "external_knowledge_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "External Knowledge Id" + } + }, + "title": "DatasetExternalKnowledgeInfoResponse", + "type": "object" + }, + "DatasetExternalRetrievalModelResponse": { + "properties": { + "score_threshold": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Score Threshold" + }, + "score_threshold_enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Score Threshold Enabled" + }, + "top_k": { + "title": "Top K", + "type": "integer" + } + }, + "required": [ + "top_k" + ], + "title": "DatasetExternalRetrievalModelResponse", + "type": "object" + }, + "DatasetIconInfoResponse": { + "properties": { + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Icon" + }, + "icon_background": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Icon Background" + }, + "icon_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Icon Type" + }, + "icon_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Icon Url" + } + }, + "title": "DatasetIconInfoResponse", + "type": "object" + }, + "DatasetKeywordSettingResponse": { + "properties": { + "keyword_weight": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Keyword Weight" + } + }, + "title": "DatasetKeywordSettingResponse", + "type": "object" + }, + "DatasetListQuery": { + "properties": { + "include_all": { + "default": false, + "description": "Whether to include all knowledge bases regardless of permissions.", + "title": "Include All", + "type": "boolean" + }, + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Search keyword to filter by name.", + "title": "Keyword" + }, + "limit": { + "default": 20, + "description": "Number of items per page. Server caps at `100`.", + "title": "Limit", + "type": "integer" + }, + "page": { + "default": 1, + "description": "Page number to retrieve.", + "title": "Page", + "type": "integer" + }, + "tag_ids": { + "description": "Tag IDs to filter by.", + "items": { + "type": "string" + }, + "title": "Tag Ids", + "type": "array" + } + }, + "title": "DatasetListQuery", + "type": "object" + }, + "DatasetListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DatasetDetailResponse" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "page": { + "title": "Page", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "title": "DatasetListResponse", + "type": "object" + }, + "DatasetMetadataActionResponse": { + "properties": { + "result": { + "title": "Result", + "type": "string" + } + }, + "required": [ + "result" + ], + "title": "DatasetMetadataActionResponse", + "type": "object" + }, + "DatasetMetadataBuiltInFieldResponse": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "name", + "type" + ], + "title": "DatasetMetadataBuiltInFieldResponse", + "type": "object" + }, + "DatasetMetadataBuiltInFieldsResponse": { + "properties": { + "fields": { + "items": { + "$ref": "#/components/schemas/DatasetMetadataBuiltInFieldResponse" + }, + "title": "Fields", + "type": "array" + } + }, + "required": [ + "fields" + ], + "title": "DatasetMetadataBuiltInFieldsResponse", + "type": "object" + }, + "DatasetMetadataListItemResponse": { + "properties": { + "count": { + "default": 0, + "title": "Count", + "type": "integer" + }, + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "title": "DatasetMetadataListItemResponse", + "type": "object" + }, + "DatasetMetadataListResponse": { + "properties": { + "built_in_field_enabled": { + "title": "Built In Field Enabled", + "type": "boolean" + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DatasetMetadataListItemResponse" + }, + "title": "Doc Metadata", + "type": "array" + } + }, + "required": [ + "built_in_field_enabled", + "doc_metadata" + ], + "title": "DatasetMetadataListResponse", + "type": "object" + }, + "DatasetMetadataResponse": { + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "title": "DatasetMetadataResponse", + "type": "object" + }, + "DatasetRerankingModelResponse": { + "properties": { + "reranking_model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Reranking Model Name" + }, + "reranking_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Reranking Provider Name" + } + }, + "title": "DatasetRerankingModelResponse", + "type": "object" + }, + "DatasetRetrievalModelResponse": { + "properties": { + "reranking_enable": { + "title": "Reranking Enable", + "type": "boolean" + }, + "reranking_mode": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Reranking Mode" + }, + "reranking_model": { + "$ref": "#/components/schemas/DatasetRerankingModelResponse" + }, + "score_threshold": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Score Threshold" + }, + "score_threshold_enabled": { + "title": "Score Threshold Enabled", + "type": "boolean" + }, + "search_method": { + "title": "Search Method", + "type": "string" + }, + "top_k": { + "title": "Top K", + "type": "integer" + }, + "weights": { + "anyOf": [ + { + "$ref": "#/components/schemas/DatasetWeightedScoreResponse" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "reranking_enable", + "score_threshold_enabled", + "search_method", + "top_k" + ], + "title": "DatasetRetrievalModelResponse", + "type": "object" + }, + "DatasetSummaryIndexSettingResponse": { + "properties": { + "enable": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Enable" + }, + "model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Model Name" + }, + "model_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Model Provider Name" + }, + "summary_prompt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Summary Prompt" + } + }, + "title": "DatasetSummaryIndexSettingResponse", + "type": "object" + }, + "DatasetTagResponse": { + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "title": "DatasetTagResponse", + "type": "object" + }, + "DatasetUpdatePayload": { + "properties": { + "description": { + "anyOf": [ + { + "maxLength": 400, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Description of the knowledge base.", + "title": "Description" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Embedding model name. Use the `model` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "title": "Embedding Model" + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Embedding model provider. Use the `provider` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "title": "Embedding Model Provider" + }, + "external_knowledge_api_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ID of the external knowledge API.", + "title": "External Knowledge Api Id" + }, + "external_knowledge_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ID of the external knowledge base.", + "title": "External Knowledge Id" + }, + "external_retrieval_model": { + "anyOf": [ + { + "properties": { + "score_threshold": { + "description": "Minimum similarity score threshold for filtering results.", + "type": "number" + }, + "score_threshold_enabled": { + "description": "Whether score threshold filtering is enabled.", + "type": "boolean" + }, + "top_k": { + "description": "Maximum number of results to return.", + "type": "integer" + } + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Retrieval settings for external knowledge bases.", + "title": "External Retrieval Model" + }, + "indexing_technique": { + "anyOf": [ + { + "enum": [ + "economy", + "high_quality" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "`high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing.", + "title": "Indexing Technique" + }, + "name": { + "anyOf": [ + { + "maxLength": 40, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Name of the knowledge base.", + "title": "Name" + }, + "partial_member_list": { + "anyOf": [ + { + "items": { + "properties": { + "user_id": { + "description": "ID of the team member to grant access.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "List of team members with access when `permission` is `partial_members`.", + "title": "Partial Member List" + }, + "permission": { + "anyOf": [ + { + "$ref": "#/components/schemas/PermissionEnum" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Controls who can access this knowledge base. `only_me` restricts access to the creator, `all_team_members` grants workspace-wide access, and `partial_members` grants access to specified members." + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + } + }, + "title": "DatasetUpdatePayload", + "type": "object" + }, + "DatasetVectorSettingResponse": { + "properties": { + "embedding_model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Embedding Model Name" + }, + "embedding_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Embedding Provider Name" + }, + "vector_weight": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Vector Weight" + } + }, + "title": "DatasetVectorSettingResponse", + "type": "object" + }, + "DatasetWeightedScoreResponse": { + "properties": { + "keyword_setting": { + "$ref": "#/components/schemas/DatasetKeywordSettingResponse" + }, + "vector_setting": { + "$ref": "#/components/schemas/DatasetVectorSettingResponse" + }, + "weight_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Weight Type" + } + }, + "title": "DatasetWeightedScoreResponse", + "type": "object" + }, + "DatasourceCredentialInfoResponse": { + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Id" + }, + "is_default": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Is Default" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Type" + } + }, + "title": "DatasourceCredentialInfoResponse", + "type": "object" + }, + "DatasourceNodeRunPayload": { + "properties": { + "credential_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Datasource credential ID. Uses the default if omitted.", + "title": "Credential Id" + }, + "datasource_type": { + "description": "Type of the datasource.", + "enum": [ + "local_file", + "online_document", + "online_drive", + "website_crawl" + ], + "title": "Datasource Type", + "type": "string" + }, + "inputs": { + "additionalProperties": true, + "description": "Input variables for the datasource node.", + "title": "Inputs", + "type": "object" + }, + "is_published": { + "description": "Whether to run the published or draft version of the node. `true` runs the published version, `false` runs the draft.", + "title": "Is Published", + "type": "boolean" + } + }, + "required": [ + "datasource_type", + "inputs", + "is_published" + ], + "title": "DatasourceNodeRunPayload", + "type": "object" + }, + "DatasourcePluginListResponse": { + "items": { + "$ref": "#/components/schemas/DatasourcePluginResponse" + }, + "title": "DatasourcePluginListResponse", + "type": "array" + }, + "DatasourcePluginResponse": { + "properties": { + "credentials": { + "items": { + "$ref": "#/components/schemas/DatasourceCredentialInfoResponse" + }, + "title": "Credentials", + "type": "array" + }, + "datasource_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Datasource Type" + }, + "node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Node Id" + }, + "plugin_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Plugin Id" + }, + "provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Provider Name" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Title" + }, + "user_input_variables": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "User Input Variables", + "type": "array" + } + }, + "title": "DatasourcePluginResponse", + "type": "object" + }, + "DatasourcePluginsQuery": { + "properties": { + "is_published": { + "default": true, + "description": "Whether to retrieve nodes from the published or draft pipeline. `true` returns nodes from the published version, `false` returns nodes from the draft.", + "title": "Is Published", + "type": "boolean" + } + }, + "title": "DatasourcePluginsQuery", + "type": "object" + }, + "DocumentAndBatchResponse": { + "properties": { + "batch": { + "title": "Batch", + "type": "string" + }, + "document": { + "$ref": "#/components/schemas/DocumentResponse" + } + }, + "required": [ + "batch", + "document" + ], + "title": "DocumentAndBatchResponse", + "type": "object" + }, + "DocumentBatchDownloadZipPayload": { + "description": "Request payload for bulk downloading documents as a zip archive.", + "properties": { + "document_ids": { + "description": "List of document IDs to include in the ZIP download.", + "items": { + "format": "uuid", + "type": "string" + }, + "maxItems": 100, + "minItems": 1, + "title": "Document Ids", + "type": "array" + } + }, + "required": [ + "document_ids" + ], + "title": "DocumentBatchDownloadZipPayload", + "type": "object" + }, + "DocumentDetailResponse": { + "properties": { + "archived": { + "default": null, + "title": "Archived", + "type": "boolean" + }, + "average_segment_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "number" + } + ], + "default": null, + "title": "Average Segment Length" + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Completed At" + }, + "created_at": { + "default": null, + "title": "Created At", + "type": "integer" + }, + "created_by": { + "default": null, + "title": "Created By", + "type": "string" + }, + "created_from": { + "default": null, + "title": "Created From", + "type": "string" + }, + "data_source_info": { + "additionalProperties": true, + "default": null, + "title": "Data Source Info", + "type": "object" + }, + "data_source_type": { + "default": null, + "title": "Data Source Type", + "type": "string" + }, + "dataset_process_rule": { + "additionalProperties": true, + "default": null, + "title": "Dataset Process Rule", + "type": "object" + }, + "dataset_process_rule_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Dataset Process Rule Id" + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Disabled At" + }, + "disabled_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Disabled By" + }, + "display_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Display Status" + }, + "doc_form": { + "default": null, + "title": "Doc Form", + "type": "string" + }, + "doc_language": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Doc Language" + }, + "doc_metadata": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/DocumentMetadataResponse" + }, + "type": "array" + }, + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Doc Metadata" + }, + "doc_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Doc Type" + }, + "document_process_rule": { + "additionalProperties": true, + "default": null, + "title": "Document Process Rule", + "type": "object" + }, + "enabled": { + "default": null, + "title": "Enabled", + "type": "boolean" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Error" + }, + "hit_count": { + "default": null, + "title": "Hit Count", + "type": "integer" + }, + "id": { + "title": "Id", + "type": "string" + }, + "indexing_latency": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Indexing Latency" + }, + "indexing_status": { + "default": null, + "title": "Indexing Status", + "type": "string" + }, + "name": { + "default": null, + "title": "Name", + "type": "string" + }, + "need_summary": { + "default": null, + "title": "Need Summary", + "type": "boolean" + }, + "position": { + "default": null, + "title": "Position", + "type": "integer" + }, + "segment_count": { + "default": null, + "title": "Segment Count", + "type": "integer" + }, + "summary_index_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Summary Index Status" + }, + "tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tokens" + }, + "updated_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Updated At" + } + }, + "required": [ + "id" + ], + "title": "DocumentDetailResponse", + "type": "object" + }, + "DocumentGetQuery": { + "properties": { + "metadata": { + "default": "all", + "description": "`all` returns all fields including metadata. `only` returns only `id`, `doc_type`, and `doc_metadata`. `without` returns all fields except `doc_metadata`.", + "enum": [ + "all", + "only", + "without" + ], + "title": "Metadata", + "type": "string" + } + }, + "title": "DocumentGetQuery", + "type": "object" + }, + "DocumentListQuery": { + "properties": { + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Search keyword to filter by document name.", + "title": "Keyword" + }, + "limit": { + "default": 20, + "description": "Number of items per page. Server caps at `100`.", + "title": "Limit", + "type": "integer" + }, + "page": { + "default": 1, + "description": "Page number to retrieve.", + "title": "Page", + "type": "integer" + }, + "status": { + "anyOf": [ + { + "enum": [ + "archived", + "available", + "disabled", + "error", + "indexing", + "paused", + "queuing" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Filter by display status.", + "title": "Status" + } + }, + "title": "DocumentListQuery", + "type": "object" + }, + "DocumentListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DocumentResponse" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "page": { + "title": "Page", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "title": "DocumentListResponse", + "type": "object" + }, + "DocumentMetadataOperation": { + "properties": { + "document_id": { + "description": "Document ID whose metadata should be updated.", + "format": "uuid", + "title": "Document Id", + "type": "string" + }, + "metadata_list": { + "description": "Metadata fields to update.", + "items": { + "$ref": "#/components/schemas/MetadataDetail" + }, + "title": "Metadata List", + "type": "array" + }, + "partial_update": { + "default": false, + "description": "Whether to partially update metadata, keeping existing values for unspecified fields.", + "title": "Partial Update", + "type": "boolean" + } + }, + "required": [ + "document_id", + "metadata_list" + ], + "title": "DocumentMetadataOperation", + "type": "object" + }, + "DocumentMetadataResponse": { + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Value" + } + }, + "required": [ + "id", + "name", + "type" + ], + "title": "DocumentMetadataResponse", + "type": "object" + }, + "DocumentResponse": { + "properties": { + "archived": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Archived" + }, + "created_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created By" + }, + "created_from": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created From" + }, + "data_source_detail_dict": { + "additionalProperties": true, + "title": "Data Source Detail Dict", + "type": "object" + }, + "data_source_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Source Info" + }, + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Source Type" + }, + "dataset_process_rule_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Dataset Process Rule Id" + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Disabled At" + }, + "disabled_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Disabled By" + }, + "display_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Display Status" + }, + "doc_form": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Doc Form" + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DocumentMetadataResponse" + }, + "title": "Doc Metadata", + "type": "array" + }, + "enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Enabled" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Error" + }, + "hit_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Hit Count" + }, + "id": { + "title": "Id", + "type": "string" + }, + "indexing_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Indexing Status" + }, + "name": { + "title": "Name", + "type": "string" + }, + "need_summary": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Need Summary" + }, + "position": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Position" + }, + "summary_index_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Summary Index Status" + }, + "tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tokens" + }, + "word_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Word Count" + } + }, + "required": [ + "data_source_detail_dict", + "id", + "name" + ], + "title": "DocumentResponse", + "type": "object" + }, + "DocumentStatusListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DocumentStatusResponse" + }, + "title": "Data", + "type": "array" + } + }, + "required": [ + "data" + ], + "title": "DocumentStatusListResponse", + "type": "object" + }, + "DocumentStatusPayload": { + "properties": { + "document_ids": { + "description": "List of document IDs to update.", + "items": { + "type": "string" + }, + "title": "Document Ids", + "type": "array" + } + }, + "title": "DocumentStatusPayload", + "type": "object" + }, + "DocumentStatusResponse": { + "properties": { + "cleaning_completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Cleaning Completed At" + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Completed At" + }, + "completed_segments": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Completed Segments" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" + }, + "error_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Error Code" + }, + "estimated_vector_space_mb": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Estimated Vector Space Mb" + }, + "id": { + "title": "Id", + "type": "string" + }, + "indexing_status": { + "title": "Indexing Status", + "type": "string" + }, + "parsing_completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Parsing Completed At" + }, + "paused_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Paused At" + }, + "processing_started_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Processing Started At" + }, + "splitting_completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Splitting Completed At" + }, + "stopped_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Stopped At" + }, + "total_segments": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Total Segments" + }, + "vector_space_limit_mb": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Vector Space Limit Mb" + } + }, + "required": [ + "cleaning_completed_at", + "completed_at", + "error", + "id", + "indexing_status", + "parsing_completed_at", + "paused_at", + "processing_started_at", + "splitting_completed_at", + "stopped_at" + ], + "title": "DocumentStatusResponse", + "type": "object" + }, + "DocumentTextCreatePayload": { + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` for standard text chunking, `hierarchical_model` for parent-child chunk structure, `qa_model` for question-answer pair extraction.", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "title": "Doc Form", + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "Language of the document for processing optimization.", + "title": "Doc Language", + "type": "string" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Embedding model name. Use the `model` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "title": "Embedding Model" + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Embedding model provider. Use the `provider` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "title": "Embedding Model Provider" + }, + "indexing_technique": { + "anyOf": [ + { + "enum": [ + "economy", + "high_quality" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "`high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing. Required when adding the first document to a knowledge base; subsequent documents inherit the knowledge base's indexing technique if omitted.", + "title": "Indexing Technique" + }, + "name": { + "description": "Document name.", + "title": "Name", + "type": "string" + }, + "original_document_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Original document ID for replacement.", + "title": "Original Document Id" + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Processing rules for chunking." + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + }, + "text": { + "description": "Document text content.", + "title": "Text", + "type": "string" + } + }, + "required": [ + "name", + "text" + ], + "title": "DocumentTextCreatePayload", + "type": "object" + }, + "DocumentTextUpdate": { + "anyOf": [ + { + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` for standard text chunking, `hierarchical_model` for parent-child chunk structure, `qa_model` for question-answer pair extraction.", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "title": "Doc Form", + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "Language of the document for processing optimization.", + "title": "Doc Language", + "type": "string" + }, + "name": { + "default": null, + "description": "Document name. Required when `text` is provided.", + "title": "Name", + "type": "string" + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Processing rules for chunking." + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + }, + "text": { + "default": null, + "description": "Document text content.", + "title": "Text", + "type": "string" + } + }, + "required": [ + "name", + "text" + ], + "type": "object" + }, + { + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` for standard text chunking, `hierarchical_model` for parent-child chunk structure, `qa_model` for question-answer pair extraction.", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "title": "Doc Form", + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "Language of the document for processing optimization.", + "title": "Doc Language", + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Document name. Required when `text` is provided.", + "title": "Name" + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Processing rules for chunking." + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + }, + "text": { + "description": "Document text content.", + "type": "null" + } + }, + "type": "object" + } + ], + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` for standard text chunking, `hierarchical_model` for parent-child chunk structure, `qa_model` for question-answer pair extraction.", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "title": "Doc Form", + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "Language of the document for processing optimization.", + "title": "Doc Language", + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Document name. Required when `text` is provided.", + "title": "Name" + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Processing rules for chunking." + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + }, + "text": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Document text content.", + "title": "Text" + } + }, + "title": "DocumentTextUpdate", + "type": "object" + }, + "EventStreamResponse": { + "title": "EventStreamResponse", + "type": "string" + }, + "ExecutionContentType": { + "enum": [ + "human_input" + ], + "title": "ExecutionContentType", + "type": "string" + }, + "FeedbackListQuery": { + "properties": { + "limit": { + "default": 20, + "description": "Number of records per page.", + "maximum": 101, + "minimum": 1, + "title": "Limit", + "type": "integer" + }, + "page": { + "default": 1, + "description": "Page number for pagination.", + "minimum": 1, + "title": "Page", + "type": "integer" + } + }, + "title": "FeedbackListQuery", + "type": "object" + }, + "FetchFrom": { + "description": "Enum class for fetch from.", + "enum": [ + "customizable-model", + "predefined-model" + ], + "title": "FetchFrom", + "type": "string" + }, + "FileInputConfig": { + "properties": { + "allowed_file_extensions": { + "items": { + "type": "string" + }, + "title": "Allowed File Extensions", + "type": "array" + }, + "allowed_file_types": { + "items": { + "$ref": "#/components/schemas/FileType" + }, + "title": "Allowed File Types", + "type": "array" + }, + "allowed_file_upload_methods": { + "items": { + "$ref": "#/components/schemas/FileTransferMethod" + }, + "title": "Allowed File Upload Methods", + "type": "array" + }, + "output_variable_name": { + "title": "Output Variable Name", + "type": "string" + }, + "type": { + "const": "file", + "default": "file", + "title": "Type", + "type": "string" + } + }, + "required": [ + "output_variable_name" + ], + "title": "FileInputConfig", + "type": "object" + }, + "FileListInputConfig": { + "properties": { + "allowed_file_extensions": { + "items": { + "type": "string" + }, + "title": "Allowed File Extensions", + "type": "array" + }, + "allowed_file_types": { + "items": { + "$ref": "#/components/schemas/FileType" + }, + "title": "Allowed File Types", + "type": "array" + }, + "allowed_file_upload_methods": { + "items": { + "$ref": "#/components/schemas/FileTransferMethod" + }, + "title": "Allowed File Upload Methods", + "type": "array" + }, + "number_limits": { + "default": 0, + "minimum": 0, + "title": "Number Limits", + "type": "integer" + }, + "output_variable_name": { + "title": "Output Variable Name", + "type": "string" + }, + "type": { + "const": "file-list", + "default": "file-list", + "title": "Type", + "type": "string" + } + }, + "required": [ + "output_variable_name" + ], + "title": "FileListInputConfig", + "type": "object" + }, + "FilePreviewQuery": { + "properties": { + "as_attachment": { + "default": false, + "description": "If `true`, forces the file to download as an attachment instead of previewing in browser.", + "title": "As Attachment", + "type": "boolean" + } + }, + "title": "FilePreviewQuery", + "type": "object" + }, + "FileResponse": { + "properties": { + "conversation_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Conversation Id" + }, + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" + }, + "created_by": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created By" + }, + "extension": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Extension" + }, + "file_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "File Key" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "mime_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Mime Type" + }, + "name": { + "title": "Name", + "type": "string" + }, + "original_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Original Url" + }, + "preview_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Preview Url" + }, + "reference": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Reference" + }, + "size": { + "title": "Size", + "type": "integer" + }, + "source_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Source Url" + }, + "tenant_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tenant Id" + }, + "user_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "User Id" + } + }, + "required": [ + "id", + "name", + "size" + ], + "title": "FileResponse", + "type": "object" + }, + "FileTransferMethod": { + "enum": [ + "datasource_file", + "local_file", + "remote_url", + "tool_file" + ], + "title": "FileTransferMethod", + "type": "string" + }, + "FileType": { + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "title": "FileType", + "type": "string" + }, + "FormInputConfig": { + "discriminator": { + "mapping": { + "file": "#/components/schemas/FileInputConfig", + "file-list": "#/components/schemas/FileListInputConfig", + "paragraph": "#/components/schemas/ParagraphInputConfig", + "select": "#/components/schemas/SelectInputConfig" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ParagraphInputConfig" + }, + { + "$ref": "#/components/schemas/SelectInputConfig" + }, + { + "$ref": "#/components/schemas/FileInputConfig" + }, + { + "$ref": "#/components/schemas/FileListInputConfig" + } + ] + }, + "HitTestingChildChunk": { + "properties": { + "content": { + "title": "Content", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "position": { + "title": "Position", + "type": "integer" + }, + "score": { + "title": "Score", + "type": "number" + } + }, + "required": [ + "content", + "id", + "position", + "score" + ], + "title": "HitTestingChildChunk", + "type": "object" + }, + "HitTestingDocument": { + "properties": { + "data_source_type": { + "title": "Data Source Type", + "type": "string" + }, + "doc_metadata": { + "anyOf": [ + {}, + { + "type": "null" + } + ], + "title": "Doc Metadata" + }, + "doc_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Doc Type" + }, + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "data_source_type", + "doc_metadata", + "doc_type", + "id", + "name" + ], + "title": "HitTestingDocument", + "type": "object" + }, + "HitTestingFile": { + "properties": { + "extension": { + "title": "Extension", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "mime_type": { + "title": "Mime Type", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "size": { + "title": "Size", + "type": "integer" + }, + "source_url": { + "title": "Source Url", + "type": "string" + } + }, + "required": [ + "extension", + "id", + "mime_type", + "name", + "size", + "source_url" + ], + "title": "HitTestingFile", + "type": "object" + }, + "HitTestingPayload": { + "properties": { + "attachment_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "List of attachment IDs to include in the retrieval context.", + "title": "Attachment Ids" + }, + "external_retrieval_model": { + "anyOf": [ + { + "properties": { + "score_threshold": { + "description": "Minimum similarity score threshold for filtering results.", + "type": "number" + }, + "score_threshold_enabled": { + "description": "Whether score threshold filtering is enabled.", + "type": "boolean" + }, + "top_k": { + "description": "Maximum number of results to return.", + "type": "integer" + } + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Retrieval settings for external knowledge bases.", + "title": "External Retrieval Model" + }, + "query": { + "description": "Search query text.", + "maxLength": 250, + "title": "Query", + "type": "string" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + } + }, + "required": [ + "query" + ], + "title": "HitTestingPayload", + "type": "object" + }, + "HitTestingQuery": { + "properties": { + "content": { + "title": "Content", + "type": "string" + } + }, + "required": [ + "content" + ], + "title": "HitTestingQuery", + "type": "object" + }, + "HitTestingRecord": { + "properties": { + "child_chunks": { + "items": { + "$ref": "#/components/schemas/HitTestingChildChunk" + }, + "title": "Child Chunks", + "type": "array" + }, + "files": { + "items": { + "$ref": "#/components/schemas/HitTestingFile" + }, + "title": "Files", + "type": "array" + }, + "score": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Score" + }, + "segment": { + "$ref": "#/components/schemas/HitTestingSegment" + }, + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Summary" + }, + "tsne_position": { + "anyOf": [ + {}, + { + "type": "null" + } + ], + "title": "Tsne Position" + } + }, + "required": [ + "child_chunks", + "files", + "score", + "segment", + "summary", + "tsne_position" + ], + "title": "HitTestingRecord", + "type": "object" + }, + "HitTestingResponse": { + "properties": { + "query": { + "$ref": "#/components/schemas/HitTestingQuery" + }, + "records": { + "items": { + "$ref": "#/components/schemas/HitTestingRecord" + }, + "title": "Records", + "type": "array" + } + }, + "required": [ + "query", + "records" + ], + "title": "HitTestingResponse", + "type": "object" + }, + "HitTestingSegment": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Answer" + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Completed At" + }, + "content": { + "title": "Content", + "type": "string" + }, + "created_at": { + "title": "Created At", + "type": "integer" + }, + "created_by": { + "title": "Created By", + "type": "string" + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Disabled At" + }, + "disabled_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Disabled By" + }, + "document": { + "$ref": "#/components/schemas/HitTestingDocument" + }, + "document_id": { + "title": "Document Id", + "type": "string" + }, + "enabled": { + "title": "Enabled", + "type": "boolean" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" + }, + "hit_count": { + "title": "Hit Count", + "type": "integer" + }, + "id": { + "title": "Id", + "type": "string" + }, + "index_node_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Index Node Hash" + }, + "index_node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Index Node Id" + }, + "indexing_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Indexing At" + }, + "keywords": { + "items": { + "type": "string" + }, + "title": "Keywords", + "type": "array" + }, + "position": { + "title": "Position", + "type": "integer" + }, + "sign_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Sign Content" + }, + "status": { + "title": "Status", + "type": "string" + }, + "stopped_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Stopped At" + }, + "tokens": { + "title": "Tokens", + "type": "integer" + }, + "word_count": { + "title": "Word Count", + "type": "integer" + } + }, + "required": [ + "answer", + "completed_at", + "content", + "created_at", + "created_by", + "disabled_at", + "disabled_by", + "document", + "document_id", + "enabled", + "error", + "hit_count", + "id", + "index_node_hash", + "index_node_id", + "indexing_at", + "keywords", + "position", + "sign_content", + "status", + "stopped_at", + "tokens", + "word_count" + ], + "title": "HitTestingSegment", + "type": "object" + }, + "HumanInputFormDefinitionResponse": { + "properties": { + "expiration_time": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Expiration Time" + }, + "form_content": { + "title": "Form Content", + "type": "string" + }, + "inputs": { + "items": { + "$ref": "#/components/schemas/FormInputConfig" + }, + "title": "Inputs", + "type": "array" + }, + "resolved_default_values": { + "additionalProperties": { + "type": "string" + }, + "title": "Resolved Default Values", + "type": "object" + }, + "user_actions": { + "items": { + "$ref": "#/components/schemas/UserActionConfig" + }, + "title": "User Actions", + "type": "array" + } + }, + "required": [ + "form_content", + "inputs", + "resolved_default_values", + "user_actions" + ], + "title": "HumanInputFormDefinitionResponse", + "type": "object" + }, + "HumanInputFormSubmitPayload": { + "properties": { + "action": { + "description": "ID of the action button the recipient selected. Must match one of the `id` values from the form's `user_actions` list.", + "title": "Action", + "type": "string" + }, + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + }, + "description": "Submitted human input values keyed by output variable name. Use a string for paragraph or select input values, a file mapping for file inputs, and a list of file mappings for file-list inputs. Local file mappings use `transfer_method=local_file` with `upload_file_id`; remote file mappings use `transfer_method=remote_url` with `url` or `remote_url`.", + "examples": [ + { + "attachment": { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "4e0d1b87-52f2-49f6-b8c6-95cd9c954b3e" + }, + "attachments": [ + { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee" + }, + { + "transfer_method": "remote_url", + "type": "document", + "url": "https://example.com/report.pdf" + } + ], + "decision": "approve" + } + ], + "title": "Inputs", + "type": "object" + } + }, + "required": [ + "action", + "inputs" + ], + "title": "HumanInputFormSubmitPayload", + "type": "object" + }, + "HumanInputFormSubmitPayloadWithUser": { + "properties": { + "action": { + "description": "ID of the action button the recipient selected. Must match one of the `id` values from the form's `user_actions` list.", + "title": "Action", + "type": "string" + }, + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + }, + "description": "Submitted human input values keyed by output variable name. Use a string for paragraph or select input values, a file mapping for file inputs, and a list of file mappings for file-list inputs. Local file mappings use `transfer_method=local_file` with `upload_file_id`; remote file mappings use `transfer_method=remote_url` with `url` or `remote_url`.", + "examples": [ + { + "attachment": { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "4e0d1b87-52f2-49f6-b8c6-95cd9c954b3e" + }, + "attachments": [ + { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee" + }, + { + "transfer_method": "remote_url", + "type": "document", + "url": "https://example.com/report.pdf" + } + ], + "decision": "approve" + } + ], + "title": "Inputs", + "type": "object" + }, + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" + } + }, + "required": [ + "action", + "inputs", + "user" + ], + "title": "HumanInputFormSubmitPayload", + "type": "object" + }, + "HumanInputFormSubmitResponse": { + "additionalProperties": false, + "properties": {}, + "title": "HumanInputFormSubmitResponse", + "type": "object" + }, + "I18nObject": { + "description": "Model class for i18n object.", + "properties": { + "en_US": { + "title": "En Us", + "type": "string" + }, + "zh_Hans": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Zh Hans" + } + }, + "required": [ + "en_US" + ], + "title": "I18nObject", + "type": "object" + }, + "IndexInfoResponse": { + "properties": { + "api_version": { + "title": "Api Version", + "type": "string" + }, + "server_version": { + "title": "Server Version", + "type": "string" + }, + "welcome": { + "title": "Welcome", + "type": "string" + } + }, + "required": [ + "api_version", + "server_version", + "welcome" + ], + "title": "IndexInfoResponse", + "type": "object" + }, + "JSONObject": { + "additionalProperties": true, + "type": "object" + }, + "JSONValue": {}, + "JSONValueType": {}, + "JsonValue": {}, + "KnowledgeTagListResponse": { + "items": { + "$ref": "#/components/schemas/KnowledgeTagResponse" + }, + "title": "KnowledgeTagListResponse", + "type": "array" + }, + "KnowledgeTagResponse": { + "properties": { + "binding_count": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Binding Count" + }, + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "title": "KnowledgeTagResponse", + "type": "object" + }, + "MessageFeedbackPayload": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Optional text feedback providing additional detail.", + "title": "Content" + }, + "rating": { + "anyOf": [ + { + "enum": [ + "dislike", + "like" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Feedback rating. Set to `null` to revoke previously submitted feedback.", + "title": "Rating" + } + }, + "title": "MessageFeedbackPayload", + "type": "object" + }, + "MessageFeedbackPayloadWithUser": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Optional text feedback providing additional detail.", + "title": "Content" + }, + "rating": { + "anyOf": [ + { + "enum": [ + "dislike", + "like" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Feedback rating. Set to `null` to revoke previously submitted feedback.", + "title": "Rating" + }, + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" + } + }, + "required": [ + "user" + ], + "title": "MessageFeedbackPayload", + "type": "object" + }, + "MessageFile": { + "properties": { + "belongs_to": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Belongs To" + }, + "filename": { + "title": "Filename", + "type": "string" + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "mime_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Mime Type" + }, + "size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Size" + }, + "transfer_method": { + "title": "Transfer Method", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + }, + "upload_file_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Upload File Id" + }, + "url": { + "anyOf": [ + { + "format": "url", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Url" + } + }, + "required": [ + "filename", + "id", + "transfer_method", + "type" + ], + "title": "MessageFile", + "type": "object" + }, + "MessageInfiniteScrollPagination": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/MessageListItem" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "limit": { + "title": "Limit", + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit" + ], + "title": "MessageInfiniteScrollPagination", + "type": "object" + }, + "MessageListItem": { + "properties": { + "agent_thoughts": { + "items": { + "$ref": "#/components/schemas/AgentThought" + }, + "title": "Agent Thoughts", + "type": "array" + }, + "answer": { + "title": "Answer", + "type": "string" + }, + "answer_tokens": { + "default": 0, + "title": "Answer Tokens", + "type": "integer" + }, + "conversation_id": { + "format": "uuid", + "title": "Conversation Id", + "type": "string" + }, + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" + }, + "currency": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Currency" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Error" + }, + "extra_contents": { + "items": { + "$ref": "#/components/schemas/HumanInputContent" + }, + "title": "Extra Contents", + "type": "array" + }, + "feedback": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleFeedback" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JSONValueType" + }, + "title": "Inputs", + "type": "object" + }, + "message_files": { + "items": { + "$ref": "#/components/schemas/MessageFile" + }, + "title": "Message Files", + "type": "array" + }, + "message_tokens": { + "default": 0, + "title": "Message Tokens", + "type": "integer" + }, + "parent_message_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Parent Message Id" + }, + "provider_response_latency": { + "default": 0, + "format": "float", + "title": "Provider Response Latency", + "type": "number" + }, + "query": { + "title": "Query", + "type": "string" + }, + "retriever_resources": { + "items": { + "$ref": "#/components/schemas/RetrieverResource" + }, + "title": "Retriever Resources", + "type": "array" + }, + "status": { + "title": "Status", + "type": "string" + }, + "total_price": { + "anyOf": [ + { + "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Total Price" + }, + "total_tokens": { + "readOnly": true, + "title": "Total Tokens", + "type": "integer" + } + }, + "required": [ + "agent_thoughts", + "answer", + "conversation_id", + "extra_contents", + "id", + "inputs", + "message_files", + "query", + "retriever_resources", + "status", + "total_tokens" + ], + "title": "MessageListItem", + "type": "object" + }, + "MessageListQuery": { + "properties": { + "conversation_id": { + "description": "Conversation ID.", + "title": "Conversation Id", + "type": "string" + }, + "first_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The ID of the first chat record on the current page. Omit this value to fetch the latest messages; for subsequent pages, use the first message ID from the current list to fetch older messages.", + "title": "First Id" + }, + "limit": { + "default": 20, + "description": "Number of chat history messages to return per request.", + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + "required": [ + "conversation_id" + ], + "title": "MessageListQuery", + "type": "object" + }, + "MetadataArgs": { + "properties": { + "name": { + "description": "Metadata field name.", + "title": "Name", + "type": "string" + }, + "type": { + "description": "`string` for text values, `number` for numeric values, `time` for date/time values.", + "enum": [ + "number", + "string", + "time" + ], + "title": "Type", + "type": "string" + } + }, + "required": [ + "name", + "type" + ], + "title": "MetadataArgs", + "type": "object" + }, + "MetadataDetail": { + "properties": { + "id": { + "description": "Metadata field ID.", + "format": "uuid", + "title": "Id", + "type": "string" + }, + "name": { + "description": "Metadata field name.", + "title": "Name", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Metadata value. Can be a string, number, or `null`.", + "title": "Value" + } + }, + "required": [ + "id", + "name" + ], + "title": "MetadataDetail", + "type": "object" + }, + "MetadataFilteringCondition": { + "description": "Metadata Filtering Condition.", + "properties": { + "conditions": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/Condition" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "deprecated": true, + "description": "List of metadata conditions to evaluate.", + "title": "Conditions" + }, + "logical_operator": { + "anyOf": [ + { + "enum": [ + "and", + "or" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "and", + "description": "How to combine multiple conditions.", + "title": "Logical Operator" + } + }, + "title": "MetadataFilteringCondition", + "type": "object" + }, + "MetadataOperationData": { + "description": "Metadata operation data", + "properties": { + "operation_data": { + "description": "Array of document metadata update operations. Each entry maps a document ID to its metadata values.", + "items": { + "$ref": "#/components/schemas/DocumentMetadataOperation" + }, + "title": "Operation Data", + "type": "array" + } + }, + "required": [ + "operation_data" + ], + "title": "MetadataOperationData", + "type": "object" + }, + "MetadataUpdatePayload": { + "properties": { + "name": { + "description": "New metadata field name.", + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "MetadataUpdatePayload", + "type": "object" + }, + "ModelFeature": { + "description": "Enum class for llm feature.", + "enum": [ + "agent-thought", + "audio", + "document", + "multi-tool-call", + "polling", + "stream-tool-call", + "structured-output", + "tool-call", + "video", + "vision" + ], + "title": "ModelFeature", + "type": "string" + }, + "ModelPropertyKey": { + "description": "Enum class for model property key.", + "enum": [ + "audio_type", + "context_size", + "default_voice", + "file_upload_limit", + "max_characters_per_chunk", + "max_chunks", + "max_workers", + "mode", + "supported_file_extensions", + "voices", + "word_limit" + ], + "title": "ModelPropertyKey", + "type": "string" + }, + "ModelStatus": { + "description": "Enum class for model status.", + "enum": [ + "active", + "credential-removed", + "disabled", + "no-configure", + "no-permission", + "quota-exceeded" + ], + "title": "ModelStatus", + "type": "string" + }, + "ModelType": { + "description": "Enum class for model type.", + "enum": [ + "llm", + "moderation", + "rerank", + "speech2text", + "text-embedding", + "tts" + ], + "title": "ModelType", + "type": "string" + }, + "OptionalServiceApiUserPayload": { + "properties": { + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" + } + }, + "title": "ServiceApiUserPayload", + "type": "object" + }, + "ParagraphInputConfig": { + "description": "Form input definition.", + "properties": { + "default": { + "anyOf": [ + { + "$ref": "#/components/schemas/StringSource" + }, + { + "type": "null" + } + ], + "default": null + }, + "output_variable_name": { + "title": "Output Variable Name", + "type": "string" + }, + "type": { + "const": "paragraph", + "default": "paragraph", + "title": "Type", + "type": "string" + } + }, + "required": [ + "output_variable_name" + ], + "title": "ParagraphInputConfig", + "type": "object" + }, + "Parameters": { + "properties": { + "annotation_reply": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "file_upload": { + "properties": { + "allowed_file_extensions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "allowed_file_types": { + "items": { + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "type": "array" + }, + "allowed_file_upload_methods": { + "items": { + "enum": [ + "local_file", + "remote_url" + ], + "type": "string" + }, + "type": "array" + }, + "enabled": { + "type": "boolean" + }, + "image": { + "properties": { + "detail": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "number_limits": { + "type": "integer" + }, + "transfer_methods": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "number_limits": { + "type": "integer" + } + }, + "type": "object" + }, + "more_like_this": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "opening_statement": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Opening Statement" + }, + "retriever_resource": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "sensitive_word_avoidance": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "speech_to_text": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "suggested_questions": { + "items": { + "type": "string" + }, + "title": "Suggested Questions", + "type": "array" + }, + "suggested_questions_after_answer": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "system_parameters": { + "$ref": "#/components/schemas/SystemParameters" + }, + "text_to_speech": { + "properties": { + "autoPlay": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "language": { + "type": "string" + }, + "voice": { + "type": "string" + } + }, + "type": "object" + }, + "user_input_form": { + "items": { + "oneOf": [ + { + "additionalProperties": false, + "properties": { + "text-input": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "text-input" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "select": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "select" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "paragraph": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "paragraph" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "number": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "number" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "external_data_tool": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "external_data_tool" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "file": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "file" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "file-list": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "file-list" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "checkbox": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "checkbox" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "json_object": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } }, - "node_id": { - "type": "string", - "description": "Node ID in the workflow graph." - } + "required": [ + "json_object" + ], + "type": "object" } - } - } + ], + "type": "object" + }, + "title": "User Input Form", + "type": "array" } - ] + }, + "required": [ + "annotation_reply", + "file_upload", + "more_like_this", + "retriever_resource", + "sensitive_word_avoidance", + "speech_to_text", + "suggested_questions", + "suggested_questions_after_answer", + "system_parameters", + "text_to_speech", + "user_input_form" + ], + "title": "Parameters", + "type": "object" }, - "StreamEventChatReasoningChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "message_id": { - "type": "string", - "format": "uuid", - "description": "ID of the message this reasoning belongs to (mirrors the top-level `message_id`)." - }, - "reasoning": { - "type": "string", - "description": "Chain-of-thought delta emitted by an LLM node whose `reasoning_format` is `separated`. Concatenate consecutive `reasoning_chunk` events to rebuild the full reasoning. This stream is parallel to `message`; the `message` (answer) stream stays free of `` tags." - }, - "node_id": { - "type": "string", - "nullable": true, - "description": "ID of the LLM node producing the reasoning. Lets you attribute reasoning when multiple LLM nodes run." - }, - "is_final": { - "type": "boolean", - "description": "`true` marks the end of an LLM node's reasoning phase (the \"thinking finished\" signal); it may arrive with an empty `reasoning`." - } - } - } - } - } - ] + "PermissionEnum": { + "description": "Shared permission levels for resources (datasets, credentials, etc.)", + "enum": [ + "all_team_members", + "only_me", + "partial_members" + ], + "title": "PermissionEnum", + "type": "string" }, - "StreamEventChatTextChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "PipelineDataset": { + "properties": { + "chunk_structure": { + "title": "Chunk Structure", + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "description": { + "default": "", + "description": "knowledge dataset description", + "title": "Description", + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "The text content chunk." - }, - "from_variable_selector": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true, - "description": "Source path of the text variable in the workflow." - } - } - } - } + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" } - ] + }, + "required": [ + "chunk_structure", + "id", + "name" + ], + "title": "PipelineDataset", + "type": "object" }, - "WorkflowRunDetailResponse": { - "type": "object", + "PipelineDocument": { "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Workflow run ID." - }, - "workflow_id": { - "type": "string", - "format": "uuid", - "description": "Workflow ID." - }, - "status": { - "type": "string", - "description": "Workflow execution status. `running` for in-progress executions, `succeeded` when completed successfully, `failed` when execution encountered an error, `stopped` when manually halted, `partial-succeeded` when some nodes succeeded but others failed, `paused` when awaiting human input." + "data_source_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Source Info" }, - "inputs": { - "type": "string", - "nullable": true, - "description": "Input variables of the workflow run, returned as a raw JSON string that clients must parse (e.g., `{\"query\": \"...\"}`). May be `null`." + "data_source_type": { + "title": "Data Source Type", + "type": "string" }, - "outputs": { - "type": "object", - "additionalProperties": true, - "description": "Output data from the workflow. An empty object until outputs are available." + "enabled": { + "title": "Enabled", + "type": "boolean" }, "error": { - "type": "string", - "nullable": true, - "description": "Error message if the workflow failed." - }, - "total_steps": { - "type": "integer", - "description": "Total number of workflow steps executed." + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Error" }, - "total_tokens": { - "type": "integer", - "description": "Total tokens consumed." + "id": { + "title": "Id", + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when the workflow run was created." + "indexing_status": { + "title": "Indexing Status", + "type": "string" }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "Unix timestamp of when the workflow run finished." + "name": { + "title": "Name", + "type": "string" }, - "elapsed_time": { - "type": "number", - "format": "float", - "nullable": true, - "description": "Total time elapsed in seconds." + "position": { + "title": "Position", + "type": "integer" } - } + }, + "required": [ + "data_source_type", + "enabled", + "id", + "indexing_status", + "name", + "position" + ], + "title": "PipelineDocument", + "type": "object" }, - "WorkflowLogsResponse": { - "type": "object", + "PipelineRunApiEntity": { "properties": { - "page": { - "type": "integer", - "description": "Current page number." - }, - "limit": { - "type": "integer", - "description": "Number of items per page." - }, - "total": { - "type": "integer", - "description": "Total number of log entries." - }, - "has_more": { - "type": "boolean", - "description": "Whether more pages are available." - }, - "data": { - "type": "array", + "datasource_info_list": { + "description": "List of datasource objects to process. The expected item structure depends on `datasource_type`.", "items": { - "$ref": "#/components/schemas/WorkflowLogItem" + "oneOf": [ + { + "properties": { + "name": { + "description": "Document title. Defaults to `untitled`.", + "type": "string" + }, + "reference": { + "description": "Use the `id` returned by the [Upload Pipeline File](/en/api-reference/knowledge-pipeline/upload-pipeline-file) endpoint. `related_id` is accepted as an alias.", + "type": "string" + } + }, + "required": [ + "reference" + ], + "title": "Local File", + "type": "object" + }, + { + "properties": { + "credential_id": { + "description": "Credential for authenticating with the external platform. If omitted, the provider's default credential is used.", + "type": "string" + }, + "page": { + "description": "Page details.", + "properties": { + "page_id": { + "description": "Page identifier.", + "type": "string" + }, + "page_name": { + "description": "Display name. Defaults to `untitled`.", + "type": "string" + }, + "type": { + "description": "Page type defined by the datasource plugin.", + "type": "string" + } + }, + "required": [ + "page_id", + "type" + ], + "type": "object" + }, + "workspace_id": { + "description": "ID of the workspace or database in the external platform.", + "type": "string" + } + }, + "required": [ + "page", + "workspace_id" + ], + "title": "Online Document", + "type": "object" + }, + { + "properties": { + "title": { + "description": "Used as the document name. Defaults to `untitled`.", + "type": "string" + }, + "url": { + "description": "URL to crawl.", + "type": "string" + } + }, + "required": [ + "url" + ], + "title": "Website Crawl", + "type": "object" + }, + { + "properties": { + "bucket": { + "description": "Storage bucket name. Required by some drive providers, such as S3-compatible stores; omit if the provider does not use buckets.", + "type": "string" + }, + "id": { + "description": "File or folder ID.", + "type": "string" + }, + "name": { + "description": "File name. Defaults to `untitled`.", + "type": "string" + }, + "type": { + "description": "Whether this entry is a single file or a folder to expand.", + "enum": [ + "file", + "folder" + ], + "type": "string" + } + }, + "required": [ + "id", + "type" + ], + "title": "Online Drive", + "type": "object" + } + ] }, - "description": "List of workflow log entries." - } - } - }, - "WorkflowLogItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Log entry ID." - }, - "workflow_run": { - "$ref": "#/components/schemas/WorkflowRunSummary" - }, - "created_from": { - "type": "string", - "description": "Source of the workflow run (e.g., `service-api`)." - }, - "created_by_role": { - "type": "string", - "description": "Role of the creator (e.g., `end_user`, `account`)." - }, - "created_by_account": { - "type": "object", - "nullable": true, - "description": "Account details if created by an admin user.", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Account ID." - }, - "name": { - "type": "string", - "description": "Account display name." - }, - "email": { - "type": "string", - "description": "Account email address." - } - } - }, - "created_by_end_user": { - "$ref": "#/components/schemas/EndUserSummary" + "title": "Datasource Info List", + "type": "array" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when the log entry was created." + "datasource_type": { + "description": "Type of the datasource. Determines which fields are expected in `datasource_info_list` items.", + "enum": [ + "local_file", + "online_document", + "online_drive", + "website_crawl" + ], + "title": "Datasource Type", + "type": "string" }, - "details": { - "type": "object", + "inputs": { "additionalProperties": true, - "nullable": true, - "description": "Additional details for the log entry." - } - } - }, - "WorkflowRunSummary": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Workflow run ID." - }, - "version": { - "type": "string", - "description": "Workflow version identifier." - }, - "status": { - "type": "string", - "description": "Workflow execution status. `running` for in-progress executions, `succeeded` when completed successfully, `failed` when execution encountered an error, `stopped` when manually halted, `partial-succeeded` when some nodes succeeded but others failed, `paused` when awaiting human input." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if the workflow failed." + "description": "Key-value pairs for pipeline input variables defined in the workflow. Pass `{}` if the pipeline has no input variables.", + "title": "Inputs", + "type": "object" }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "Total time elapsed in seconds." + "is_published": { + "description": "Whether to run the published or draft version of the pipeline. `true` runs the latest published version; `false` runs the current draft (useful for testing unpublished changes).", + "title": "Is Published", + "type": "boolean" }, - "total_tokens": { - "type": "integer", - "description": "Total tokens consumed." + "response_mode": { + "description": "Response mode for draft runs. Use `streaming` for SSE or `blocking` for JSON. Published runs are queued and always return batch metadata as JSON.", + "enum": [ + "blocking", + "streaming" + ], + "title": "Response Mode", + "type": "string" }, - "total_steps": { - "type": "integer", - "description": "Total number of workflow steps executed." + "start_node_id": { + "description": "ID of the datasource node where the run starts.", + "title": "Start Node Id", + "type": "string" + } + }, + "required": [ + "datasource_info_list", + "datasource_type", + "inputs", + "is_published", + "response_mode", + "start_node_id" + ], + "title": "PipelineRunApiEntity", + "type": "object" + }, + "PipelineRunJsonResponse": { + "anyOf": [ + { + "$ref": "#/components/schemas/PublishedPipelineRunResponse" }, + { + "$ref": "#/components/schemas/WorkflowBlockingResponse" + } + ], + "description": "JSON responses returned by published and draft knowledge pipeline runs.", + "title": "PipelineRunJsonResponse" + }, + "PipelineUploadFileResponse": { + "properties": { "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when the workflow run was created." + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "Unix timestamp of when the workflow run finished." + "created_by": { + "title": "Created By", + "type": "string" }, - "exceptions_count": { - "type": "integer", - "description": "Number of exceptions that occurred during execution." + "extension": { + "title": "Extension", + "type": "string" }, - "triggered_from": { - "type": "string", - "description": "Source that triggered the workflow run. `app-run` for runs started from the app or API, `webhook` for runs started by a webhook trigger, `schedule` for runs started by a schedule trigger, `plugin` for runs started by an integration trigger." - } - } - }, - "EndUserSummary": { - "type": "object", - "properties": { "id": { - "type": "string", - "format": "uuid", - "description": "End user ID." + "title": "Id", + "type": "string" }, - "type": { - "type": "string", - "description": "End user type." + "mime_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Mime Type" }, - "is_anonymous": { - "type": "boolean", - "description": "Whether the end user is anonymous." + "name": { + "title": "Name", + "type": "string" }, - "session_id": { - "type": "string", - "description": "Session identifier." + "size": { + "title": "Size", + "type": "integer" } - } + }, + "required": [ + "created_by", + "extension", + "id", + "name", + "size" + ], + "title": "PipelineUploadFileResponse", + "type": "object" }, - "HumanInputContent": { - "type": "object", - "description": "Execution content from a Human Input node, including form definition and submission data.", + "PreProcessingRule": { "properties": { - "workflow_run_id": { - "type": "string", - "description": "ID of the workflow run this content belongs to." - }, - "submitted": { - "type": "boolean", - "description": "Whether the human input form has been submitted." - }, - "type": { - "type": "string", - "description": "`human_input` for human input content." - }, - "form_definition": { - "nullable": true, - "description": "Form definition from the Human Input node. `null` when the content represents a submission response.", - "$ref": "#/components/schemas/HumanInputFormDefinition" + "enabled": { + "description": "Whether this preprocessing rule is enabled.", + "title": "Enabled", + "type": "boolean" }, - "form_submission_data": { - "nullable": true, - "description": "Submitted form data. `null` when the form has not been submitted yet.", - "$ref": "#/components/schemas/HumanInputFormSubmissionData" + "id": { + "description": "Rule identifier.", + "enum": [ + "remove_extra_spaces", + "remove_stopwords", + "remove_urls_emails" + ], + "title": "Id", + "type": "string" } - } + }, + "required": [ + "enabled", + "id" + ], + "title": "PreProcessingRule", + "type": "object" }, - "HumanInputFormDefinition": { - "type": "object", - "description": "Definition of a human input form rendered by a Human Input node.", + "ProcessRule": { "properties": { - "form_id": { - "type": "string", - "description": "Unique form identifier." - }, - "node_id": { - "type": "string", - "description": "ID of the Human Input node that generated this form." - }, - "node_title": { - "type": "string", - "description": "Title of the Human Input node." - }, - "form_content": { - "type": "string", - "description": "Markdown or text content displayed with the form." - }, - "inputs": { - "type": "array", - "description": "Input fields in the form.", - "items": { - "$ref": "#/components/schemas/FormInput" - } - }, - "actions": { - "type": "array", - "description": "Action buttons available on the form.", - "items": { - "$ref": "#/components/schemas/UserAction" - } - }, - "display_in_ui": { - "type": "boolean", - "description": "Whether the form should be displayed in the UI." - }, - "form_token": { - "type": "string", - "nullable": true, - "description": "Token for form submission authentication." - }, - "resolved_default_values": { - "type": "object", - "additionalProperties": true, - "description": "Resolved default values for form inputs, keyed by output variable name." + "mode": { + "$ref": "#/components/schemas/ProcessRuleMode", + "description": "Processing mode. `automatic` uses built-in rules, `custom` allows manual configuration, and `hierarchical` enables parent-child chunk structure for `doc_form: hierarchical_model`." }, - "expiration_time": { - "type": "integer", - "description": "Unix timestamp when the form expires." + "rules": { + "anyOf": [ + { + "$ref": "#/components/schemas/Rule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Custom processing rules." } - } + }, + "required": [ + "mode" + ], + "title": "ProcessRule", + "type": "object" }, - "HumanInputFormSubmissionData": { - "type": "object", - "description": "Data from a submitted human input form.", + "ProcessRuleMode": { + "description": "Dataset Process Rule Mode", + "enum": [ + "automatic", + "custom", + "hierarchical" + ], + "title": "ProcessRuleMode", + "type": "string" + }, + "ProviderModelWithStatusEntity": { + "description": "Model class for model response.", "properties": { - "node_id": { - "type": "string", - "description": "ID of the Human Input node." + "deprecated": { + "default": false, + "title": "Deprecated", + "type": "boolean" }, - "node_title": { - "type": "string", - "description": "Title of the Human Input node." + "features": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ModelFeature" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Features" }, - "rendered_content": { - "type": "string", - "description": "Rendered content of the form submission." + "fetch_from": { + "$ref": "#/components/schemas/FetchFrom" }, - "action_id": { - "type": "string", - "description": "ID of the action button that was clicked." + "has_invalid_load_balancing_configs": { + "default": false, + "title": "Has Invalid Load Balancing Configs", + "type": "boolean" }, - "action_text": { - "type": "string", - "description": "Display text of the action button that was clicked." - } - } - }, - "FormInput": { - "type": "object", - "description": "A form input field definition.", - "properties": { - "type": { - "type": "string", - "description": "Form input control type. Available values: `paragraph` (multi-line text input), `select` (single-choice from a list), `file` (single file upload), and `file-list` (multiple file uploads)." + "label": { + "$ref": "#/components/schemas/I18nObject" }, - "output_variable_name": { - "type": "string", - "description": "Variable name where the input value is stored." + "load_balancing_enabled": { + "default": false, + "title": "Load Balancing Enabled", + "type": "boolean" }, - "default": { - "nullable": true, - "description": "Default value configuration for this input.", - "$ref": "#/components/schemas/FormInputDefault" - } - } - }, - "FormInputDefault": { - "type": "object", - "description": "Default value configuration for a form input.", - "properties": { - "type": { - "type": "string", - "description": "`variable` for dynamic values from workflow variables, `constant` for static values." + "model": { + "title": "Model", + "type": "string" }, - "selector": { - "type": "array", - "items": { - "type": "string" + "model_properties": { + "additionalProperties": true, + "propertyNames": { + "$ref": "#/components/schemas/ModelPropertyKey" }, - "description": "Variable selector path when `type` is `variable`." - }, - "value": { - "type": "string", - "description": "Static value when `type` is `constant`." - } - } - }, - "UserAction": { - "type": "object", - "description": "An action button on a human input form.", - "properties": { - "id": { - "type": "string", - "description": "Unique action identifier." + "title": "Model Properties", + "type": "object" }, - "title": { - "type": "string", - "description": "Button display text." + "model_type": { + "$ref": "#/components/schemas/ModelType" }, - "button_style": { - "type": "string", - "description": "`primary`, `default`, `accent`, or `ghost`." + "status": { + "$ref": "#/components/schemas/ModelStatus" } - } - }, - "WorkflowExecutionRequest": { - "type": "object", + }, "required": [ - "inputs", - "user" + "fetch_from", + "label", + "model", + "model_properties", + "model_type", + "status" ], + "title": "ProviderModelWithStatusEntity", + "type": "object" + }, + "ProviderWithModelsListResponse": { "properties": { - "inputs": { - "type": "object", - "description": "Key-value pairs for workflow input variables. Discover the variable names and types your app expects from the `user_input_form` field of [Get App Parameters](/en/api-reference/applications/get-app-parameters).\n\nFile-type variables take an array of file objects with `type`, `transfer_method`, and either `url` or `upload_file_id`.", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "object" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/InputFileObject" - } - } - ] - } + "data": { + "items": { + "$ref": "#/components/schemas/ProviderWithModelsResponse" + }, + "title": "Data", + "type": "array" + } + }, + "required": [ + "data" + ], + "title": "ProviderWithModelsListResponse", + "type": "object" + }, + "ProviderWithModelsResponse": { + "description": "Model class for provider with models response.", + "properties": { + "icon_small": { + "anyOf": [ + { + "$ref": "#/components/schemas/I18nObject" + }, + { + "type": "null" + } + ], + "default": null }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" + "icon_small_dark": { + "anyOf": [ + { + "$ref": "#/components/schemas/I18nObject" + }, + { + "type": "null" + } ], - "description": "Response mode. Use `blocking` for synchronous responses (Cloudflare timeout is `100 s`), or `streaming` for Server-Sent Events. When omitted, defaults to blocking behavior." + "default": null }, - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. Scopes data access: a workflow run and its files are only visible to later requests that carry the same `user`. See [End User Identity](/en/api-reference/guides/end-user-identity)." + "label": { + "$ref": "#/components/schemas/I18nObject" }, - "files": { - "type": "array", + "models": { "items": { - "$ref": "#/components/schemas/InputFileObject" + "$ref": "#/components/schemas/ProviderModelWithStatusEntity" }, - "nullable": true, - "description": "File list. Suitable when files need to be combined with text for input, available only when the model supports Vision capability. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`." + "title": "Models", + "type": "array" + }, + "provider": { + "title": "Provider", + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/CustomConfigurationStatus" + }, + "tenant_id": { + "title": "Tenant Id", + "type": "string" } - } - }, - "InputFileObject": { - "type": "object", + }, "required": [ - "type", - "transfer_method" + "label", + "models", + "provider", + "status", + "tenant_id" ], + "title": "ProviderWithModelsResponse", + "type": "object" + }, + "PublishedPipelineRunResponse": { "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "document", - "audio", - "video", - "custom" - ], - "description": "File type." - }, - "transfer_method": { - "type": "string", - "enum": [ - "remote_url", - "local_file" - ], - "description": "Transfer method: `remote_url` for file URL, `local_file` for uploaded file." + "batch": { + "title": "Batch", + "type": "string" }, - "url": { - "type": "string", - "format": "url", - "description": "File URL (when `transfer_method` is `remote_url`)." + "dataset": { + "$ref": "#/components/schemas/PipelineDataset" }, - "upload_file_id": { - "type": "string", - "description": "Uploaded file ID, obtained by uploading through the [Upload File](/en/api-reference/files/upload-file) API in advance (when `transfer_method` is `local_file`)." + "documents": { + "items": { + "$ref": "#/components/schemas/PipelineDocument" + }, + "title": "Documents", + "type": "array" } }, - "anyOf": [ - { - "properties": { - "transfer_method": { - "enum": [ - "remote_url" - ] + "required": [ + "batch", + "dataset", + "documents" + ], + "title": "PublishedPipelineRunResponse", + "type": "object" + }, + "RequiredServiceApiUserPayload": { + "properties": { + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" + } + }, + "required": [ + "user" + ], + "title": "ServiceApiUserPayload", + "type": "object" + }, + "RerankingModel": { + "properties": { + "reranking_model_name": { + "anyOf": [ + { + "type": "string" }, - "url": { - "type": "string", - "format": "url" + { + "type": "null" } - }, - "required": [ - "url" ], - "not": { - "required": [ - "upload_file_id" - ] - } + "default": null, + "description": "Name of the reranking model.", + "title": "Reranking Model Name" }, - { - "properties": { - "transfer_method": { - "enum": [ - "local_file" - ] - }, - "upload_file_id": { + "reranking_provider_name": { + "anyOf": [ + { "type": "string" + }, + { + "type": "null" } - }, - "required": [ - "upload_file_id" ], - "not": { - "required": [ - "url" - ] - } + "default": null, + "description": "Provider name of the reranking model.", + "title": "Reranking Provider Name" } - ] + }, + "title": "RerankingModel", + "type": "object" }, - "WorkflowBlockingResponse": { - "type": "object", + "ResultResponse": { "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "Task ID for the in-progress execution. Use this with [Stop Workflow Task](/en/api-reference/workflow-runs/stop-workflow-task) to cancel a running workflow. Only valid during execution." - }, - "workflow_run_id": { - "type": "string", - "format": "uuid", - "description": "Persistent identifier for this workflow run record. Use this with [Get Workflow Run Detail](/en/api-reference/workflow-runs/get-workflow-run-detail) to retrieve results after execution." - }, - "data": { - "$ref": "#/components/schemas/WorkflowFinishedData" + "result": { + "title": "Result", + "type": "string" } - } - }, - "ChunkWorkflowEvent": { - "type": "object", + }, "required": [ - "event" + "result" ], - "properties": { - "event": { - "type": "string", - "description": "The type of streaming event.", - "enum": [ - "workflow_started", - "node_started", - "node_finished", - "node_retry", - "iteration_started", - "iteration_next", - "iteration_completed", - "loop_started", - "loop_next", - "loop_completed", - "reasoning_chunk", - "text_chunk", - "workflow_finished", - "tts_message", - "tts_message_end", - "workflow_paused", - "agent_log", - "human_input_required", - "human_input_form_filled", - "human_input_form_timeout", - "error", - "ping" - ] - } - }, - "discriminator": { - "propertyName": "event", - "mapping": { - "workflow_started": "#/components/schemas/WorkflowStreamEventWorkflowStarted", - "node_started": "#/components/schemas/WorkflowStreamEventNodeStarted", - "node_finished": "#/components/schemas/WorkflowStreamEventNodeFinished", - "node_retry": "#/components/schemas/WorkflowStreamEventNodeRetry", - "iteration_started": "#/components/schemas/WorkflowStreamEventIterationStarted", - "iteration_next": "#/components/schemas/WorkflowStreamEventIterationNext", - "iteration_completed": "#/components/schemas/WorkflowStreamEventIterationCompleted", - "loop_started": "#/components/schemas/WorkflowStreamEventLoopStarted", - "loop_next": "#/components/schemas/WorkflowStreamEventLoopNext", - "loop_completed": "#/components/schemas/WorkflowStreamEventLoopCompleted", - "reasoning_chunk": "#/components/schemas/StreamEventReasoningChunk", - "text_chunk": "#/components/schemas/StreamEventTextChunk", - "workflow_finished": "#/components/schemas/WorkflowStreamEventWorkflowFinished", - "tts_message": "#/components/schemas/StreamEventTtsMessage", - "tts_message_end": "#/components/schemas/StreamEventTtsMessageEnd", - "error": "#/components/schemas/StreamEventError", - "ping": "#/components/schemas/StreamEventPing", - "workflow_paused": "#/components/schemas/WorkflowStreamEventWorkflowPaused", - "agent_log": "#/components/schemas/WorkflowStreamEventAgentLog", - "human_input_required": "#/components/schemas/WorkflowStreamEventHumanInputRequired", - "human_input_form_filled": "#/components/schemas/WorkflowStreamEventHumanInputFormFilled", - "human_input_form_timeout": "#/components/schemas/WorkflowStreamEventHumanInputFormTimeout" - } - } + "title": "ResultResponse", + "type": "object" }, - "StreamEventReasoningChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "RetrievalMethod": { + "enum": [ + "full_text_search", + "hybrid_search", + "keyword_search", + "semantic_search" + ], + "title": "RetrievalMethod", + "type": "string" + }, + "Rule": { + "properties": { + "parent_mode": { + "anyOf": [ + { + "enum": [ + "full-doc", + "paragraph" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Parent-child segmentation mode.", + "title": "Parent Mode" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "pre_processing_rules": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/PreProcessingRule" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Pre-processing rules to apply before segmentation.", + "title": "Pre Processing Rules" + }, + "segmentation": { + "anyOf": [ + { + "$ref": "#/components/schemas/Segmentation" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Parent chunk segmentation settings." }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "reasoning": { - "type": "string", - "description": "Chain-of-thought delta emitted by an LLM node whose `reasoning_format` is `separated`. Concatenate consecutive `reasoning_chunk` events to rebuild the full reasoning. This stream is parallel to `text_chunk`; the `text` stream stays free of `` tags." - }, - "node_id": { - "type": "string", - "nullable": true, - "description": "ID of the LLM node producing the reasoning. Lets you attribute reasoning when multiple LLM nodes run." - }, - "is_final": { - "type": "boolean", - "description": "`true` marks the end of an LLM node's reasoning phase (the \"thinking finished\" signal); it may arrive with an empty `reasoning`." - } - } + "subchunk_segmentation": { + "anyOf": [ + { + "$ref": "#/components/schemas/Segmentation" + }, + { + "type": "null" } - } + ], + "default": null, + "description": "Child chunk segmentation settings." } - ] + }, + "title": "Rule", + "type": "object" }, - "StreamEventTextChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentAttachmentResponse": { + "properties": { + "extension": { + "title": "Extension", + "type": "string" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "id": { + "title": "Id", + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "The text content chunk." - }, - "from_variable_selector": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true, - "description": "Source path of the text variable in the workflow." - } - } + "mime_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "title": "Mime Type" + }, + "name": { + "title": "Name", + "type": "string" + }, + "size": { + "title": "Size", + "type": "integer" + }, + "source_url": { + "title": "Source Url", + "type": "string" } - ] + }, + "required": [ + "extension", + "id", + "mime_type", + "name", + "size", + "source_url" + ], + "title": "SegmentAttachmentResponse", + "type": "object" }, - "StreamEventTtsMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" - }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "SegmentCreateItemPayload": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Answer content for QA mode.", + "title": "Answer" }, - { - "type": "object", - "properties": { - "audio": { - "type": "string", - "format": "byte", - "description": "Base64-encoded MP3 audio chunk. Decode and concatenate all chunks in order to produce a complete audio file." + "attachment_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when this audio chunk was generated." + { + "type": "null" } - } - } - ] - }, - "StreamEventTtsMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null, + "description": "Attachment file IDs.", + "title": "Attachment Ids" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "content": { + "description": "Chunk text content.", + "minLength": 1, + "title": "Content", + "type": "string" }, - { - "type": "object", - "properties": { - "audio": { - "type": "string", - "description": "Empty string. Signals the end of the audio stream." + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when the audio stream ended." + { + "type": "null" } - } + ], + "default": null, + "description": "Keywords for the chunk.", + "title": "Keywords" } - ] + }, + "required": [ + "content" + ], + "title": "SegmentCreateItemPayload", + "type": "object" }, - "StreamEventError": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentCreateListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/SegmentResponse" + }, + "title": "Data", + "type": "array" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "doc_form": { + "title": "Doc Form", + "type": "string" + } + }, + "required": [ + "data", + "doc_form" + ], + "title": "SegmentCreateListResponse", + "type": "object" + }, + "SegmentCreatePayload": { + "properties": { + "segments": { + "description": "Array of chunk objects to create.", + "items": { + "$ref": "#/components/schemas/SegmentCreateItemPayload" + }, + "minItems": 1, + "title": "Segments", + "type": "array" + } + }, + "required": [ + "segments" + ], + "title": "SegmentCreatePayload", + "type": "object" + }, + "SegmentDetailResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/SegmentResponse" }, - { - "type": "object", - "properties": { - "status": { - "type": "integer", - "description": "HTTP status code of the error." - }, - "code": { - "type": "string", - "description": "Error code." + "doc_form": { + "title": "Doc Form", + "type": "string" + } + }, + "required": [ + "data", + "doc_form" + ], + "title": "SegmentDetailResponse", + "type": "object" + }, + "SegmentListQuery": { + "properties": { + "keyword": { + "anyOf": [ + { + "type": "string" }, - "message": { - "type": "string", - "description": "Error message." + { + "type": "null" } - } + ], + "default": null, + "description": "Search keyword.", + "title": "Keyword" + }, + "limit": { + "default": 20, + "description": "Number of items per page. Server caps at `100`.", + "minimum": 1, + "title": "Limit", + "type": "integer" + }, + "page": { + "default": 1, + "description": "Page number to retrieve.", + "minimum": 1, + "title": "Page", + "type": "integer" + }, + "status": { + "description": "Filter chunks by indexing status, such as `completed`, `indexing`, or `error`.", + "items": { + "type": "string" + }, + "title": "Status", + "type": "array" } - ] + }, + "title": "SegmentListQuery", + "type": "object" }, - "StreamEventPing": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/SegmentResponse" + }, + "title": "Data", + "type": "array" }, - { - "type": "object", - "description": "Keep-alive ping event. Delivered as an `event: ping` line with no `data:` payload. The first event of every stream is a `ping`." + "doc_form": { + "title": "Doc Form", + "type": "string" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "limit": { + "title": "Limit", + "type": "integer" + }, + "page": { + "title": "Page", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" } - ] + }, + "required": [ + "data", + "doc_form", + "has_more", + "limit", + "page", + "total" + ], + "title": "SegmentListResponse", + "type": "object" }, - "WorkflowFinishedData": { - "type": "object", + "SegmentResponse": { "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Workflow run ID." + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Answer" }, - "workflow_id": { - "type": "string", - "format": "uuid", - "description": "Workflow ID." + "attachments": { + "items": { + "$ref": "#/components/schemas/SegmentAttachmentResponse" + }, + "title": "Attachments", + "type": "array" }, - "status": { - "type": "string", - "description": "Workflow execution status. `running` for in-progress executions, `succeeded` when completed successfully, `failed` when execution encountered an error, `stopped` when manually halted, `partial-succeeded` when some nodes succeeded but others failed, `paused` when awaiting human input." + "child_chunks": { + "items": { + "$ref": "#/components/schemas/ChildChunkResponse" + }, + "title": "Child Chunks", + "type": "array" }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Output data from the workflow." + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Completed At" }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if the workflow failed." + "content": { + "title": "Content", + "type": "string" }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "Total time elapsed in seconds." + "created_at": { + "title": "Created At", + "type": "integer" }, - "total_tokens": { - "type": "integer", - "description": "Total tokens consumed across all nodes." + "created_by": { + "title": "Created By", + "type": "string" }, - "total_steps": { - "type": "integer", - "description": "Total number of workflow steps executed." + "disabled_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Disabled At" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when the workflow run was created." + "disabled_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Disabled By" }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "Unix timestamp of when the workflow run finished." + "document_id": { + "title": "Document Id", + "type": "string" }, - "created_by": { - "type": "object", - "additionalProperties": true, - "description": "Creator information. Only present in streaming `workflow_finished` events." + "enabled": { + "title": "Enabled", + "type": "boolean" }, - "exceptions_count": { - "type": "integer", - "nullable": true, - "description": "Number of exceptions encountered during execution. Only present in streaming `workflow_finished` events." + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" }, - "files": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "nullable": true, - "description": "Files generated during workflow execution. Only present in streaming `workflow_finished` events." - } - } - }, - "WorkflowStreamEventBase": { - "type": "object", - "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "Task ID for the in-progress execution. Use this with [Stop Workflow Task](/en/api-reference/workflow-runs/stop-workflow-task) to cancel a running workflow. Only valid during execution." + "hit_count": { + "title": "Hit Count", + "type": "integer" }, - "workflow_run_id": { - "type": "string", - "format": "uuid", - "description": "Persistent identifier for this workflow run record. Use this with [Get Workflow Run Detail](/en/api-reference/workflow-runs/get-workflow-run-detail) to retrieve results after execution." - } - } - }, - "WorkflowStreamEventWorkflowStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "id": { + "title": "Id", + "type": "string" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "index_node_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Index Node Hash" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Workflow run ID." - }, - "workflow_id": { - "type": "string", - "format": "uuid", - "description": "Workflow ID." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "Input variables for this workflow run." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when the workflow run started." - }, - "reason": { - "type": "string", - "description": "Reason for the workflow start. `initial` for a new execution, `resumption` when resuming from a paused state." - } - } + "index_node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventWorkflowFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "title": "Index Node Id" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "indexing_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Indexing At" }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/WorkflowFinishedData" + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventNodeStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "title": "Keywords" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "position": { + "title": "Position", + "type": "integer" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Node execution ID." - }, - "node_id": { - "type": "string", - "description": "Node ID in the workflow graph." - }, - "node_type": { - "type": "string", - "description": "Node type (e.g., `llm`, `code`, `template-transform`)." - }, - "title": { - "type": "string", - "description": "Display name of the node." - }, - "index": { - "type": "integer", - "description": "Execution sequence index." - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "ID of the predecessor node, if any." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Input variables for this node." - }, - "inputs_truncated": { - "type": "boolean", - "description": "Whether the `inputs` data was truncated." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when the node execution started." - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "Additional metadata for the node execution." - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "Parent iteration ID if this node runs inside an iteration." - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "Parent loop ID if this node runs inside a loop." - } - } + "sign_content": { + "title": "Sign Content", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + }, + "stopped_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventNodeFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "title": "Stopped At" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Summary" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Node execution ID." - }, - "node_id": { - "type": "string", - "description": "Node ID in the workflow graph." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Display name of the node." - }, - "index": { - "type": "integer", - "description": "Execution sequence index." - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "ID of the predecessor node, if any." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Input variables for this node." - }, - "inputs_truncated": { - "type": "boolean", - "description": "Whether the `inputs` data was truncated." - }, - "process_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Processing data generated during node execution." - }, - "process_data_truncated": { - "type": "boolean", - "description": "Whether the `process_data` was truncated." - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Output data from the node." - }, - "outputs_truncated": { - "type": "boolean", - "description": "Whether the `outputs` data was truncated." - }, - "status": { - "type": "string", - "description": "Node execution status. `running` for in-progress, `succeeded` when completed, `failed` on error, `stopped` when manually halted, `exception` on unexpected failure." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if the node failed." - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "Time elapsed in seconds." - }, - "execution_metadata": { - "type": "object", - "nullable": true, - "description": "Execution metadata including token usage.", - "properties": { - "total_tokens": { - "type": "integer", - "nullable": true, - "description": "Total tokens consumed by this node." - }, - "total_price": { - "type": "number", - "format": "float", - "nullable": true, - "description": "Total cost for this node execution." - }, - "currency": { - "type": "string", - "nullable": true, - "description": "Currency of the cost (e.g., `USD`)." - } - } - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when the node execution started." - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when the node execution finished." - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "Files generated by this node." - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "Parent iteration ID if this node runs inside an iteration." - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "Parent loop ID if this node runs inside a loop." - } - } + "tokens": { + "title": "Tokens", + "type": "integer" + }, + "updated_at": { + "title": "Updated At", + "type": "integer" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "title": "Updated By" + }, + "word_count": { + "title": "Word Count", + "type": "integer" } - ] + }, + "required": [ + "answer", + "attachments", + "child_chunks", + "completed_at", + "content", + "created_at", + "created_by", + "disabled_at", + "disabled_by", + "document_id", + "enabled", + "error", + "hit_count", + "id", + "index_node_hash", + "index_node_id", + "indexing_at", + "keywords", + "position", + "sign_content", + "status", + "stopped_at", + "summary", + "tokens", + "updated_at", + "updated_by", + "word_count" + ], + "title": "SegmentResponse", + "type": "object" }, - "WorkflowStreamEventNodeRetry": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentUpdateArgs": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Updated answer content for QA mode.", + "title": "Answer" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "attachment_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Attachment file IDs.", + "title": "Attachment Ids" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Node execution ID." - }, - "node_id": { - "type": "string", - "description": "Node ID in the workflow graph." - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Display name of the node." - }, - "index": { - "type": "integer", - "description": "Execution sequence index." - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "ID of the predecessor node, if any." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "inputs_truncated": { - "type": "boolean", - "description": "Whether the `inputs` data was truncated." - }, - "process_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Processing data generated during node execution." - }, - "process_data_truncated": { - "type": "boolean", - "description": "Whether the `process_data` was truncated." - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "outputs_truncated": { - "type": "boolean", - "description": "Whether the `outputs` data was truncated." - }, - "status": { - "type": "string", - "description": "Node execution status at the retry point." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message that triggered the retry." - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "Time elapsed in seconds." - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "finished_at": { - "type": "integer", - "format": "int64" - }, - "retry_index": { - "type": "integer", - "description": "Zero-based retry attempt index." - }, - "iteration_id": { - "type": "string", - "nullable": true - }, - "loop_id": { - "type": "string", - "nullable": true - }, - "execution_metadata": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Metadata from the node execution." - }, - "files": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "Files produced by the node during execution." - } - } + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventIterationStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null, + "description": "Updated chunk text content.", + "title": "Content" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Whether the chunk is enabled.", + "title": "Enabled" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Node execution ID." - }, - "node_id": { - "type": "string", - "description": "Iteration node ID." - }, - "node_type": { - "type": "string", - "description": "Node type (always `iteration`)." - }, - "title": { - "type": "string", - "description": "Display name of the iteration node." - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "Input variables for the iteration." - }, - "inputs_truncated": { - "type": "boolean", - "description": "Whether the `inputs` data was truncated." - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "Iteration metadata." - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventIterationNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null, + "description": "Updated keywords for the chunk.", + "title": "Keywords" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "regenerate_child_chunks": { + "default": false, + "description": "Whether to regenerate child chunks after updating a parent chunk.", + "title": "Regenerate Child Chunks", + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "index": { - "type": "integer", - "description": "Current iteration index (zero-based)." - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "description": "Summary content for summary index.", + "title": "Summary" } - ] + }, + "title": "SegmentUpdateArgs", + "type": "object" }, - "WorkflowStreamEventIterationCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentUpdatePayload": { + "properties": { + "segment": { + "$ref": "#/components/schemas/SegmentUpdateArgs", + "description": "Chunk update payload." + } + }, + "required": [ + "segment" + ], + "title": "SegmentUpdatePayload", + "type": "object" + }, + "Segmentation": { + "properties": { + "chunk_overlap": { + "default": 0, + "description": "Token overlap between chunks.", + "title": "Chunk Overlap", + "type": "integer" + }, + "max_tokens": { + "description": "Maximum token count per chunk.", + "title": "Max Tokens", + "type": "integer" + }, + "separator": { + "default": "\n", + "description": "Custom separator for splitting text.", + "title": "Separator", + "type": "string" + } + }, + "required": [ + "max_tokens" + ], + "title": "Segmentation", + "type": "object" + }, + "SelectInputConfig": { + "properties": { + "option_source": { + "$ref": "#/components/schemas/StringListSource" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "output_variable_name": { + "title": "Output Variable Name", + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "outputs_truncated": { - "type": "boolean", - "description": "Whether the `outputs` data was truncated." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Input variables for the iteration." - }, - "inputs_truncated": { - "type": "boolean", - "description": "Whether the `inputs` data was truncated." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp of when the iteration started." - }, - "extras": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Additional metadata for the iteration." - }, - "status": { - "type": "string", - "description": "Iteration completion status." - }, - "error": { - "type": "string", - "nullable": true - }, - "elapsed_time": { - "type": "number", - "format": "float" - }, - "total_tokens": { - "type": "integer" - }, - "execution_metadata": { - "type": "object", - "additionalProperties": true, - "description": "Execution metadata including token usage." - }, - "finished_at": { - "type": "integer", - "format": "int64" - }, - "steps": { - "type": "integer", - "description": "Number of iteration steps completed." - } - } - } - } + "type": { + "const": "select", + "default": "select", + "title": "Type", + "type": "string" } - ] + }, + "required": [ + "option_source", + "output_variable_name" + ], + "title": "SelectInputConfig", + "type": "object" }, - "WorkflowStreamEventLoopStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SimpleAccountResponse": { + "properties": { + "email": { + "title": "Email", + "type": "string" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "id": { + "title": "Id", + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "inputs": { - "type": "object", - "additionalProperties": true - }, - "inputs_truncated": { - "type": "boolean", - "description": "Whether the `inputs` data was truncated." - }, - "metadata": { - "type": "object", - "additionalProperties": true - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } - } - } + "name": { + "title": "Name", + "type": "string" } - ] + }, + "required": [ + "email", + "id", + "name" + ], + "title": "SimpleAccountResponse", + "type": "object" }, - "WorkflowStreamEventLoopNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SimpleConversation": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "id": { + "format": "uuid", + "title": "Id", + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "index": { - "type": "integer", - "description": "Current loop iteration index (zero-based)." - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "pre_loop_output": { - "description": "Output from the previous loop iteration.", - "nullable": true - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JSONValue" + }, + "title": "Inputs", + "type": "object" + }, + "introduction": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Introduction" + }, + "name": { + "title": "Name", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Updated At" } - ] + }, + "required": [ + "id", + "inputs", + "name", + "status" + ], + "title": "SimpleConversation", + "type": "object" }, - "WorkflowStreamEventLoopCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SimpleEndUser": { + "properties": { + "id": { + "title": "Id", + "type": "string" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "is_anonymous": { + "title": "Is Anonymous", + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "outputs_truncated": { - "type": "boolean", - "description": "Whether the `outputs` data was truncated." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Input variables for the loop." - }, - "inputs_truncated": { - "type": "boolean", - "description": "Whether the `inputs` data was truncated." - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Additional metadata for the loop." - }, - "status": { - "type": "string", - "description": "Loop completion status." - }, - "error": { - "type": "string", - "nullable": true - }, - "elapsed_time": { - "type": "number", - "format": "float" - }, - "total_tokens": { - "type": "integer" - }, - "execution_metadata": { - "type": "object", - "additionalProperties": true, - "description": "Execution metadata including token usage." - }, - "finished_at": { - "type": "integer", - "format": "int64" - }, - "steps": { - "type": "integer", - "description": "Number of loop iterations completed." - } - } + "session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Session Id" + }, + "type": { + "title": "Type", + "type": "string" } - ] + }, + "required": [ + "id", + "is_anonymous", + "type" + ], + "title": "SimpleEndUser", + "type": "object" }, - "WorkflowStreamEventHumanInputRequired": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" - }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "form_id": { - "type": "string", - "description": "Identifier for the form instance, surfaced in error messages and logs. Use `form_token` for Service API calls." - }, - "node_id": { - "type": "string", - "description": "ID of the Human Input node that produced this form." - }, - "node_title": { - "type": "string", - "description": "Display title of the Human Input node." - }, - "form_content": { - "type": "string", - "description": "Pre-rendered form body with workflow variables substituted." - }, - "inputs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "Form input control type. Available values: `paragraph` (multi-line text input), `select` (single-choice from a list), `file` (single file upload), and `file-list` (multiple file uploads)." - }, - "output_variable_name": { - "type": "string", - "description": "Variable name used to reference this input's submitted value inside the workflow. Corresponds to the key in the submission `inputs` object." - }, - "default": { - "type": "object", - "nullable": true, - "description": "Default value resolved from the workflow context. `null` when no default is configured.", - "properties": { - "type": { - "type": "string", - "description": "Source of the default. `constant` means `value` is used as a literal string; `variable` means `selector` points to a workflow variable." - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Variable reference path (for example, `[\"node_id\", \"var_name\"]`) when `type` is `variable`. Must contain at least two elements." - }, - "value": { - "type": "string", - "description": "Literal default value when `type` is `constant`. Always a string." - } - } - } - } - }, - "description": "Form input fields the recipient fills in." - }, - "actions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "maxLength": 20, - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Identifier of the action button. Pass as `action` on [Submit Human Input Form](/en/api-reference/human-input/submit-human-input-form) when the recipient selects this button." - }, - "title": { - "type": "string", - "maxLength": 100, - "description": "Button label shown to the recipient." - }, - "button_style": { - "type": "string", - "description": "Visual style of the button. Available values: `primary`, `default`, `accent`, `ghost`." - } - } - }, - "description": "Available user actions (buttons) the recipient can select when submitting." - }, - "display_in_ui": { - "type": "boolean", - "description": "Whether the form is also shown in the Dify console UI." - }, - "form_token": { - "type": "string", - "nullable": true, - "description": "Access token for [Get Human Input Form](/en/api-reference/human-input/get-human-input-form) and [Submit Human Input Form](/en/api-reference/human-input/submit-human-input-form). `null` when the Human Input node uses Email or Console delivery (the Service API can only operate on web app-delivered forms)." - }, - "resolved_default_values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Pre-filled default values for the form inputs, keyed by input `output_variable_name`. All values are stringified." - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp (seconds) after which the form can no longer be submitted." - } - } + "SimpleFeedback": { + "properties": { + "rating": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Rating" } - ] + }, + "title": "SimpleFeedback", + "type": "object" }, - "WorkflowStreamEventWorkflowPaused": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" - }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "SimpleResultResponse": { + "properties": { + "result": { + "title": "Result", + "type": "string" + } + }, + "required": [ + "result" + ], + "title": "SimpleResultResponse", + "type": "object" + }, + "SimpleResultStringListResponse": { + "properties": { + "data": { + "items": { + "type": "string" + }, + "title": "Data", + "type": "array" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "format": "uuid", - "description": "Persistent identifier for this workflow run record. Use this with [Get Workflow Run Detail](/en/api-reference/workflow-runs/get-workflow-run-detail) to retrieve results after execution." - }, - "paused_nodes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of paused node IDs." - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "description": "Partial outputs at pause time." - }, - "reasons": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "Reasons for pausing." - }, - "status": { - "type": "string", - "description": "Workflow execution status." - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Creation timestamp." - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "Total elapsed time in seconds." - }, - "total_tokens": { - "type": "integer", - "description": "Total tokens consumed." - }, - "total_steps": { - "type": "integer", - "description": "Total steps executed." - } - } - } - } + "result": { + "title": "Result", + "type": "string" } - ] + }, + "required": [ + "data", + "result" + ], + "title": "SimpleResultStringListResponse", + "type": "object" }, - "WorkflowStreamEventHumanInputFormFilled": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "Site": { + "properties": { + "chat_color_theme": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Chat Color Theme" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "chat_color_theme_inverted": { + "title": "Chat Color Theme Inverted", + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "ID of the Human Input node whose form was filled." - }, - "node_title": { - "type": "string", - "description": "Display title of the Human Input node." - }, - "rendered_content": { - "type": "string", - "description": "Form body rendered with the recipient's submitted values (`form_content` on `human_input_required` is the unfilled template)." - }, - "action_id": { - "type": "string", - "description": "Identifier of the action the recipient selected (matches the `action` value passed to [Submit Human Input Form](/en/api-reference/human-input/submit-human-input-form))." - }, - "action_text": { - "type": "string", - "description": "Display text of the selected action." - }, - "submitted_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "Values the recipient submitted, keyed by each form input's `output_variable_name`." - } - } + "copyright": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventHumanInputFormTimeout": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null, + "title": "Copyright" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "custom_disclaimer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Custom Disclaimer" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "ID of the Human Input node whose form expired." - }, - "node_title": { - "type": "string", - "description": "Display title of the Human Input node." - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp (seconds) when the form expired." - } - } + "default_language": { + "title": "Default Language", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventAgentLog": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null, + "title": "Description" + }, + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Icon" + }, + "icon_background": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Icon Background" + }, + "icon_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Icon Type" + }, + "icon_url": { + "anyOf": [ + { + "format": "url", + "type": "string" + }, + { + "type": "null" + } + ], + "readOnly": true, + "title": "Icon Url" + }, + "input_placeholder": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Input Placeholder" + }, + "privacy_policy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Privacy Policy" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "show_workflow_steps": { + "title": "Show Workflow Steps", + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "node_execution_id": { - "type": "string", - "description": "Node execution ID." - }, - "id": { - "type": "string", - "description": "Agent log entry ID." - }, - "label": { - "type": "string", - "description": "Log label." - }, - "parent_id": { - "type": "string", - "nullable": true, - "description": "Parent log entry ID." - }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if the agent step failed." - }, - "status": { - "type": "string", - "description": "Agent step status." - }, - "data": { - "type": "object", - "additionalProperties": true, - "description": "Agent step data." - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "Agent step metadata." - }, - "node_id": { - "type": "string", - "description": "Node ID." - } - } - } - } + "title": { + "title": "Title", + "type": "string" + }, + "use_icon_as_answer_icon": { + "title": "Use Icon As Answer Icon", + "type": "boolean" } - ] - }, - "CompletionRequest": { - "type": "object", + }, "required": [ - "inputs", - "user" + "chat_color_theme_inverted", + "default_language", + "icon_url", + "show_workflow_steps", + "title", + "use_icon_as_answer_icon" ], + "title": "Site", + "type": "object" + }, + "StringListSource": { "properties": { - "inputs": { - "type": "object", - "description": "Values for the app's input variables, keyed by variable name. The expected names and types come from the `user_input_form` field of [Get App Parameters](/en/api-reference/applications/get-app-parameters).", - "additionalProperties": true - }, - "query": { - "type": "string", - "default": "", - "description": "The text to process. Legacy field; newer apps pass this inside `inputs` instead." - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" - ], - "description": "Mode of response return. `streaming` (recommended) uses SSE. `blocking` returns after completion (may be interrupted for long processes). Cloudflare timeout is `100 s`. When omitted, defaults to blocking behavior." + "selector": { + "items": { + "type": "string" + }, + "title": "Selector", + "type": "array" }, - "user": { - "type": "string", - "description": "End-user identifier, defined by your app and unique within it. Messages and files are visible only to requests carrying the same `user`. See [End User Identity](/en/api-reference/guides/end-user-identity)." + "type": { + "$ref": "#/components/schemas/ValueSourceType" }, - "files": { - "type": "array", + "value": { "items": { - "$ref": "#/components/schemas/InputFileObject" + "type": "string" }, - "description": "Files to attach to the request. For a local file, first upload it via [Upload File](/en/api-reference/files/upload-file), then reference the returned `id` as `upload_file_id` with `transfer_method: local_file`." + "title": "Value", + "type": "array" } - } + }, + "required": [ + "type" + ], + "title": "StringListSource", + "type": "object" }, - "CompletionResponse": { - "type": "object", + "StringSource": { + "description": "Default configuration for form inputs.", "properties": { - "event": { - "type": "string", - "description": "Event type, fixed as `message`." + "selector": { + "items": { + "type": "string" + }, + "title": "Selector", + "type": "array" }, - "task_id": { - "type": "string", - "format": "uuid", - "description": "Task ID for request tracking and the [Stop Completion Message Generation](/en/api-reference/completion-messages/stop-completion-message-generation) API." + "type": { + "$ref": "#/components/schemas/ValueSourceType" }, - "id": { - "type": "string", - "format": "uuid", - "description": "Unique ID of this response event." + "value": { + "default": "", + "title": "Value", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "StringSource", + "type": "object" + }, + "SystemParameters": { + "properties": { + "audio_file_size_limit": { + "title": "Audio File Size Limit", + "type": "integer" }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "Unique message ID. Use this as the `message_id` parameter when calling feedback or suggested questions endpoints." + "file_size_limit": { + "title": "File Size Limit", + "type": "integer" }, - "mode": { - "type": "string", - "description": "App mode, fixed as `completion`." + "image_file_size_limit": { + "title": "Image File Size Limit", + "type": "integer" }, - "answer": { - "type": "string", - "description": "Complete response content." + "video_file_size_limit": { + "title": "Video File Size Limit", + "type": "integer" }, - "metadata": { - "type": "object", - "description": "Metadata including usage and retriever resources.", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" - }, - "retriever_resources": { - "type": "array", - "description": "List of retriever resources used.", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } - } - } + "workflow_file_upload_limit": { + "title": "Workflow File Upload Limit", + "type": "integer" + } + }, + "required": [ + "audio_file_size_limit", + "file_size_limit", + "image_file_size_limit", + "video_file_size_limit", + "workflow_file_upload_limit" + ], + "title": "SystemParameters", + "type": "object" + }, + "TagBindingPayload": { + "properties": { + "tag_ids": { + "description": "Tag IDs to bind.", + "items": { + "type": "string" + }, + "minItems": 1, + "title": "Tag Ids", + "type": "array" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Message creation timestamp (Unix epoch seconds)." + "target_id": { + "description": "Knowledge base ID to bind the tags to.", + "title": "Target Id", + "type": "string" } - } + }, + "required": [ + "tag_ids", + "target_id" + ], + "title": "TagBindingPayload", + "type": "object" }, - "ChunkCompletionEvent": { - "type": "object", + "TagCreatePayload": { "properties": { - "event": { - "type": "string", - "enum": [ - "message", - "message_end", - "message_file", - "tts_message", - "tts_message_end", - "message_replace", - "error", - "ping" - ], - "description": "The type of streaming event." + "name": { + "description": "Tag name.", + "maxLength": 50, + "minLength": 1, + "title": "Name", + "type": "string" } }, - "discriminator": { - "propertyName": "event", - "mapping": { - "message": "#/components/schemas/StreamEventMessage", - "message_end": "#/components/schemas/StreamEventMessageEnd", - "message_file": "#/components/schemas/StreamEventMessageFile", - "tts_message": "#/components/schemas/CompletionStreamEventTtsMessage", - "tts_message_end": "#/components/schemas/CompletionStreamEventTtsMessageEnd", - "message_replace": "#/components/schemas/StreamEventMessageReplace", - "error": "#/components/schemas/CompletionStreamEventError", - "ping": "#/components/schemas/CompletionStreamEventPing" + "required": [ + "name" + ], + "title": "TagCreatePayload", + "type": "object" + }, + "TagDeletePayload": { + "properties": { + "tag_id": { + "description": "Tag ID to delete.", + "title": "Tag Id", + "type": "string" } - } + }, + "required": [ + "tag_id" + ], + "title": "TagDeletePayload", + "type": "object" }, - "StreamEventMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" - }, + "TagUnbindingPayload": { + "anyOf": [ { - "type": "object", - "description": "LLM returns text chunk event.", "properties": { - "answer": { - "type": "string", - "description": "LLM returned text chunk content." + "tag_id": { + "deprecated": true, + "description": "Legacy single tag ID accepted by the Service API.", + "type": "string" + }, + "tag_ids": { + "description": "Tag IDs to unbind. Use this for new integrations.", + "items": { + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "target_id": { + "description": "Knowledge base ID.", + "title": "Target Id", + "type": "string" } - } - } - ] - }, - "StreamEventMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + }, + "required": [ + "tag_id", + "target_id" + ], + "type": "object" }, { - "type": "object", - "description": "Message end event, receiving this event means streaming has ended.", "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Unique message ID." - }, - "metadata": { - "type": "object", - "description": "Metadata including usage and retriever resources.", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" + "tag_id": { + "anyOf": [ + { + "type": "string" }, - "retriever_resources": { - "type": "array", - "description": "List of retriever resources used.", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } + { + "type": "null" } - } + ], + "deprecated": true, + "description": "Legacy single tag ID accepted by the Service API." }, - "files": { - "type": "array", - "nullable": true, - "description": "Files generated during this message, such as model-generated images. `null` when no files were produced.", + "tag_ids": { + "description": "Tag IDs to unbind. Use this for new integrations.", "items": { - "type": "object", - "properties": { - "related_id": { - "type": "string", - "description": "ID of the message file record." - }, - "type": { - "type": "string", - "description": "File type, e.g. `image`." - }, - "filename": { - "type": "string", - "description": "File name." - }, - "extension": { - "type": "string", - "description": "File extension, including the leading dot, e.g. `.png`." - }, - "mime_type": { - "type": "string", - "description": "MIME type of the file." - }, - "size": { - "type": "integer", - "description": "File size in bytes." - }, - "transfer_method": { - "type": "string", - "description": "How the file is referenced: `remote_url`, `local_file`, or `tool_file`." - }, - "url": { - "type": "string", - "description": "Accessible URL of the file." - }, - "upload_file_id": { - "type": "string", - "description": "ID of the associated uploaded file." - }, - "remote_url": { - "type": "string", - "nullable": true, - "description": "Original remote URL when the file was supplied as a remote URL; otherwise an empty string." - } - } - } + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "target_id": { + "description": "Knowledge base ID.", + "title": "Target Id", + "type": "string" } - } + }, + "required": [ + "tag_ids", + "target_id" + ], + "type": "object" } - ] + ], + "description": "Accepts either the legacy tag_id payload or the normalized tag_ids payload.", + "title": "TagUnbindingPayload" }, - "StreamEventMessageFile": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "TagUpdatePayload": { + "properties": { + "name": { + "description": "Tag name.", + "maxLength": 50, + "minLength": 1, + "title": "Name", + "type": "string" }, - { - "type": "object", - "description": "Message file event, a file (typically a model-generated image) produced during generation.", - "properties": { - "id": { - "type": "string", + "tag_id": { + "description": "Tag ID to update.", + "title": "Tag Id", + "type": "string" + } + }, + "required": [ + "name", + "tag_id" + ], + "title": "TagUpdatePayload", + "type": "object" + }, + "TextToAudioPayload": { + "properties": { + "message_id": { + "anyOf": [ + { "format": "uuid", - "description": "File unique ID." + "type": "string" }, - "type": { - "type": "string", - "description": "File type, e.g. `image`." + { + "type": "null" + } + ], + "default": null, + "description": "Message ID. Takes priority over `text` when both are provided.", + "title": "Message Id" + }, + "streaming": { + "anyOf": [ + { + "type": "boolean" }, - "belongs_to": { - "type": "string", - "enum": [ - "assistant" - ], - "description": "Who this file belongs to, always `assistant` here." + { + "type": "null" + } + ], + "default": null, + "description": "Reserved for compatibility; TTS response streaming is determined by the provider output.", + "title": "Streaming" + }, + "text": { + "anyOf": [ + { + "type": "string" }, - "url": { - "type": "string", - "format": "url", - "description": "Remote URL of the file." + { + "type": "null" } - } + ], + "default": null, + "description": "Speech content to convert.", + "title": "Text" + }, + "voice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Voice to use for text-to-speech. Available voices depend on the TTS provider configured for this app. Omit to use the app's configured voice when available; that value is exposed by [Get App Parameters](/en/api-reference/applications/get-app-parameters) as `text_to_speech.voice`.", + "title": "Voice" } - ] + }, + "title": "TextToAudioPayload", + "type": "object" }, - "StreamEventMessageReplace": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "TextToAudioPayloadWithUser": { + "properties": { + "message_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Message ID. Takes priority over `text` when both are provided.", + "title": "Message Id" }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + "streaming": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Reserved for compatibility; TTS response streaming is determined by the provider output.", + "title": "Streaming" }, - { - "type": "object", - "description": "Message content replacement event (e.g., due to content moderation).", - "properties": { - "answer": { - "type": "string", - "description": "Replacement content." + "text": { + "anyOf": [ + { + "type": "string" }, - "reason": { - "type": "string", - "description": "Reason for the content replacement." + { + "type": "null" } - } + ], + "default": null, + "description": "Speech content to convert.", + "title": "Text" + }, + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" + }, + "voice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Voice to use for text-to-speech. Available voices depend on the TTS provider configured for this app. Omit to use the app's configured voice when available; that value is exposed by [Get App Parameters](/en/api-reference/applications/get-app-parameters) as `text_to_speech.voice`.", + "title": "Voice" } - ] + }, + "title": "TextToAudioPayload", + "type": "object" }, - "CompletionStreamEventBase": { - "type": "object", + "ToolIcon": { "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "Task ID." - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "Unique message ID." + "background": { + "title": "Background", + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Creation timestamp." + "content": { + "title": "Content", + "type": "string" } - } + }, + "required": [ + "background", + "content" + ], + "title": "ToolIcon", + "type": "object" }, - "CompletionStreamEventTtsMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" - }, - { - "type": "object", - "description": "TTS audio stream event (base64 encoded MP3). Available if auto-play is enabled.", - "properties": { - "audio": { - "type": "string", - "format": "byte", - "description": "Base64-encoded MP3 audio chunk. Decode and concatenate all chunks in order to produce a complete audio file." - } - } + "UrlResponse": { + "properties": { + "url": { + "title": "Url", + "type": "string" } - ] + }, + "required": [ + "url" + ], + "title": "UrlResponse", + "type": "object" }, - "CompletionStreamEventTtsMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "UserActionConfig": { + "description": "User action configuration.", + "properties": { + "button_style": { + "$ref": "#/components/schemas/ButtonStyle", + "default": "default" }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + "id": { + "maxLength": 20, + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "title": "Id", + "type": "string" }, - { - "type": "object", - "description": "TTS audio stream end event.", - "properties": { - "audio": { - "type": "string", - "description": "Empty string. Signals the end of the audio stream." - } - } + "title": { + "maxLength": 100, + "title": "Title", + "type": "string" } - ] + }, + "required": [ + "id", + "title" + ], + "title": "UserActionConfig", + "type": "object" }, - "CompletionStreamEventError": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + "ValueSourceType": { + "description": "ValueSourceType records whether the value comes from a static setting\nin form definition, or a variable while the workflow is running.", + "enum": [ + "constant", + "variable" + ], + "title": "ValueSourceType", + "type": "string" + }, + "WeightKeywordSetting": { + "properties": { + "keyword_weight": { + "description": "Weight assigned to keyword search results.", + "title": "Keyword Weight", + "type": "number" + } + }, + "required": [ + "keyword_weight" + ], + "title": "WeightKeywordSetting", + "type": "object" + }, + "WeightModel": { + "properties": { + "keyword_setting": { + "anyOf": [ + { + "$ref": "#/components/schemas/WeightKeywordSetting" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Keyword search weight settings." }, - { - "type": "object", - "description": "Error event during streaming.", - "properties": { - "status": { - "type": "integer", - "description": "HTTP status code." + "vector_setting": { + "anyOf": [ + { + "$ref": "#/components/schemas/WeightVectorSetting" }, - "code": { - "type": "string", - "description": "Error code." + { + "type": "null" + } + ], + "default": null, + "description": "Semantic search weight settings." + }, + "weight_type": { + "anyOf": [ + { + "enum": [ + "customized", + "keyword_first", + "semantic_first" + ], + "type": "string" }, - "message": { - "type": "string", - "description": "Error message." + { + "type": "null" } - } + ], + "default": null, + "description": "Strategy for balancing semantic and keyword search weights.", + "title": "Weight Type" } - ] + }, + "title": "WeightModel", + "type": "object" }, - "CompletionStreamEventPing": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "WeightVectorSetting": { + "properties": { + "embedding_model_name": { + "description": "Name of the embedding model used for vector search.", + "title": "Embedding Model Name", + "type": "string" }, - { - "type": "object", - "description": "Ping event to keep connection alive. Delivered as an `event: ping` line with no `data:` payload." + "embedding_provider_name": { + "description": "Provider of the embedding model used for vector search.", + "title": "Embedding Provider Name", + "type": "string" + }, + "vector_weight": { + "description": "Weight assigned to semantic vector search results.", + "title": "Vector Weight", + "type": "number" } - ] + }, + "required": [ + "embedding_model_name", + "embedding_provider_name", + "vector_weight" + ], + "title": "WeightVectorSetting", + "type": "object" }, - "Dataset": { - "type": "object", + "WorkflowAppLogPaginationResponse": { "properties": { - "id": { - "type": "string", - "description": "Unique identifier of the knowledge base." - }, - "name": { - "type": "string", - "description": "Display name of the knowledge base. Unique within the workspace." - }, - "description": { - "type": "string", - "description": "Optional text describing the purpose or contents of the knowledge base." - }, - "provider": { - "type": "string", - "description": "Provider type. `vendor` for internally managed, `external` for external knowledge base connections." - }, - "permission": { - "type": "string", - "description": "Controls who can access this knowledge base. Possible values: `only_me`, `all_team_members`, `partial_members`." - }, - "data_source_type": { - "type": "string", - "description": "Data source type of the documents, `null` if not yet configured." - }, - "indexing_technique": { - "type": "string", - "description": "`high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing." - }, - "app_count": { - "type": "integer", - "description": "Number of applications currently using this knowledge base." - }, - "document_count": { - "type": "integer", - "description": "Total number of documents in the knowledge base." + "data": { + "items": { + "$ref": "#/components/schemas/WorkflowAppLogPartialResponse" + }, + "title": "Data", + "type": "array" }, - "word_count": { - "type": "integer", - "description": "Total word count across all documents." + "has_more": { + "title": "Has More", + "type": "boolean" }, - "created_by": { - "type": "string", - "description": "ID of the user who created the knowledge base." + "limit": { + "title": "Limit", + "type": "integer" }, - "author_name": { - "type": "string", - "description": "Display name of the creator." + "page": { + "title": "Page", + "type": "integer" }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "title": "WorkflowAppLogPaginationResponse", + "type": "object" + }, + "WorkflowAppLogPartialResponse": { + "properties": { "created_at": { - "type": "number", - "description": "Creation timestamp (Unix epoch in seconds)." - }, - "updated_by": { - "type": "string", - "description": "ID of the user who last updated the knowledge base." - }, - "updated_at": { - "type": "number", - "description": "Last update timestamp (Unix epoch in seconds)." - }, - "embedding_model": { - "type": "string", - "description": "Name of the embedding model used for indexing." - }, - "embedding_model_provider": { - "type": "string", - "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). Legacy knowledge bases may return the bare short form (e.g. `openai`)." - }, - "embedding_available": { - "type": "boolean", - "description": "Whether the configured embedding model is currently available." - }, - "retrieval_model_dict": { - "type": "object", - "description": "Retrieval configuration for the knowledge base.", - "properties": { - "search_method": { - "type": "string", - "description": "Search method used for retrieval. `keyword_search` for keyword matching, `semantic_search` for embedding-based similarity, `full_text_search` for full-text indexing, `hybrid_search` for a combination of semantic and keyword approaches." - }, - "reranking_enable": { - "type": "boolean", - "description": "Whether reranking is enabled." - }, - "reranking_mode": { - "type": "string", - "nullable": true, - "description": "Reranking mode. `reranking_model` for model-based reranking, `weighted_score` for score-based weighting. `null` if reranking is disabled." - }, - "reranking_model": { - "type": "object", - "description": "Reranking model configuration.", - "properties": { - "reranking_provider_name": { - "type": "string", - "description": "Reranking model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/cohere/cohere`). Legacy knowledge bases may return the bare short form (e.g. `cohere`)." - }, - "reranking_model_name": { - "type": "string", - "description": "Name of the reranking model." - } - } - }, - "weights": { - "type": "object", - "nullable": true, - "description": "Weight configuration for hybrid search.", - "properties": { - "weight_type": { - "type": "string", - "description": "Strategy for balancing semantic and keyword search weights." - }, - "vector_setting": { - "type": "object", - "description": "Semantic search weight settings.", - "properties": { - "vector_weight": { - "type": "number", - "description": "Weight assigned to semantic (vector) search results." - }, - "embedding_provider_name": { - "type": "string", - "description": "Provider of the embedding model used for vector search." - }, - "embedding_model_name": { - "type": "string", - "description": "Name of the embedding model used for vector search." - } - } - }, - "keyword_setting": { - "type": "object", - "description": "Keyword search weight settings.", - "properties": { - "keyword_weight": { - "type": "number", - "description": "Weight assigned to keyword search results." - } - } - } - } - }, - "top_k": { - "type": "integer", - "description": "Maximum number of results to return." - }, - "score_threshold_enabled": { - "type": "boolean", - "description": "Whether score threshold filtering is enabled." + "anyOf": [ + { + "format": "int64", + "type": "integer" }, - "score_threshold": { - "type": "number", - "description": "Minimum similarity score for results. Only effective when `score_threshold_enabled` is `true`." + { + "type": "null" } - } + ], + "default": null, + "title": "Created At" }, - "summary_index_setting": { - "type": "object", - "nullable": true, - "description": "Summary index configuration.", - "properties": { - "enable": { - "type": "boolean", - "description": "Whether summary indexing is enabled." - }, - "model_name": { - "type": "string", - "description": "Name of the model used for generating summaries." + "created_by_account": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleAccountResponse" }, - "model_provider_name": { - "type": "string", - "description": "Provider of the summary generation model." + { + "type": "null" + } + ], + "default": null + }, + "created_by_end_user": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleEndUser" }, - "summary_prompt": { - "type": "string", - "description": "Prompt template used for summary generation." + { + "type": "null" } - } + ], + "default": null }, - "tags": { - "type": "array", - "description": "Tags associated with this knowledge base.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Tag identifier." - }, - "name": { - "type": "string", - "description": "Tag name." - }, - "type": { - "type": "string", - "description": "Tag type. Always `knowledge` for knowledge base tags." - } + "created_by_role": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Created By Role" }, - "doc_form": { - "type": "string", - "description": "Document chunking mode. `text_model` for standard text chunking, `hierarchical_model` for parent-child structure, `qa_model` for QA pair extraction." + "created_from": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created From" }, - "external_knowledge_info": { - "type": "object", - "nullable": true, - "description": "Connection details for external knowledge bases. Present when `provider` is `external`.", - "properties": { - "external_knowledge_id": { - "type": "string", - "description": "ID of the external knowledge base." + "details": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "items": {}, + "type": "array" }, - "external_knowledge_api_id": { - "type": "string", - "description": "ID of the external knowledge API connection." + { + "type": "string" }, - "external_knowledge_api_name": { - "type": "string", - "description": "Display name of the external knowledge API." + { + "type": "integer" }, - "external_knowledge_api_endpoint": { - "type": "string", - "description": "Endpoint URL of the external knowledge API." - } - } - }, - "external_retrieval_model": { - "type": "object", - "nullable": true, - "description": "Retrieval settings for external knowledge bases. `null` for internal knowledge bases.", - "properties": { - "top_k": { - "type": "integer", - "description": "Maximum number of results to return from the external knowledge base." + { + "type": "number" }, - "score_threshold": { - "type": "number", - "description": "Minimum similarity score threshold." + { + "type": "boolean" }, - "score_threshold_enabled": { - "type": "boolean", - "description": "Whether score threshold filtering is enabled." + { + "type": "null" } - } + ], + "default": null, + "title": "Details" }, - "doc_metadata": { - "type": "array", - "description": "Metadata field definitions for the knowledge base.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Metadata field identifier." - }, - "name": { - "type": "string", - "description": "Metadata field name." - }, - "type": { - "type": "string", - "description": "Metadata field value type." - } - } - } + "id": { + "format": "uuid", + "title": "Id", + "type": "string" }, - "built_in_field_enabled": { - "type": "boolean", - "description": "Whether built-in metadata fields (e.g., `document_name`, `uploader`) are enabled." + "workflow_run": { + "anyOf": [ + { + "$ref": "#/components/schemas/WorkflowRunForLogResponse" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id" + ], + "title": "WorkflowAppLogPartialResponse", + "type": "object" + }, + "WorkflowEventsQuery": { + "properties": { + "continue_on_pause": { + "default": false, + "description": "Set to `true` to keep the stream open across multiple `workflow_paused` events, which is useful when the workflow has more than one Human Input node in sequence. By default, the stream closes after the first pause.", + "title": "Continue On Pause", + "type": "boolean" }, - "pipeline_id": { - "type": "string", - "nullable": true, - "description": "Pipeline ID, if a custom processing pipeline is configured." + "include_state_snapshot": { + "default": false, + "description": "When `true`, replay from the persisted state snapshot to include a status summary of already-executed nodes before streaming new events.", + "title": "Include State Snapshot", + "type": "boolean" }, - "runtime_mode": { - "type": "string", - "nullable": true, - "description": "Runtime processing mode." + "user": { + "description": "End-user identifier that originally triggered the run. Must match the creator of the run.", + "title": "User", + "type": "string" + } + }, + "required": [ + "user" + ], + "title": "WorkflowEventsQuery", + "type": "object" + }, + "WorkflowFinishedBlockingDataResponse": { + "additionalProperties": true, + "properties": { + "created_at": { + "format": "int64", + "title": "Created At", + "type": "integer" }, - "chunk_structure": { - "type": "string", - "nullable": true, - "description": "Chunk structure configuration." + "elapsed_time": { + "format": "float", + "title": "Elapsed Time", + "type": "number" }, - "icon_info": { - "type": "object", - "nullable": true, - "description": "Icon display configuration for the knowledge base.", - "properties": { - "icon_type": { - "type": "string", - "description": "Type of icon." - }, - "icon": { - "type": "string", - "description": "Icon identifier or emoji." - }, - "icon_background": { - "type": "string", - "description": "Background color for the icon." + "error": { + "anyOf": [ + { + "type": "string" }, - "icon_url": { - "type": "string", - "description": "URL of a custom icon image." + { + "type": "null" } - } + ], + "title": "Error" }, - "is_published": { - "type": "boolean", - "description": "Whether the knowledge base is published." + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Finished At" }, - "total_documents": { - "type": "integer", - "description": "Total number of documents." + "id": { + "format": "uuid", + "title": "Id", + "type": "string" }, - "total_available_documents": { - "type": "integer", - "description": "Number of documents that are enabled and available." + "outputs": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Outputs" }, - "enable_api": { - "type": "boolean", - "description": "Whether API access is enabled for this knowledge base." + "status": { + "enum": [ + "failed", + "partial-succeeded", + "stopped", + "succeeded" + ], + "title": "Status", + "type": "string" }, - "is_multimodal": { - "type": "boolean", - "description": "Whether multimodal content processing is enabled." + "total_steps": { + "title": "Total Steps", + "type": "integer" }, - "maintainer": { - "type": "string", - "nullable": true, - "description": "Display name of the knowledge base maintainer. `null` if not set." + "total_tokens": { + "title": "Total Tokens", + "type": "integer" }, - "partial_member_list": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - }, - "description": "Account IDs of members granted access when `permission` is `partial_members`. Always present on the update response; on the detail response, present only when `permission` is `partial_members`." + "workflow_id": { + "format": "uuid", + "title": "Workflow Id", + "type": "string" } - } + }, + "required": [ + "created_at", + "elapsed_time", + "error", + "finished_at", + "id", + "outputs", + "status", + "total_steps", + "total_tokens", + "workflow_id" + ], + "title": "WorkflowFinishedBlockingDataResponse", + "type": "object" }, - "Document": { - "type": "object", + "WorkflowFinishedBlockingResponse": { + "additionalProperties": true, "properties": { - "id": { - "type": "string", - "description": "Unique identifier of the document." - }, - "position": { - "type": "integer", - "description": "Display position of the document in the list." - }, - "data_source_type": { - "type": "string", - "description": "How the document was created. `upload_file` for file uploads, `notion_import` for Notion imports." + "data": { + "$ref": "#/components/schemas/WorkflowFinishedBlockingDataResponse" }, - "data_source_info": { - "type": "object", - "description": "Raw data source information, varies by `data_source_type`." + "task_id": { + "format": "uuid", + "title": "Task Id", + "type": "string" }, - "data_source_detail_dict": { - "type": "object", - "description": "Detailed data source information including file details." + "workflow_run_id": { + "format": "uuid", + "title": "Workflow Run Id", + "type": "string" + } + }, + "required": [ + "data", + "task_id", + "workflow_run_id" + ], + "title": "WorkflowFinishedBlockingResponse", + "type": "object" + }, + "WorkflowLogQuery": { + "properties": { + "created_at__after": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Filter logs created after this ISO 8601 timestamp.", + "format": "date-time", + "title": "Created At After" }, - "dataset_process_rule_id": { - "type": "string", - "description": "ID of the processing rule applied to this document." + "created_at__before": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Filter logs created before this ISO 8601 timestamp.", + "format": "date-time", + "title": "Created At Before" }, - "name": { - "type": "string", - "description": "Document name." + "created_by_account": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Filter by account ID.", + "title": "Created By Account" }, - "created_from": { - "type": "string", - "description": "Origin of the document. `api` for API creation, `web` for UI creation." + "created_by_end_user_session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Filter by end user session ID.", + "title": "Created By End User Session Id" }, - "created_by": { - "type": "string", - "description": "ID of the user who created the document." + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Keyword to search in logs.", + "title": "Keyword" }, - "created_at": { - "type": "number", - "description": "Creation timestamp (Unix epoch in seconds)." + "limit": { + "default": 20, + "description": "Number of items per page.", + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" }, - "tokens": { - "type": "integer", - "description": "Total number of tokens in the document." + "page": { + "default": 1, + "description": "Page number for pagination.", + "maximum": 99999, + "minimum": 1, + "title": "Page", + "type": "integer" }, - "indexing_status": { - "type": "string", - "description": "Current indexing status. `waiting` for queued, `parsing` while extracting content, `cleaning` while removing noise, `splitting` while chunking, `indexing` while building vectors, `completed` when ready, `error` if failed, `paused` if manually paused." + "status": { + "anyOf": [ + { + "enum": [ + "failed", + "stopped", + "succeeded" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Filter by execution status.", + "title": "Status" + } + }, + "title": "WorkflowLogQuery", + "type": "object" + }, + "WorkflowPauseReasonResponse": { + "additionalProperties": true, + "description": "Public pause reason emitted by a blocking Workflow execution.", + "properties": { + "TYPE": { + "title": "Type", + "type": "string" }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if indexing failed. `null` when no error." + "actions": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "title": "Actions", + "type": "array" }, - "enabled": { - "type": "boolean", - "description": "Whether the document is enabled for retrieval." + "approval_channels": { + "items": { + "type": "string" + }, + "title": "Approval Channels", + "type": "array" }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when the document was disabled. `null` if enabled." + "display_in_ui": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Display In Ui" }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "ID of the user who disabled the document. `null` if enabled." + "expiration_time": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Expiration Time" }, - "archived": { - "type": "boolean", - "description": "Whether the document is archived." + "form_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Form Content" }, - "display_status": { - "type": "string", - "description": "User-facing display status derived from `indexing_status` and `enabled` state." + "form_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Form Id" }, - "word_count": { - "type": "integer", - "description": "Total word count of the document." + "form_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Form Token" }, - "hit_count": { - "type": "integer", - "description": "Number of times the document has been matched in retrieval queries." + "inputs": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "title": "Inputs", + "type": "array" }, - "doc_form": { - "type": "string", - "description": "Document chunking mode. `text_model` for standard text chunking, `hierarchical_model` for parent-child structure, `qa_model` for QA pair extraction." + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Message" }, - "doc_metadata": { - "type": "array", - "description": "Metadata values assigned to this document.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Metadata field identifier." - }, - "name": { - "type": "string", - "description": "Metadata field name." - }, - "type": { - "type": "string", - "description": "Metadata field value type." - }, - "value": { - "type": "string", - "description": "Metadata value for this document." - } + "node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Node Id" }, - "summary_index_status": { - "type": "string", - "nullable": true, - "description": "Status of the summary index for this document. `null` if summary indexing is not configured." + "node_title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Node Title" }, - "need_summary": { - "type": "boolean", - "description": "Whether a summary needs to be generated for this document." + "resolved_default_values": { + "additionalProperties": true, + "title": "Resolved Default Values", + "type": "object" } - } + }, + "required": [ + "TYPE" + ], + "title": "WorkflowPauseReasonResponse", + "type": "object" }, - "Segment": { - "type": "object", + "WorkflowPausedBlockingDataResponse": { + "additionalProperties": true, "properties": { - "id": { - "type": "string", - "description": "Unique identifier of the chunk." - }, - "position": { - "type": "integer", - "description": "Position of the chunk within the document." - }, - "document_id": { - "type": "string", - "description": "ID of the document this chunk belongs to." + "created_at": { + "format": "int64", + "title": "Created At", + "type": "integer" }, - "content": { - "type": "string", - "description": "Text content of the chunk." + "elapsed_time": { + "format": "float", + "title": "Elapsed Time", + "type": "number" }, - "sign_content": { - "type": "string", - "description": "Signed content hash for integrity verification." + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" }, - "answer": { - "type": "string", - "description": "Answer content, used in Q&A mode documents." + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Finished At" }, - "word_count": { - "type": "integer", - "description": "Word count of the chunk content." + "id": { + "format": "uuid", + "title": "Id", + "type": "string" }, - "tokens": { - "type": "integer", - "description": "Token count of the chunk content." + "outputs": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Outputs" }, - "keywords": { - "type": "array", - "description": "Keywords associated with this chunk for keyword-based retrieval.", + "paused_nodes": { "items": { "type": "string" - } + }, + "title": "Paused Nodes", + "type": "array" }, - "index_node_id": { - "type": "string", - "description": "ID of the index node in the vector store." + "reasons": { + "items": { + "$ref": "#/components/schemas/WorkflowPauseReasonResponse" + }, + "title": "Reasons", + "type": "array" }, - "index_node_hash": { - "type": "string", - "description": "Hash of the indexed content, used to detect changes." + "status": { + "const": "paused", + "title": "Status", + "type": "string" }, - "hit_count": { - "type": "integer", - "description": "Number of times this chunk has been matched in retrieval queries." + "total_steps": { + "title": "Total Steps", + "type": "integer" }, - "enabled": { - "type": "boolean", - "description": "Whether the chunk is enabled for retrieval." + "total_tokens": { + "title": "Total Tokens", + "type": "integer" }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when the chunk was disabled. `null` if enabled." + "workflow_id": { + "format": "uuid", + "title": "Workflow Id", + "type": "string" + } + }, + "required": [ + "created_at", + "elapsed_time", + "error", + "finished_at", + "id", + "outputs", + "paused_nodes", + "reasons", + "status", + "total_steps", + "total_tokens", + "workflow_id" + ], + "title": "WorkflowPausedBlockingDataResponse", + "type": "object" + }, + "WorkflowPausedBlockingResponse": { + "additionalProperties": true, + "properties": { + "data": { + "$ref": "#/components/schemas/WorkflowPausedBlockingDataResponse" }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "ID of the user who disabled the chunk. `null` if enabled." + "task_id": { + "format": "uuid", + "title": "Task Id", + "type": "string" }, - "status": { - "type": "string", - "description": "Current indexing status of the chunk, e.g. `completed`, `indexing`, `error`." + "workflow_run_id": { + "format": "uuid", + "title": "Workflow Run Id", + "type": "string" + } + }, + "required": [ + "data", + "task_id", + "workflow_run_id" + ], + "title": "WorkflowPausedBlockingResponse", + "type": "object" + }, + "WorkflowRunForLogResponse": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" }, - "created_by": { - "type": "string", - "description": "ID of the user who created the chunk." + "elapsed_time": { + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Elapsed Time" }, - "created_at": { - "type": "number", - "description": "Creation timestamp (Unix epoch in seconds)." + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Error" }, - "updated_at": { - "type": "number", - "description": "Last update timestamp (Unix epoch in seconds)." + "exceptions_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Exceptions Count" }, - "updated_by": { - "type": "string", - "description": "ID of the user who last updated the chunk." + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Finished At" }, - "indexing_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when indexing started. `null` if not yet started." + "id": { + "format": "uuid", + "title": "Id", + "type": "string" }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when indexing completed. `null` if not yet completed." + "status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Status" }, - "error": { - "type": "string", - "nullable": true, - "description": "Error message if indexing failed. `null` when no error." + "total_steps": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Total Steps" }, - "stopped_at": { - "type": "number", - "nullable": true, - "description": "Timestamp when indexing was stopped. `null` if not stopped." + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Total Tokens" }, - "child_chunks": { - "type": "array", - "description": "Child chunks belonging to this chunk. Only present for hierarchical mode documents.", - "items": { - "$ref": "#/components/schemas/ChildChunk" - } + "triggered_from": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Triggered From" }, - "attachments": { - "type": "array", - "description": "Files attached to this chunk.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Attachment file identifier." - }, - "name": { - "type": "string", - "description": "Original file name." - }, - "size": { - "type": "integer", - "description": "File size in bytes." - }, - "extension": { - "type": "string", - "description": "File extension." - }, - "mime_type": { - "type": "string", - "description": "MIME type of the file." + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Version" + } + }, + "required": [ + "id" + ], + "title": "WorkflowRunForLogResponse", + "type": "object" + }, + "WorkflowRunPayload": { + "properties": { + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" }, - "source_url": { - "type": "string", - "description": "URL to access the attachment." - } + "type": "array" + }, + { + "type": "null" } - } + ], + "default": null, + "description": "File list for workflow system file inputs. Available when file upload is enabled for the workflow. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`.", + "title": "Files" }, - "summary": { - "type": "string", - "nullable": true, - "description": "AI-generated summary of the chunk content. `null` if summary indexing is not enabled." + "inputs": { + "additionalProperties": true, + "description": "Key-value pairs for workflow input variables. Values for file-type variables should be arrays of file objects with `type`, `transfer_method`, and either `url` or `upload_file_id`. Refer to the `user_input_form` field in the [Get App Parameters](/en/api-reference/applications/get-app-parameters) response to discover the variable names and types expected by your app.", + "title": "Inputs", + "type": "object" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Response mode. Use `blocking` for synchronous responses or `streaming` for Server-Sent Events. When omitted, the request runs in blocking mode.", + "title": "Response Mode" } - } + }, + "required": [ + "inputs" + ], + "title": "WorkflowRunPayload", + "type": "object" }, - "ChildChunk": { - "type": "object", + "WorkflowRunPayloadWithUser": { "properties": { - "id": { - "type": "string", - "description": "Unique identifier of the child chunk." - }, - "segment_id": { - "type": "string", - "description": "ID of the parent chunk this child chunk belongs to." - }, - "content": { - "type": "string", - "description": "Text content of the child chunk." - }, - "position": { - "type": "integer", - "description": "Position of the child chunk within the parent chunk." - }, - "word_count": { - "type": "integer", - "description": "Word count of the child chunk content." + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "description": "Legacy alias of `url` when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + }, + "transfer_method": { + "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "File type.", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "type": "string" + }, + "url": { + "description": "File URL when `transfer_method` is `remote_url`.", + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "File list for workflow system file inputs. Available when file upload is enabled for the workflow. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`.", + "title": "Files" }, - "type": { - "type": "string", - "description": "How the child chunk was created. Child chunks created or updated through the API are always `customized`. System-generated child chunks are `automatic`." + "inputs": { + "additionalProperties": true, + "description": "Key-value pairs for workflow input variables. Values for file-type variables should be arrays of file objects with `type`, `transfer_method`, and either `url` or `upload_file_id`. Refer to the `user_input_form` field in the [Get App Parameters](/en/api-reference/applications/get-app-parameters) response to discover the variable names and types expected by your app.", + "title": "Inputs", + "type": "object" }, - "created_at": { - "type": "number", - "description": "Creation timestamp (Unix epoch in seconds)." + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Response mode. Use `blocking` for synchronous responses or `streaming` for Server-Sent Events. When omitted, the request runs in blocking mode.", + "title": "Response Mode" }, - "updated_at": { - "type": "number", - "description": "Last update timestamp (Unix epoch in seconds)." + "user": { + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "type": "string" } - } - }, - "RetrievalModel": { - "type": "object", + }, "required": [ - "search_method", - "reranking_enable", - "top_k", - "score_threshold_enabled" + "inputs", + "user" ], + "title": "WorkflowRunPayload", + "type": "object" + }, + "WorkflowRunResponse": { "properties": { - "search_method": { - "type": "string", - "description": "Search method used for retrieval.", - "enum": [ - "keyword_search", - "semantic_search", - "full_text_search", - "hybrid_search" - ] + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Created At" }, - "reranking_enable": { - "type": "boolean", - "description": "Whether reranking is enabled." + "elapsed_time": { + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Elapsed Time" }, - "reranking_model": { - "type": "object", - "description": "Reranking model configuration.", - "properties": { - "reranking_provider_name": { - "type": "string", - "description": "Reranking model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/cohere/cohere`). A bare name like `cohere` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=rerank`." + "error": { + "anyOf": [ + { + "type": "string" }, - "reranking_model_name": { - "type": "string", - "description": "Name of the reranking model." + { + "type": "null" } - } + ], + "default": null, + "title": "Error" }, - "reranking_mode": { - "type": "string", - "enum": [ - "reranking_model", - "weighted_score" + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } ], - "nullable": true, - "description": "Reranking mode. Required when `reranking_enable` is `true`." + "default": null, + "title": "Finished At" }, - "top_k": { - "type": "integer", - "description": "Maximum number of results to return." + "id": { + "format": "uuid", + "title": "Id", + "type": "string" }, - "score_threshold_enabled": { - "type": "boolean", - "description": "Whether score threshold filtering is enabled." + "inputs": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "items": {}, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" }, - "score_threshold": { - "type": "number", - "nullable": true, - "description": "Minimum similarity score for results. Only effective when `score_threshold_enabled` is `true`." + "outputs": { + "additionalProperties": true, + "title": "Outputs", + "type": "object" }, - "weights": { - "type": "object", - "nullable": true, - "description": "Weight configuration for hybrid search.", - "properties": { - "weight_type": { - "type": "string", - "description": "Strategy for balancing semantic and keyword search weights.", - "enum": [ - "semantic_first", - "keyword_first", - "customized" - ] - }, - "vector_setting": { - "type": "object", - "description": "Semantic search weight settings.", - "properties": { - "vector_weight": { - "type": "number", - "description": "Weight assigned to semantic (vector) search results." - }, - "embedding_provider_name": { - "type": "string", - "description": "Provider of the embedding model used for vector search." - }, - "embedding_model_name": { - "type": "string", - "description": "Name of the embedding model used for vector search." - } - } + "status": { + "title": "Status", + "type": "string" + }, + "total_steps": { + "anyOf": [ + { + "type": "integer" }, - "keyword_setting": { - "type": "object", - "description": "Keyword search weight settings.", - "properties": { - "keyword_weight": { - "type": "number", - "description": "Weight assigned to keyword search results." - } - } + { + "type": "null" } - } + ], + "default": null, + "title": "Total Steps" }, - "metadata_filtering_conditions": { - "type": "object", - "nullable": true, - "description": "Restrict retrieval to chunks whose document metadata matches the given conditions. Conditions are evaluated server-side against document metadata fields.", - "properties": { - "logical_operator": { - "type": "string", - "enum": [ - "and", - "or" - ], - "default": "and", - "nullable": true, - "description": "How to combine multiple conditions." - }, - "conditions": { - "type": "array", - "nullable": true, - "description": "List of metadata conditions to evaluate.", - "items": { - "type": "object", - "required": [ - "name", - "comparison_operator" - ], - "properties": { - "name": { - "type": "string", - "description": "Metadata field name to compare against." - }, - "comparison_operator": { - "type": "string", - "description": "Comparison to apply, by metadata type:\n\n- String or array metadata: `contains`, `not contains`, `start with`, `end with`, `is`, `is not`, `empty`, `not empty`, `in`, `not in`\n- Numeric metadata: `=`, `≠`, `>`, `<`, `≥`, `≤`\n- Time metadata: `before`, `after`", - "enum": [ - "contains", - "not contains", - "start with", - "end with", - "is", - "is not", - "empty", - "not empty", - "in", - "not in", - "=", - "≠", - ">", - "<", - "≥", - "≤", - "before", - "after" - ] - }, - "value": { - "nullable": true, - "description": "Value to compare against. Type depends on `comparison_operator`: string for most string operators, array of strings for `in` and `not in`, number for numeric operators, and omitted for `empty` and `not empty`.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "number" - } - ] - } - } - } + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Total Tokens" + }, + "workflow_id": { + "format": "uuid", + "title": "Workflow Id", + "type": "string" } - } + }, + "required": [ + "id", + "status", + "workflow_id" + ], + "title": "WorkflowRunResponse", + "type": "object" } } } diff --git a/ja/api-reference/openapi_service.json b/ja/api-reference/openapi_service.json index 27ee391c16..d51a4e2d46 100644 --- a/ja/api-reference/openapi_service.json +++ b/ja/api-reference/openapi_service.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.1.0", "info": { "title": "Dify サービス API", "description": "Dify アプリケーションとナレッジベースのための REST API です。アプリケーション系エンドポイントはアプリの API キーで、ナレッジ系エンドポイントはナレッジベースの API キーで認証します。", @@ -19,7 +19,7 @@ ], "security": [ { - "ApiKeyAuth": [] + "Bearer": [] } ], "tags": [ @@ -97,11 +97,51 @@ } ], "paths": { + "/": { + "get": { + "operationId": "get_index_api", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndexInfoResponse" + }, + "examples": { + "response": { + "summary": "レスポンス例", + "value": { + "welcome": "Dify OpenAPI", + "api_version": "v1", + "server_version": "1.17.0" + } + } + } + } + }, + "description": "リクエストが成功しました。" + } + }, + "security": [], + "summary": "API 情報の取得", + "tags": [ + "アプリケーション設定" + ], + "description": "API キーを使用せずに、サービス API とサーバーのバージョンを取得します。", + "x-mint": { + "href": "/ja/api-reference/applications/get-api-information", + "metadata": { + "title": "API 情報の取得", + "sidebarTitle": "API 情報の取得" + } + } + } + }, "/chat-messages": { "post": { "summary": "チャットメッセージを送信", "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\nチャットアプリにメッセージを送信し、アシスタントの応答を返します。ストリーミングレスポンスのイベントはアプリタイプによって異なります。", - "operationId": "sendBasicChatMessageJa", + "operationId": "create_chat_message", "tags": [ "チャットメッセージ" ], @@ -111,7 +151,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChatRequest" + "$ref": "#/components/schemas/ChatRequestPayloadWithUser" }, "examples": { "streaming_example": { @@ -153,7 +193,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChatCompletionResponse" + "$ref": "#/components/schemas/ChatBlockingResponse" }, "examples": { "blockingResponse": { @@ -413,6 +453,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -435,7 +481,7 @@ "post": { "summary": "生成を停止", "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\nチャットメッセージ生成タスクを停止します。`streaming` モードでのみサポートされます。", - "operationId": "stopBasicChatMessageGenerationJa", + "operationId": "stop_chat_message", "tags": [ "チャットメッセージ" ], @@ -455,16 +501,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。元のメッセージ送信時に渡した `user` と一致する必要があります。一致しない場合、停止は行われず、成功が返されます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" - } - } + "$ref": "#/components/schemas/RequiredServiceApiUserPayload" }, "examples": { "example": { @@ -479,7 +516,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleResultResponse" + } + } + }, + "description": "リクエストが成功しました。" }, "400": { "description": "- `not_chat_app` : アプリモードが API ルートと一致しません。\n- `invalid_param` : 必須の `user` フィールドがありません。", @@ -505,6 +549,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -520,7 +582,7 @@ "get": { "summary": "次の推奨質問を取得", "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\nメッセージに対して提案されたフォローアップ質問を返します。", - "operationId": "getBasicChatSuggestedQuestionsJa", + "operationId": "get_suggested_questions", "tags": [ "チャットメッセージ" ], @@ -551,7 +613,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuggestedQuestionsResponse" + "$ref": "#/components/schemas/SimpleResultStringListResponse" }, "examples": { "suggestedQuestions": { @@ -627,6 +689,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-codeSamples": [ @@ -649,7 +723,7 @@ "post": { "summary": "ファイルをアップロード", "description": "**対象アプリ**:Chatflow、Workflow、新しい Agent、チャットボット、Agent、テキストジェネレーター。\n\nファイルをアップロードし、後続のリクエストから参照するための `id` を返します。ファイルはアップロードしたエンドユーザーに属し、同じ `user` を持つリクエストだけがそのファイルを参照できます。\n\nアプリが実際に扱えるファイル種別は、アプリのファイルアップロード設定によって決まります。[アプリケーションのパラメータ情報を取得](/ja/api-reference/applications/get-app-parameters) で確認できます。", - "operationId": "uploadBasicChatFileJa", + "operationId": "upload_file", "tags": [ "ファイル操作" ], @@ -684,11 +758,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileUploadResponse" + "$ref": "#/components/schemas/FileResponse" }, "examples": { "uploadSuccess": { - "summary": "Response Example", + "summary": "レスポンス例", "value": { "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab", "reference": null, @@ -785,6 +859,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -807,7 +893,7 @@ "get": { "summary": "ファイルをダウンロード", "description": "**対象アプリ**:Chatflow、チャットボット、Agent、テキストジェネレーター。\n\n以前 [ファイルをアップロード](/ja/api-reference/files/upload-file) が返したファイルの生のバイト列を返します。ファイルには、そのメッセージが参照しているアプリからのみアクセスできます。", - "operationId": "previewBasicChatFileJa", + "operationId": "preview_file", "tags": [ "ファイル操作" ], @@ -846,10 +932,10 @@ "200": { "description": "生のファイルコンテンツを返します。`Content-Type` ヘッダーはファイルの MIME タイプに設定されます。`as_attachment` が `true` の場合、ファイルは `Content-Disposition: attachment` としてダウンロード形式で返されます。", "content": { - "application/octet-stream": { + "*/*": { "schema": { - "type": "string", - "format": "binary" + "format": "binary", + "type": "string" } } } @@ -887,6 +973,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -902,7 +994,7 @@ "get": { "summary": "エンドユーザー取得", "description": "**対象アプリ**:Chatflow、Workflow、新しい Agent、チャットボット、Agent、テキストジェネレーター。\n\nID を指定してエンドユーザーの詳細を返します。別のエンドポイントが返したエンドユーザー ID(例:[ファイルをアップロード](/ja/api-reference/files/upload-file) レスポンスの `created_by`)を解決するのに便利です。", - "operationId": "getEndUserChatJa", + "operationId": "get_end_user", "tags": [ "エンドユーザー" ], @@ -928,7 +1020,7 @@ }, "examples": { "endUserDetail": { - "summary": "Response Example", + "summary": "レスポンス例", "value": { "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890", "tenant_id": "11223344-5566-7788-99aa-bbccddeeff00", @@ -962,6 +1054,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -977,7 +1081,7 @@ "post": { "summary": "メッセージフィードバックを送信", "description": "**対象アプリ**:Chatflow、チャットボット、Agent、テキストジェネレーター。\n\nメッセージに `like` または `dislike` の評価と、任意のコメントを記録します。`rating` に `null` を送信すると、そのメッセージの既存のフィードバックを取り消します。", - "operationId": "postBasicChatMessageFeedbackJa", + "operationId": "create_message_feedback", "tags": [ "メッセージフィードバック" ], @@ -989,7 +1093,8 @@ "description": "フィードバックを送信するメッセージの ID です。メッセージ ID は [会話履歴メッセージ一覧を取得](/ja/api-reference/conversations/list-conversation-messages) から取得します。", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "メッセージ ID。" } } ], @@ -998,7 +1103,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageFeedbackRequest" + "$ref": "#/components/schemas/MessageFeedbackPayloadWithUser" }, "examples": { "likeFeedback": { @@ -1015,7 +1120,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultResponse" + } + } + }, + "description": "リクエストが成功しました。" }, "400": { "description": "`invalid_param` : 必須の `user` フィールドが省略されているか、`rating` が `null` であるにもかかわらず取り消す既存のフィードバックがありません。", @@ -1050,6 +1162,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -1065,32 +1189,32 @@ "get": { "summary": "アプリのフィードバック一覧を取得", "description": "**対象アプリ**:Chatflow、チャットボット、Agent、テキストジェネレーター。\n\nアプリのメッセージに対するすべてのフィードバックのページネーション付きリストを返します。エンドユーザーと管理者の両方の送信が含まれます。", - "operationId": "getBasicChatAppFeedbacksJa", + "operationId": "get_app_feedbacks", "tags": [ "メッセージフィードバック" ], "parameters": [ { - "name": "page", + "name": "limit", "in": "query", - "description": "ページ番号。", + "description": "1 ページあたりのフィードバック件数。", "required": false, "schema": { "type": "integer", - "default": 1, - "minimum": 1 + "default": 20, + "minimum": 1, + "maximum": 101 } }, { - "name": "limit", + "name": "page", "in": "query", - "description": "1 ページあたりのフィードバック件数。", + "description": "ページ番号。", "required": false, "schema": { "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 101 + "default": 1, + "minimum": 1 } } ], @@ -1100,7 +1224,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AppFeedbacksResponse" + "$ref": "#/components/schemas/AppFeedbackListResponse" }, "examples": { "feedbacksList": { @@ -1139,6 +1263,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -1154,20 +1290,11 @@ "get": { "summary": "会話一覧を取得", "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\nエンドユーザーの会話を、最近アクティブな順に一覧表示します。", - "operationId": "getBasicChatConversationsListJa", + "operationId": "list_conversations", "tags": [ "会話管理" ], "parameters": [ - { - "name": "user", - "in": "query", - "required": false, - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。", - "schema": { - "type": "string" - } - }, { "name": "last_id", "in": "query", @@ -1186,7 +1313,8 @@ "type": "integer", "default": 20, "minimum": 1, - "maximum": 100 + "maximum": 100, + "description": "返すレコード数です。" } }, { @@ -1197,13 +1325,22 @@ "schema": { "type": "string", "enum": [ - "created_at", "-created_at", - "updated_at", - "-updated_at" + "-updated_at", + "created_at", + "updated_at" ], "default": "-updated_at" } + }, + { + "name": "user", + "in": "query", + "required": false, + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。", + "schema": { + "type": "string" + } } ], "responses": { @@ -1212,7 +1349,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationsListResponse" + "$ref": "#/components/schemas/ConversationInfiniteScrollPagination" }, "examples": { "conversationsList": { @@ -1272,6 +1409,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -1287,7 +1436,7 @@ "get": { "summary": "会話履歴メッセージ一覧を取得", "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\n会話のメッセージ履歴を新しい順に返します。`first_id` を渡すと、より古いメッセージへページをさかのぼれます。", - "operationId": "getBasicChatConversationHistoryJa", + "operationId": "list_messages", "tags": [ "会話管理" ], @@ -1298,16 +1447,8 @@ "required": true, "description": "読み取る会話の ID です。会話 ID は [会話一覧を取得](/ja/api-reference/conversations/list-conversations) から取得します。", "schema": { - "type": "string" - } - }, - { - "name": "user", - "in": "query", - "required": false, - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。", - "schema": { - "type": "string" + "type": "string", + "description": "会話 ID。" } }, { @@ -1328,7 +1469,17 @@ "type": "integer", "default": 20, "minimum": 1, - "maximum": 100 + "maximum": 100, + "description": "リクエストごとに返すチャット履歴メッセージの数です。" + } + }, + { + "name": "user", + "in": "query", + "required": false, + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。", + "schema": { + "type": "string" } } ], @@ -1338,11 +1489,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationHistoryResponse" + "$ref": "#/components/schemas/MessageInfiniteScrollPagination" }, "examples": { "conversationHistory": { - "summary": "Response Example", + "summary": "レスポンス例", "value": { "limit": 20, "has_more": false, @@ -1421,6 +1572,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-codeSamples": [ @@ -1443,7 +1606,7 @@ "get": { "summary": "会話変数の取得", "description": "**対象アプリ**:Chatflow、チャットボット、Agent。\n\n会話に保存された変数を一覧表示します。", - "operationId": "getBasicChatConversationVariablesJa", + "operationId": "list_conversation_variables", "tags": [ "会話管理" ], @@ -1454,16 +1617,9 @@ "required": true, "description": "変数を一覧表示する会話の ID です。会話 ID は [会話一覧を取得](/ja/api-reference/conversations/list-conversations) から取得します。", "schema": { - "type": "string" - } - }, - { - "name": "user", - "in": "query", - "required": false, - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。", - "schema": { - "type": "string" + "type": "string", + "description": "会話 ID。", + "format": "uuid" } }, { @@ -1484,7 +1640,17 @@ "type": "integer", "default": 20, "minimum": 1, - "maximum": 100 + "maximum": 100, + "description": "返すレコード数です。" + } + }, + { + "name": "user", + "in": "query", + "required": false, + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。", + "schema": { + "type": "string" } }, { @@ -1495,7 +1661,8 @@ "schema": { "type": "string", "minLength": 1, - "maxLength": 255 + "maxLength": 255, + "description": "指定した名前で変数をフィルタリングします。" } } ], @@ -1505,7 +1672,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationVariablesResponse" + "$ref": "#/components/schemas/ConversationVariableInfiniteScrollPaginationResponse" }, "examples": { "conversationVariables": { @@ -1571,6 +1738,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -1586,7 +1765,7 @@ "post": { "summary": "会話の名前を変更", "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\n会話の名前を変更します。`auto_generate` が `true` の場合は、メッセージから名前を自動生成します。この名前は、複数会話のリストでクライアントが表示するものです。", - "operationId": "renameBasicChatConversationJa", + "operationId": "rename_conversation", "tags": [ "会話管理" ], @@ -1597,7 +1776,9 @@ "required": true, "description": "名前を変更する会話の ID です。会話 ID は [会話一覧を取得](/ja/api-reference/conversations/list-conversations) から取得します。", "schema": { - "type": "string" + "type": "string", + "description": "会話 ID。", + "format": "uuid" } } ], @@ -1606,7 +1787,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationRenameRequest" + "$ref": "#/components/schemas/ConversationRenamePayloadWithUser" }, "examples": { "renameExample": { @@ -1626,7 +1807,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationListItem" + "$ref": "#/components/schemas/SimpleConversation" }, "examples": { "renamedConversation": { @@ -1688,6 +1869,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -1703,7 +1896,7 @@ "put": { "summary": "会話変数を更新", "description": "**対象アプリ**:Chatflow、チャットボット、Agent。\n\n会話変数の値を更新します。新しい値は変数の既存の型と一致する必要があります。", - "operationId": "updateChatConversationVariableJa", + "operationId": "update_conversation_variable", "tags": [ "会話管理" ], @@ -1715,7 +1908,8 @@ "description": "変数が属する会話の ID です。会話 ID は [会話一覧を取得](/ja/api-reference/conversations/list-conversations) から取得します。", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "会話 ID。" } }, { @@ -1725,7 +1919,8 @@ "description": "更新する変数の ID です。変数 ID は [会話変数の取得](/ja/api-reference/conversations/list-conversation-variables) から取得します。", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Variable ID." } } ], @@ -1734,7 +1929,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationVariableUpdateRequest" + "$ref": "#/components/schemas/ConversationVariableUpdatePayloadWithUser" }, "examples": { "updateStringVariable": { @@ -1754,7 +1949,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationVariableItem" + "$ref": "#/components/schemas/ConversationVariableResponse" }, "examples": { "updatedVariable": { @@ -1822,6 +2017,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -1837,7 +2044,7 @@ "delete": { "summary": "会話を削除", "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\n会話を削除します。", - "operationId": "deleteBasicChatConversationJa", + "operationId": "delete_conversation", "tags": [ "会話管理" ], @@ -1848,7 +2055,9 @@ "required": true, "description": "削除する会話の ID です。会話 ID は [会話一覧を取得](/ja/api-reference/conversations/list-conversations) から取得します。", "schema": { - "type": "string" + "type": "string", + "description": "会話 ID。", + "format": "uuid" } } ], @@ -1858,13 +2067,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" - } - } + "$ref": "#/components/schemas/OptionalServiceApiUserPayload" }, "examples": { "deleteExample": { @@ -1914,6 +2117,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -1929,7 +2144,7 @@ "post": { "summary": "音声をテキストに変換", "description": "**対象アプリ**:Chatflow、Workflow、新しい Agent、チャットボット、Agent、テキストジェネレーター。\n\nワークスペースのデフォルト音声認識モデルを使用して、アップロードされた音声ファイルをテキストに文字起こしします。", - "operationId": "basicChatAudioToTextJa", + "operationId": "audio_to_text", "tags": [ "音声・テキスト変換" ], @@ -1938,7 +2153,19 @@ "content": { "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/AudioToTextRequest" + "properties": { + "file": { + "format": "binary", + "type": "string" + }, + "user": { + "type": "string" + } + }, + "required": [ + "file" + ], + "type": "object" } } } @@ -1949,7 +2176,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AudioToTextResponse" + "$ref": "#/components/schemas/AudioTranscriptResponse" }, "examples": { "audioToTextSuccess": { @@ -2061,9 +2288,21 @@ } } } - } - }, - "x-mint": { + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + } + }, + "x-mint": { "href": "/ja/api-reference/audio/convert-audio-to-text", "metadata": { "title": "音声をテキストに変換", @@ -2083,7 +2322,7 @@ "post": { "summary": "テキストを音声に変換", "description": "**対象アプリ**:Chatflow、Workflow、新しい Agent、チャットボット、Agent、テキストジェネレーター。\n\nテキストを音声に変換します。任意のテキストを合成するには `text` を、既存のメッセージの回答を音声化するには `message_id` を渡します。", - "operationId": "basicChatTextToAudioJa", + "operationId": "text_to_audio", "tags": [ "音声・テキスト変換" ], @@ -2092,7 +2331,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TextToAudioRequest" + "$ref": "#/components/schemas/TextToAudioPayloadWithUser" }, "examples": { "textToAudioExample": { @@ -2229,6 +2468,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -2244,7 +2495,7 @@ "get": { "summary": "アプリケーションの基本情報を取得", "description": "**対象アプリ**:Chatflow、Workflow、新しい Agent、チャットボット、Agent、テキストジェネレーター。\n\nアプリの基本情報(名前、説明、タグ、モード、作成者)を返します。", - "operationId": "getBasicChatAppInfoJa", + "operationId": "get_app_info", "tags": [ "アプリケーション設定" ], @@ -2273,6 +2524,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -2288,7 +2557,7 @@ "get": { "summary": "アプリケーションのパラメータ情報を取得", "description": "**対象アプリ**:Chatflow、Workflow、新しい Agent、チャットボット、Agent、テキストジェネレーター。\n\nアプリのフロントエンド設定(開始文と推奨質問、機能トグル、ユーザー入力フォーム、ファイルアップロード上限)を返します。アプリの入力をレンダリングし、正しいアップロード上限を適用するために使用します。", - "operationId": "getBasicChatAppParametersJa", + "operationId": "get_app_parameters", "tags": [ "アプリケーション設定" ], @@ -2298,7 +2567,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AppParametersResponse" + "$ref": "#/components/schemas/Parameters" }, "examples": { "appParameters": { @@ -2391,6 +2660,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -2406,7 +2693,7 @@ "get": { "summary": "アプリケーションのメタ情報を取得", "description": "**対象アプリ**:Chatflow、Workflow、新しい Agent、チャットボット、Agent、テキストジェネレーター。\n\nこのアプリが使用するツールの表示アイコンを、ツール名をキーとして返します。", - "operationId": "getBasicChatAppMetaJa", + "operationId": "get_app_meta", "tags": [ "アプリケーション設定" ], @@ -2434,6 +2721,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -2449,7 +2754,7 @@ "get": { "summary": "アプリの WebApp 設定を取得", "description": "**対象アプリ**:Chatflow、Workflow、新しい Agent、チャットボット、Agent、テキストジェネレーター。\n\nアプリのホスト型 Web アプリのブランディングと表示設定(タイトル、アイコン、テーマカラー、デフォルト言語など)を返します。", - "operationId": "getBasicChatWebAppSettingsJa", + "operationId": "get_app_site", "tags": [ "アプリケーション設定" ], @@ -2459,7 +2764,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebAppSettingsResponse" + "$ref": "#/components/schemas/Site" }, "examples": { "webAppSettings": { @@ -2502,6 +2807,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -2517,7 +2828,7 @@ "post": { "summary": "アノテーションを作成", "description": "**対象アプリ**:Chatflow、チャットボット、Agent。\n\nアノテーションを作成します。アノテーションは、一致したときにアプリが新しい応答を生成する代わりに直接返す、事前定義された質問と回答のペアです。", - "operationId": "createChatAnnotationJa", + "operationId": "create_annotation", "tags": [ "アノテーション管理" ], @@ -2526,7 +2837,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAnnotationRequest" + "$ref": "#/components/schemas/AnnotationCreatePayload" }, "examples": { "createAnnotation": { @@ -2546,7 +2857,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AnnotationItem" + "$ref": "#/components/schemas/Annotation" }, "examples": { "createdAnnotation": { @@ -2562,6 +2873,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -2575,20 +2898,20 @@ "get": { "summary": "アノテーションリストを取得", "description": "**対象アプリ**:Chatflow、チャットボット、Agent。\n\nアプリのアノテーションを、任意でキーワードでフィルタリングして一覧表示します。", - "operationId": "listChatAnnotationsJa", + "operationId": "list_annotations", "tags": [ "アノテーション管理" ], "parameters": [ { - "name": "page", + "name": "keyword", "in": "query", - "description": "ページ番号。", + "description": "質問または回答の内容でアノテーションをフィルタリングするためのキーワードです。", "required": false, "schema": { - "type": "integer", - "default": 1, - "minimum": 1 + "type": "string", + "default": "", + "description": "質問または回答の内容でアノテーションをフィルタリングするためのキーワードです。" } }, { @@ -2599,16 +2922,19 @@ "schema": { "type": "integer", "default": 20, - "minimum": 1 + "minimum": 1, + "description": "1 ページあたりの件数です。" } }, { - "name": "keyword", + "name": "page", "in": "query", - "description": "質問または回答の内容でアノテーションをフィルタリングするためのキーワードです。", + "description": "ページ番号。", "required": false, "schema": { - "type": "string" + "type": "integer", + "default": 1, + "minimum": 1 } } ], @@ -2618,7 +2944,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AnnotationListResponse" + "$ref": "#/components/schemas/AnnotationList" }, "examples": { "annotationList": { @@ -2642,6 +2968,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -2657,7 +2995,7 @@ "put": { "summary": "アノテーションを更新", "description": "**対象アプリ**:Chatflow、チャットボット、Agent。\n\nアノテーションの質問と回答を更新します。", - "operationId": "updateChatAnnotationJa", + "operationId": "update_annotation", "tags": [ "アノテーション管理" ], @@ -2678,7 +3016,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateAnnotationRequest" + "$ref": "#/components/schemas/AnnotationCreatePayload" }, "examples": { "updateAnnotation": { @@ -2698,7 +3036,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AnnotationItem" + "$ref": "#/components/schemas/Annotation" }, "examples": { "updatedAnnotation": { @@ -2731,6 +3069,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -2744,7 +3094,7 @@ "delete": { "summary": "アノテーションを削除", "description": "**対象アプリ**:Chatflow、チャットボット、Agent。\n\nアノテーションとその関連するヒット履歴を削除します。", - "operationId": "deleteChatAnnotationJa", + "operationId": "delete_annotation", "tags": [ "アノテーション管理" ], @@ -2780,6 +3130,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -2795,7 +3157,7 @@ "post": { "summary": "アノテーション返信を設定", "description": "**対象アプリ**:Chatflow、チャットボット、Agent。\n\nアプリのアノテーション返信を有効または無効にします。非同期で実行されます。進捗は [アノテーション返信の初期設定タスクステータスを取得](/ja/api-reference/annotations/get-annotation-reply-job-status) で追跡してください。\n\nリクエストボディはアクションの実行前に検証されるため、`disable` の場合でも `score_threshold`、`embedding_provider_name`、`embedding_model_name` が必須です。", - "operationId": "setChatAnnotationReplyJa", + "operationId": "annotation_reply_action", "tags": [ "アノテーション管理" ], @@ -2808,8 +3170,8 @@ "schema": { "type": "string", "enum": [ - "enable", - "disable" + "disable", + "enable" ] } } @@ -2819,7 +3181,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitialAnnotationReplySettingsRequest" + "$ref": "#/components/schemas/AnnotationReplyActionPayload" }, "examples": { "enableAnnotationReply": { @@ -2840,7 +3202,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitialAnnotationReplySettingsResponse" + "$ref": "#/components/schemas/AnnotationJobStatusResponse" }, "examples": { "annotationReplyResponse": { @@ -2853,6 +3215,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -2868,7 +3242,7 @@ "get": { "summary": "アノテーション返信の初期設定タスクステータスを取得", "description": "**対象アプリ**:Chatflow、チャットボット、Agent。\n\n[アノテーション返信を設定](/ja/api-reference/annotations/configure-annotation-reply) で開始されたアノテーション返信設定ジョブのステータスを返します。", - "operationId": "getChatAnnotationReplyStatusJa", + "operationId": "get_annotation_reply_action_status", "tags": [ "アノテーション管理" ], @@ -2881,8 +3255,8 @@ "schema": { "type": "string", "enum": [ - "enable", - "disable" + "disable", + "enable" ] } }, @@ -2903,7 +3277,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitialAnnotationReplySettingsStatusResponse" + "$ref": "#/components/schemas/AnnotationJobStatusDetailResponse" }, "examples": { "jobStatus": { @@ -2934,6 +3308,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -2949,7 +3341,7 @@ "get": { "summary": "ワークフロー実行詳細を取得", "description": "**対象アプリ**:Chatflow、Workflow。\n\n1 つのワークフロー実行のステータス、入力、出力、実行メトリクスを取得します。", - "operationId": "getWorkflowRunDetailJp", + "operationId": "get_workflow_run_detail", "tags": [ "ワークフロー実行" ], @@ -2970,7 +3362,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowRunDetailResponse" + "$ref": "#/components/schemas/WorkflowRunResponse" }, "examples": { "workflowRunDetail": { @@ -3028,6 +3420,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -3043,87 +3447,101 @@ "get": { "summary": "ワークフローログ一覧を取得", "description": "**対象アプリ**:Chatflow、Workflow。\n\n過去のワークフロー実行を、任意のフィルターで一覧表示します。各エントリは実行単位のサマリー(ステータス、トークン使用量、ステップ数、所要時間)であり、ノードごとの実行ログではありません。\n\n実行のノードレベルのイベントを追跡するには、代わりにストリーミングを使用します。\n\n- **自分で開始する実行**:[ワークフローを実行](/ja/api-reference/workflow-runs/run-workflow) をストリーミングモードで使用すると、実行の進行に応じて `node_started` と `node_finished` が送信されます。\n- **すでに進行中の実行**:[ワークフローイベントをストリーム](/ja/api-reference/workflow-runs/stream-workflow-events) を `include_state_snapshot=true` 付きで呼び出し、実行済み各ノードのステータスを再送してから、残りをストリーミングします。\n\n完了した実行のノードレベルのログは、サービス API 経由では取得できません。", - "operationId": "getWorkflowLogsJp", + "operationId": "get_workflow_logs", "tags": [ "ワークフロー実行" ], "parameters": [ { - "name": "keyword", + "name": "created_at__after", "in": "query", - "description": "ログ内を検索するキーワードです。", + "description": "この ISO 8601 タイムスタンプ以降に作成されたログをフィルタリングします。", "schema": { - "type": "string" - } + "type": "string", + "format": "date-time", + "description": "この ISO 8601 タイムスタンプ以降に作成されたログをフィルタリングします。" + }, + "required": false }, { - "name": "status", + "name": "created_at__before", "in": "query", - "description": "実行ステータスでフィルタリングします。", + "description": "この ISO 8601 タイムスタンプ以前に作成されたログをフィルタリングします。", "schema": { "type": "string", - "enum": [ - "succeeded", - "failed", - "stopped" - ] - } + "format": "date-time", + "description": "この ISO 8601 タイムスタンプ以前に作成されたログをフィルタリングします。" + }, + "required": false }, { - "name": "page", + "name": "created_by_account", "in": "query", - "description": "ページ番号。", + "description": "作成者のアカウントのメールアドレス(例:`name@example.com`)でフィルタリングします。", "schema": { - "type": "integer", - "default": 1, - "minimum": 1, - "maximum": 99999 - } + "type": "string" + }, + "required": false }, { - "name": "limit", + "name": "created_by_end_user_session_id", "in": "query", - "description": "1 ページあたりの件数です。", + "description": "エンドユーザーセッション ID でフィルタリングします。", "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100 - } + "type": "string", + "description": "エンドユーザーセッション ID でフィルタリングします。" + }, + "required": false }, { - "name": "created_at__before", + "name": "keyword", "in": "query", - "description": "この ISO 8601 タイムスタンプ以前に作成されたログをフィルタリングします。", + "description": "ログ内を検索するキーワードです。", "schema": { "type": "string", - "format": "date-time" - } + "description": "ログ内を検索するキーワードです。" + }, + "required": false }, { - "name": "created_at__after", + "name": "limit", "in": "query", - "description": "この ISO 8601 タイムスタンプ以降に作成されたログをフィルタリングします。", + "description": "1 ページあたりの件数です。", "schema": { - "type": "string", - "format": "date-time" - } + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 100, + "description": "1 ページあたりの件数です。" + }, + "required": false }, { - "name": "created_by_end_user_session_id", + "name": "page", "in": "query", - "description": "エンドユーザーセッション ID でフィルタリングします。", + "description": "ページ番号。", "schema": { - "type": "string" - } + "type": "integer", + "default": 1, + "minimum": 1, + "maximum": 99999 + }, + "required": false }, { - "name": "created_by_account", + "name": "status", "in": "query", - "description": "作成者のアカウントのメールアドレス(例:`name@example.com`)でフィルタリングします。", + "description": "実行ステータスでフィルタリングします。", "schema": { - "type": "string" - } + "type": "string", + "enum": [ + "failed", + "stopped", + "succeeded" + ], + "description": "実行ステータスでフィルタリングします。" + }, + "required": false } ], "responses": { @@ -3132,11 +3550,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowLogsResponse" + "$ref": "#/components/schemas/WorkflowAppLogPaginationResponse" }, "examples": { "workflowLogs": { - "summary": "Response Example", + "summary": "レスポンス例", "value": { "page": 1, "limit": 20, @@ -3192,6 +3610,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -3210,7 +3640,7 @@ ], "summary": "人間の入力フォームを取得", "description": "**対象アプリ**:Chatflow、Workflow。\n\n一時停止中の人間の入力フォームの内容を返します。Web アプリ配信が必要です。\n\n人間の入力を呼び出す一連の流れについては、[API 連携フロー](/ja/api-reference/guides/human-input-flow) を参照してください。", - "operationId": "getChatflowHumanInputForm", + "operationId": "get_human_input_form", "parameters": [ { "name": "form_token", @@ -3228,153 +3658,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "form_content": { - "type": "string", - "description": "ワークフロー変数を埋め込んだ、事前レンダリング済みのフォーム本文。" - }, - "inputs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "フォーム入力コントロールの種類。利用可能な値: `paragraph` (複数行テキスト入力)、 `select` (リストからの単一選択)、 `file` (単一ファイルアップロード)、 `file-list` (複数ファイルアップロード)。" - }, - "output_variable_name": { - "type": "string", - "description": "ワークフロー内でこの入力の送信値を参照する際の変数名。送信リクエストの `inputs` オブジェクトのキーに対応します。" - }, - "default": { - "type": "object", - "nullable": true, - "description": "`paragraph` 入力の生のデフォルト値設定。クライアントはこのフィールドを直接解決すべきではありません。デフォルトの表示には `resolved_default_values` を使用してください。その他の入力タイプ、またはデフォルト値が未設定の場合、このキーは含まれません。", - "properties": { - "type": { - "type": "string", - "description": "デフォルト値のソース。 `constant` は `value` をリテラル文字列として使用することを示します。 `variable` は `selector` がワークフロー変数を指すことを示します。" - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "`type` が `variable` の場合の変数参照パス(例: `[\"node_id\", \"var_name\"]`)。少なくとも 2 つの要素を含む必要があります。" - }, - "value": { - "type": "string", - "description": "`type` が `constant` の場合のリテラルなデフォルト値。常に文字列です。" - } - } - }, - "option_source": { - "type": "object", - "description": "`select` 入力の選択肢のソース。 `type` が `select` の場合のみ含まれます。", - "properties": { - "type": { - "type": "string", - "enum": [ - "variable", - "constant" - ], - "description": "選択肢のソース。 `constant` は `value` に選択肢を直接列挙することを示します。 `variable` は `selector` が選択肢を提供する `array[string]` 型のワークフロー変数を指すことを示します。" - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "`type` が `variable` の場合の変数参照パス。" - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "description": "`type` が `constant` の場合のリテラルな選択肢リスト。" - } - } - }, - "allowed_file_types": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "image", - "document", - "audio", - "video", - "custom" - ] - }, - "description": "受信者がアップロード可能なファイルカテゴリ。 `file` および `file-list` 入力に含まれます。値: `image`、 `document`、 `audio`、 `video`、 `custom`。" - }, - "allowed_file_extensions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "`allowed_file_types` に `custom` が含まれる場合に許可されるファイル拡張子。各拡張子には先頭の `.` を含めてください。たとえば `.md` です。`file` および `file-list` 入力に含まれます。" - }, - "allowed_file_upload_methods": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "local_file", - "remote_url" - ] - }, - "description": "受信者が使用できるアップロード方法。値: `local_file`、 `remote_url`。 `file` および `file-list` 入力に含まれます。" - }, - "number_limits": { - "type": "integer", - "description": "受信者がアップロードできるファイルの最大数。 `file-list` 入力のみに含まれます。" - } - } - }, - "description": "フォーム入力フィールドの定義。" - }, - "resolved_default_values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "フォームに表示するための事前計算済みデフォルト値。入力の `output_variable_name` をキーとします。デフォルト値がワークフロー変数から解決可能な `paragraph` 入力にのみ設定されます。解決可能なデフォルトがない入力では空になります。クライアントはこれらの値をそのまま表示してください。 `default` をクライアント側で再解決する必要はありません。すべての値は文字列化されています。" - }, - "user_actions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "maxLength": 20, - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "アクションボタンの識別子。受信者がこのボタンを選択したときに、[人間の入力フォームを送信](/ja/api-reference/human-input/submit-human-input-form) エンドポイントの `action` として渡します。" - }, - "title": { - "type": "string", - "maxLength": 100, - "description": "受信者に表示されるボタンのラベル。" - }, - "button_style": { - "type": "string", - "description": "ボタンの視覚スタイル。利用可能な値: `primary`、 `default`、 `accent`、 `ghost`。" - } - } - }, - "description": "利用可能な送信アクション。" - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix タイムスタンプ(秒)。この時刻以降、フォームは送信できなくなります。", - "nullable": true - } - } + "$ref": "#/components/schemas/HumanInputFormDefinitionResponse" }, "examples": { "success": { @@ -3495,6 +3779,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -3511,7 +3807,7 @@ ], "summary": "人間の入力フォームを送信", "description": "**対象アプリ**:Chatflow、Workflow。\n\n一時停止中の人間の入力フォームに、受信者の応答を送信します。受理されるとワークフローが再開されます。再開後の実行は [ワークフローイベントをストリーム](/ja/api-reference/workflow-runs/stream-workflow-events) で追跡してください。Web アプリ配信が必要です。", - "operationId": "submitChatflowHumanInputForm", + "operationId": "submit_human_input_form", "parameters": [ { "name": "form_token", @@ -3528,27 +3824,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "inputs", - "action", - "user" - ], - "properties": { - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "各入力の `output_variable_name` をキーとして送信する値。段落と選択の入力は文字列、`file` 入力は単一のファイルマッピング、`file-list` 入力はファイルマッピングの配列です。\n\nファイルマッピングは `{transfer_method: local_file, upload_file_id, type}` または `{transfer_method: remote_url, url, type}` で、`type` はそのフィールドの `allowed_file_types` のいずれかです。`local_file` の場合、`upload_file_id` は [ファイルをアップロード](/ja/api-reference/files/upload-file) が返す `id` です。\n\n実行、アップロード、送信の各呼び出しで一貫した `user` を使用してください。" - }, - "action": { - "type": "string", - "description": "受信者が選択したアクションボタンの ID。フォームの `user_actions` リスト([人間の入力フォームを取得](/ja/api-reference/human-input/get-human-input-form) エンドポイントから返される)にある `id` のいずれかと一致する必要があります。" - }, - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。サービス API と Web アプリのユーザー ID は、たとえ同じでも別物として扱われます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" - } - } + "$ref": "#/components/schemas/HumanInputFormSubmitPayloadWithUser" }, "examples": { "approve": { @@ -3589,7 +3865,7 @@ "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/HumanInputFormSubmitResponse" }, "examples": { "success": { @@ -3666,6 +3942,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -3684,26 +3972,26 @@ ], "summary": "ワークフローイベントをストリーム", "description": "**対象アプリ**:Chatflow、Workflow。\n\n一時停止後または元の SSE 接続が切断された後にワークフロー実行の Server-Sent Events ストリームを再開します。すでに完了している実行に対しては、`workflow_finished` イベントを 1 つ送信してストリームを閉じます。\n\n進行中の実行のノードレベルのステータスと進捗を確認するには、`include_state_snapshot=true` を指定して呼び出します。ストリームは新しいイベントの送信前に、実行済み各ノードのステータスを再送します。", - "operationId": "streamWorkflowEvents", + "operationId": "get_workflow_events", "parameters": [ { "name": "workflow_run_id", "in": "path", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" }, "description": "イベントストリームを再開するワークフロー実行 ID です。[ワークフローを実行](/ja/api-reference/workflow-runs/run-workflow) のレスポンスまたはストリーミングイベントから取得します。" }, { - "name": "user", + "name": "continue_on_pause", "in": "query", - "required": true, + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false }, - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。実行を開始した `user` と一致する必要があります。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" + "description": "`true` に設定すると、複数の `workflow_paused` イベントを跨いでストリームを開いたままにします(ワークフローに複数の人間の入力ノードが連続する場合に有用)。デフォルトでは最初の一時停止で閉じます。" }, { "name": "include_state_snapshot", @@ -3711,19 +3999,19 @@ "required": false, "schema": { "type": "boolean", - "default": false + "default": false, + "description": "`true` の場合、永続化された状態スナップショットからリプレイし、新しいイベントのストリーミング開始前に実行済みノードのステータスサマリーを含めます。" }, "description": "`true` の場合、永続化された状態スナップショットからリプレイし、新しいイベントのストリーミング開始前に実行済みノードのステータスサマリーを含めます。" }, { - "name": "continue_on_pause", + "name": "user", "in": "query", - "required": false, + "required": true, "schema": { - "type": "boolean", - "default": false + "type": "string" }, - "description": "`true` に設定すると、複数の `workflow_paused` イベントを跨いでストリームを開いたままにします(ワークフローに複数の人間の入力ノードが連続する場合に有用)。デフォルトでは最初の一時停止で閉じます。" + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。実行を開始した `user` と一致する必要があります。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" } ], "responses": { @@ -3766,7 +4054,7 @@ } }, "404": { - "description": "`not_found` : Workflow run not found.", + "description": "`not_found` : ワークフロー実行記録が見つかりません。", "content": { "application/json": { "examples": { @@ -3781,6 +4069,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-codeSamples": [ @@ -3808,7 +4108,7 @@ "post": { "summary": "ワークフローを実行", "description": "**対象アプリ**:Workflow。\n\nアプリの公開済みワークフローを実行し、その出力を返します。単一の `blocking` レスポンス、または `streaming` の Server-Sent Events フィードのいずれかで返します。公開済みのワークフローが必要です。", - "operationId": "executeWorkflowJp", + "operationId": "run_workflow", "tags": [ "ワークフロー実行" ], @@ -3817,7 +4117,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowExecutionRequest" + "$ref": "#/components/schemas/WorkflowRunPayloadWithUser" }, "examples": { "streaming_example": { @@ -4013,6 +4313,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -4035,7 +4353,7 @@ "post": { "summary": "ID でワークフローを実行", "description": "**対象アプリ**:Workflow。\n\n特定の公開済みワークフローバージョンを、パスの `workflow_id` で指定して実行します。リクエストボディ、レスポンス、ストリーミングの挙動は [ワークフローを実行](/ja/api-reference/workflow-runs/run-workflow) と同じで、実行されるバージョンだけが異なります。", - "operationId": "runWorkflowByIdJa", + "operationId": "run_workflow_by_id", "tags": [ "ワークフロー実行" ], @@ -4055,7 +4373,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowExecutionRequest" + "$ref": "#/components/schemas/WorkflowRunPayloadWithUser" }, "examples": { "example": { @@ -4262,6 +4580,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -4277,7 +4601,7 @@ "post": { "summary": "ワークフロータスクを停止", "description": "**対象アプリ**:Workflow。\n\n実行中のワークフロータスクを停止します。`streaming` モードでのみサポートされます。", - "operationId": "stopWorkflowTaskGenerationJp", + "operationId": "stop_workflow_task", "tags": [ "ワークフロー実行" ], @@ -4297,16 +4621,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。実行を開始した `user` と一致する必要はありません。停止は `user` にかかわらずタスクに適用されます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" - } - } + "$ref": "#/components/schemas/RequiredServiceApiUserPayload" }, "examples": { "example": { @@ -4321,7 +4636,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleResultResponse" + } + } + }, + "description": "リクエストが成功しました。" }, "400": { "description": "- `not_workflow_app` : アプリモードが API ルートと一致しません。\n- `invalid_param` : リクエストパラメータが不足または無効です(`user` の欠落など)。", @@ -4347,6 +4669,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -4362,7 +4702,7 @@ "post": { "summary": "完了メッセージを送信", "description": "**対象アプリ**:テキストジェネレーター。\n\nテキスト生成アプリにリクエストを送信し、生成されたテキストを返します。", - "operationId": "createCompletionMessageJp", + "operationId": "create_completion", "tags": [ "完了メッセージ" ], @@ -4372,7 +4712,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CompletionRequest" + "$ref": "#/components/schemas/CompletionRequestPayloadWithUser" }, "examples": { "streaming_example": { @@ -4414,7 +4754,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CompletionResponse" + "$ref": "#/components/schemas/CompletionBlockingResponse" }, "examples": { "blockingResponse": { @@ -4551,6 +4891,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -4573,7 +4931,7 @@ "post": { "summary": "生成を停止", "description": "**対象アプリ**:テキストジェネレーター。\n\nテキスト生成メッセージ生成タスクを停止します。`streaming` モードでのみサポートされています。", - "operationId": "stopCompletionGenerationJp", + "operationId": "stop_completion", "tags": [ "完了メッセージ" ], @@ -4593,16 +4951,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。元のメッセージ送信時に渡した `user` と一致する必要があります。一致しない場合、停止は行われず、成功が返されます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" - } - } + "$ref": "#/components/schemas/RequiredServiceApiUserPayload" }, "examples": { "example": { @@ -4617,7 +4966,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleResultResponse" + } + } + }, + "description": "リクエストが成功しました。" }, "400": { "description": "- `app_unavailable` : アプリケーションが利用できないか、設定が正しくありません。\n- `invalid_param` : 必須の `user` フィールドがありません。", @@ -4643,6 +4999,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -4661,101 +5035,13 @@ ], "summary": "空のナレッジベースを作成", "description": "空のナレッジベースを作成します。ドキュメントを追加するには [テキストからドキュメントを作成](/ja/api-reference/documents/create-document-by-text) または [ファイルからドキュメントを作成](/ja/api-reference/documents/create-document-by-file) を使用します。", - "operationId": "createDataset", + "operationId": "create_dataset", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 40, - "description": "ナレッジベース名。" - }, - "description": { - "type": "string", - "maxLength": 400, - "default": "", - "description": "ナレッジベースの説明です。" - }, - "indexing_technique": { - "type": "string", - "enum": [ - "high_quality", - "economy" - ], - "nullable": true, - "description": "`high_quality` は埋め込みモデルを使用した精密検索、`economy` はキーワードベースのインデキシングです。" - }, - "permission": { - "type": "string", - "enum": [ - "only_me", - "all_team_members", - "partial_members" - ], - "default": "only_me", - "description": "このナレッジベースにアクセスできるユーザーを制御します。`only_me` は作成者のみに制限、`all_team_members` はワークスペース全体にアクセスを許可、`partial_members` は指定されたメンバーにアクセスを許可します。" - }, - "provider": { - "type": "string", - "enum": [ - "vendor", - "external" - ], - "default": "vendor", - "description": "`vendor` は内部ナレッジベース、`external` は外部ナレッジベースです。" - }, - "embedding_model": { - "type": "string", - "description": "埋め込みモデル名です。[利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `model` フィールドの値を使用します。" - }, - "embedding_model_provider": { - "type": "string", - "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。`openai` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `provider` フィールドから取得します。" - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "検索モデルの設定です。このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" - }, - "external_knowledge_api_id": { - "type": "string", - "description": "外部ナレッジ API 接続の ID です。" - }, - "external_knowledge_id": { - "type": "string", - "description": "外部ナレッジベースの ID です。" - }, - "summary_index_setting": { - "type": "object", - "nullable": true, - "description": "サマリーインデックスの設定です。", - "properties": { - "enable": { - "type": "boolean", - "description": "サマリーインデックスを有効にするかどうかです。" - }, - "model_name": { - "type": "string", - "description": "要約生成に使用されるモデルの名前です。" - }, - "model_provider_name": { - "type": "string", - "description": "要約生成モデルのプロバイダーです。" - }, - "summary_prompt": { - "type": "string", - "description": "要約生成用のカスタムプロンプトテンプレートです。" - } - } - } - } + "$ref": "#/components/schemas/DatasetCreatePayload" } } } @@ -4766,7 +5052,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/DatasetDetailResponse" }, "examples": { "success": { @@ -4876,6 +5162,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -4892,42 +5184,49 @@ ], "summary": "ナレッジベースリストを取得", "description": "ナレッジベースのページネーションリストを返します。任意でキーワードまたはタグでフィルタリングできます。", - "operationId": "listDatasets", + "operationId": "list_datasets", "parameters": [ { - "name": "page", + "name": "include_all", "in": "query", "schema": { - "type": "integer", - "default": 1 + "type": "boolean", + "default": false, + "description": "権限に関係なくすべてのナレッジベースを含めるかどうかです。" }, - "description": "ページ番号。" + "description": "権限に関係なくすべてのナレッジベースを含めるかどうかです。", + "required": false }, { - "name": "limit", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 20 + "type": "string", + "description": "名前でフィルタリングする検索キーワードです。" }, - "description": "1 ページあたりの件数です。" + "description": "名前でフィルタリングする検索キーワードです。", + "required": false }, { - "name": "keyword", + "name": "limit", "in": "query", "schema": { - "type": "string" + "type": "integer", + "default": 20, + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。" }, - "description": "名前でフィルタリングする検索キーワードです。" + "description": "1 ページあたりの件数です。", + "required": false }, { - "name": "include_all", + "name": "page", "in": "query", "schema": { - "type": "boolean", - "default": false + "type": "integer", + "default": 1 }, - "description": "権限に関係なくすべてのナレッジベースを含めるかどうかです。" + "description": "ページ番号。", + "required": false }, { "name": "tag_ids", @@ -4938,9 +5237,8 @@ "type": "string" } }, - "style": "form", - "explode": true, - "description": "フィルタリングに使用するタグ ID です。タグ ID は [ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) から取得します。" + "description": "フィルタリングに使用するタグ ID です。タグ ID は [ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) から取得します。", + "required": false } ], "responses": { @@ -4949,32 +5247,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "ナレッジベースオブジェクトの配列です。", - "items": { - "$ref": "#/components/schemas/Dataset" - } - }, - "has_more": { - "type": "boolean", - "description": "次のページにさらに項目が存在するかどうかです。" - }, - "limit": { - "type": "integer", - "description": "1 ページあたりの件数です。" - }, - "total": { - "type": "integer", - "description": "一致する項目の合計数です。" - }, - "page": { - "type": "integer", - "description": "現在のページ番号です。" - } - } + "$ref": "#/components/schemas/DatasetListResponse" }, "examples": { "success": { @@ -5041,6 +5314,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -5059,7 +5344,7 @@ ], "summary": "ナレッジベース詳細を取得", "description": "ナレッジベースの詳細情報(埋め込みモデル、検索設定、ドキュメント統計を含む)を返します。", - "operationId": "getDatasetDetail", + "operationId": "get_dataset", "parameters": [ { "name": "dataset_id", @@ -5078,7 +5363,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/DatasetDetailWithPartialMembersResponse" }, "examples": { "success": { @@ -5171,6 +5456,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -5187,7 +5478,7 @@ ], "summary": "ナレッジベースを更新", "description": "ナレッジベースを更新します。リクエストボディに含まれるフィールドのみが変更されます。", - "operationId": "updateDataset", + "operationId": "update_dataset", "parameters": [ { "name": "dataset_id", @@ -5205,89 +5496,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 40, - "description": "ナレッジベース名。" - }, - "description": { - "type": "string", - "maxLength": 400, - "description": "ナレッジベースの説明です。" - }, - "indexing_technique": { - "type": "string", - "enum": [ - "high_quality", - "economy" - ], - "nullable": true, - "description": "`high_quality` は埋め込みモデルを使用した精密検索、`economy` はキーワードベースのインデキシングです。" - }, - "permission": { - "type": "string", - "enum": [ - "only_me", - "all_team_members", - "partial_members" - ], - "description": "このナレッジベースにアクセスできるユーザーを制御します。`only_me` は作成者のみに制限、`all_team_members` はワークスペース全体にアクセスを許可、`partial_members` は指定されたメンバーにアクセスを許可します。" - }, - "embedding_model": { - "type": "string", - "description": "埋め込みモデル名です。[利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `model` フィールドの値を使用します。" - }, - "embedding_model_provider": { - "type": "string", - "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。`openai` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `provider` フィールドから取得します。" - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "検索モデルの設定です。このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" - }, - "partial_member_list": { - "type": "array", - "description": "`permission` が `partial_members` の場合にアクセス権を持つチームメンバーのリストです。", - "items": { - "type": "object", - "properties": { - "user_id": { - "type": "string", - "description": "アクセス権を付与するチームメンバーの ID です。" - } - } - } - }, - "external_retrieval_model": { - "type": "object", - "description": "外部ナレッジベースの検索設定です。", - "properties": { - "top_k": { - "type": "integer", - "description": "返す結果の最大数です。" - }, - "score_threshold": { - "type": "number", - "description": "結果フィルタリング用の最小関連性スコア閾値です。" - }, - "score_threshold_enabled": { - "type": "boolean", - "description": "スコア閾値フィルタリングが有効かどうかです。" - } - } - }, - "external_knowledge_id": { - "type": "string", - "description": "外部ナレッジベースの ID です。" - }, - "external_knowledge_api_id": { - "type": "string", - "description": "外部ナレッジ API 接続の ID です。" - } - } + "$ref": "#/components/schemas/DatasetUpdatePayload" } } } @@ -5298,7 +5507,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/DatasetDetailWithPartialMembersResponse" }, "examples": { "success": { @@ -5417,6 +5626,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -5433,7 +5648,7 @@ ], "summary": "ナレッジベースを削除", "description": "ナレッジベースとそのすべてのドキュメントを完全に削除します。", - "operationId": "deleteDataset", + "operationId": "delete_dataset", "parameters": [ { "name": "dataset_id", @@ -5491,6 +5706,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "409": { + "content": { + "application/json": {} + }, + "description": "リクエストがリソースの現在の状態と競合しています。" } }, "x-mint": { @@ -5509,7 +5736,7 @@ ], "summary": "テキストからドキュメントを作成", "description": "生のテキストからナレッジベースにドキュメントを作成します。インデックスは非同期で実行されます。返された `batch` ID を使って [ドキュメント埋め込みステータス(進捗)を取得](/ja/api-reference/documents/get-document-indexing-status) で追跡します。", - "operationId": "createDocumentFromText", + "operationId": "create_document_by_text", "parameters": [ { "name": "dataset_id", @@ -5527,123 +5754,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name", - "text" - ], - "properties": { - "name": { - "type": "string", - "description": "ドキュメント名です。" - }, - "text": { - "type": "string", - "description": "ドキュメントのテキスト内容です。" - }, - "indexing_technique": { - "type": "string", - "enum": [ - "high_quality", - "economy" - ], - "description": "ナレッジベースに最初のドキュメントを追加する際に必須です。以降のドキュメントでは省略するとナレッジベースのインデックス方式を継承します。`high_quality` は埋め込みモデルによる精密検索、`economy` はキーワードベースのインデックスを使用します。" - }, - "doc_form": { - "type": "string", - "enum": [ - "text_model", - "hierarchical_model", - "qa_model" - ], - "default": "text_model", - "description": "`text_model` は標準テキストチャンキング、`hierarchical_model` は親子チャンク構造、`qa_model` は質問・回答ペアの抽出です。" - }, - "doc_language": { - "type": "string", - "default": "English", - "description": "処理最適化のためのドキュメント言語です。" - }, - "process_rule": { - "type": "object", - "description": "チャンキングの処理ルールです。", - "required": [ - "mode" - ], - "properties": { - "mode": { - "type": "string", - "enum": [ - "automatic", - "custom", - "hierarchical" - ], - "description": "`automatic` は組み込みルールを使用、`custom` は手動設定が可能、`hierarchical` は親子チャンク構造を有効にします(`doc_form: hierarchical_model` と組み合わせて使用)。" - }, - "rules": { - "type": "object", - "properties": { - "pre_processing_rules": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "remove_stopwords", - "remove_extra_spaces", - "remove_urls_emails" - ], - "description": "ルール識別子です。" - }, - "enabled": { - "type": "boolean", - "description": "この前処理ルールが有効かどうかです。" - } - } - } - }, - "segmentation": { - "type": "object", - "properties": { - "separator": { - "type": "string", - "default": "\n", - "description": "テキスト分割用のカスタムセパレーターです。" - }, - "max_tokens": { - "type": "integer", - "description": "チャンクあたりの最大トークン数です。" - }, - "chunk_overlap": { - "type": "integer", - "default": 0, - "description": "チャンク間のトークンオーバーラップです。" - } - } - } - } - } - } - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" - }, - "embedding_model": { - "type": "string", - "description": "埋め込みモデル名です。[利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `model` フィールドの値を使用します。" - }, - "embedding_model_provider": { - "type": "string", - "description": "埋め込みモデルプロバイダーです。[利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `provider` フィールドの値を使用します。" - }, - "original_document_id": { - "type": "string", - "description": "バージョン管理用の元ドキュメント ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) から取得します。" - } - } + "$ref": "#/components/schemas/DocumentTextCreatePayload" } } } @@ -5654,16 +5765,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "インデックス進捗を追跡するためのバッチ ID です。" - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -5780,39 +5882,11 @@ } } }, - "404": { - "description": "`not_found` : ナレッジベースが見つかりません。", - "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } - }, - "503": { - "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -5831,7 +5905,7 @@ ], "summary": "ファイルからドキュメントを作成", "description": "アップロードしたファイルからナレッジベースにドキュメントを作成します。PDF、TXT、DOCX などの一般的な形式をサポートします。インデックスは非同期で実行されます。返された `batch` ID を使って [ドキュメント埋め込みステータス(進捗)を取得](/ja/api-reference/documents/get-document-indexing-status) で追跡します。", - "operationId": "createDocumentFromFile", + "operationId": "create_document_by_file", "parameters": [ { "name": "dataset_id", @@ -5875,16 +5949,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "インデックス進捗を追跡するためのバッチ ID です。" - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -6025,23 +6090,6 @@ } } }, - "404": { - "description": "`not_found` : ナレッジベースが見つかりません。", - "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } - }, "413": { "description": "`file_too_large` : ファイルサイズが上限を超えています。", "content": { @@ -6059,22 +6107,11 @@ } } }, - "503": { - "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -6100,7 +6137,7 @@ ], "summary": "ナレッジベースのドキュメントリストを取得", "description": "ナレッジベース内のドキュメントのページネーションされた一覧を返します。", - "operationId": "listDocuments", + "operationId": "list_documents", "parameters": [ { "name": "dataset_id", @@ -6113,30 +6150,35 @@ "description": "ナレッジベース ID です。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) から取得します。" }, { - "name": "page", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 1 + "type": "string", + "description": "ドキュメント名でフィルタリングするための検索キーワードです。" }, - "description": "ページ番号。" + "description": "ドキュメント名でフィルタリングするための検索キーワードです。", + "required": false }, { "name": "limit", "in": "query", "schema": { "type": "integer", - "default": 20 + "default": 20, + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。" }, - "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。" + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。", + "required": false }, { - "name": "keyword", + "name": "page", "in": "query", "schema": { - "type": "string" + "type": "integer", + "default": 1 }, - "description": "ドキュメント名でフィルタリングするための検索キーワードです。" + "description": "ページ番号。", + "required": false }, { "name": "status", @@ -6144,16 +6186,18 @@ "schema": { "type": "string", "enum": [ - "queuing", - "indexing", - "paused", - "error", + "archived", "available", "disabled", - "archived" - ] + "error", + "indexing", + "paused", + "queuing" + ], + "description": "表示ステータスでフィルタリングします。" }, - "description": "表示ステータスでフィルタリングします。" + "description": "表示ステータスでフィルタリングします。", + "required": false } ], "responses": { @@ -6162,32 +6206,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "ドキュメントオブジェクトの配列です。", - "items": { - "$ref": "#/components/schemas/Document" - } - }, - "has_more": { - "type": "boolean", - "description": "次のページにさらに項目が存在するかどうかです。" - }, - "limit": { - "type": "integer", - "description": "1 ページあたりの件数です。" - }, - "total": { - "type": "integer", - "description": "一致する項目の合計数です。" - }, - "page": { - "type": "integer", - "description": "現在のページ番号です。" - } - } + "$ref": "#/components/schemas/DocumentListResponse" }, "examples": { "success": { @@ -6276,6 +6295,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -6294,7 +6319,7 @@ ], "summary": "ドキュメント詳細を取得", "description": "1 つのドキュメントの詳細情報を返します。", - "operationId": "getDocumentDetail", + "operationId": "get_document", "parameters": [ { "name": "dataset_id", @@ -6326,9 +6351,11 @@ "only", "without" ], - "default": "all" + "default": "all", + "description": "`all` はメタデータを含むすべてのフィールドを返します。`only` は `id`、`doc_type`、`doc_metadata` のみを返します。`without` は `doc_metadata` を除くすべてのフィールドを返します。" }, - "description": "`all` はメタデータを含むすべてのフィールドを返します。`only` は `id`、`doc_type`、`doc_metadata` のみを返します。`without` は `doc_metadata` を除くすべてのフィールドを返します。" + "description": "`all` はメタデータを含むすべてのフィールドを返します。`only` は `id`、`doc_type`、`doc_metadata` のみを返します。`without` は `doc_metadata` を除くすべてのフィールドを返します。", + "required": false } ], "responses": { @@ -6337,198 +6364,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ドキュメント識別子です。" - }, - "position": { - "type": "integer", - "description": "ナレッジベース内の位置インデックスです。" - }, - "data_source_type": { - "type": "string", - "description": "ドキュメントのアップロード方法です。ファイルアップロードの場合は `upload_file`、Notion インポートの場合は `notion_import` です。" - }, - "data_source_info": { - "type": "object", - "description": "データソースの詳細です。ファイルアップロードの場合、この詳細エンドポイントは `upload_file` 配下に完全なファイルオブジェクトを返します(リストエンドポイントは `upload_file_id` のみを返します)。", - "properties": { - "upload_file": { - "type": "object", - "description": "アップロードされたファイルの詳細です。`data_source_type` が `upload_file` の場合に返されます。", - "properties": { - "id": { - "type": "string", - "description": "ファイル識別子です。" - }, - "name": { - "type": "string", - "description": "元のファイル名です。" - }, - "size": { - "type": "integer", - "description": "ファイルサイズ(バイト単位)です。" - }, - "extension": { - "type": "string", - "description": "ファイル拡張子です。" - }, - "mime_type": { - "type": "string", - "description": "ファイルの MIME タイプです。" - }, - "created_by": { - "type": "string", - "description": "ファイルをアップロードしたユーザーの ID です。" - }, - "created_at": { - "type": "integer", - "description": "ファイルアップロードの Unix タイムスタンプです。" - } - } - } - } - }, - "dataset_process_rule_id": { - "type": "string", - "description": "このドキュメントに適用された処理ルールの ID です。" - }, - "dataset_process_rule": { - "type": "object", - "description": "ナレッジベースレベルの処理ルール設定です。" - }, - "document_process_rule": { - "type": "object", - "description": "ドキュメントレベルの処理ルール設定です。" - }, - "name": { - "type": "string", - "description": "ドキュメント名です。" - }, - "created_from": { - "type": "string", - "description": "ドキュメントの作成元です。API で作成した場合は `api`、UI で作成した場合は `web` です。" - }, - "created_by": { - "type": "string", - "description": "ドキュメントを作成したユーザーの ID です。" - }, - "created_at": { - "type": "number", - "description": "ドキュメント作成の Unix タイムスタンプです。" - }, - "tokens": { - "type": "integer", - "description": "ドキュメント内のトークン数です。" - }, - "indexing_status": { - "type": "string", - "description": "現在のインデックスステータスです(例:`waiting`、`parsing`、`cleaning`、`splitting`、`indexing`、`completed`、`error`、`paused`)。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "インデックス作成が失敗した場合のエラーメッセージです。それ以外は `null` です。" - }, - "enabled": { - "type": "boolean", - "description": "このドキュメントが検索に対して有効かどうかです。" - }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "ドキュメントが無効化された Unix タイムスタンプです。有効な場合は `null` です。" - }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "ドキュメントを無効化したユーザーの ID です。有効な場合は `null` です。" - }, - "archived": { - "type": "boolean", - "description": "ドキュメントがアーカイブ済みかどうかです。" - }, - "display_status": { - "type": "string", - "description": "UI 向けの表示用インデックスステータスです。" - }, - "hit_count": { - "type": "integer", - "description": "このドキュメントが検索された回数です。" - }, - "doc_form": { - "type": "string", - "description": "ドキュメントのチャンキングモードです。`text_model` は標準テキスト、`hierarchical_model` は親子構造、`qa_model` は QA ペアを示します。" - }, - "doc_language": { - "type": "string", - "description": "ドキュメント内容の言語です。" - }, - "doc_type": { - "type": "string", - "nullable": true, - "description": "ドキュメントタイプの分類です。未設定の場合は `null` です。" - }, - "doc_metadata": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "メタデータフィールドの識別子です。" - }, - "name": { - "type": "string", - "description": "メタデータフィールド名です。" - }, - "type": { - "type": "string", - "description": "メタデータフィールドの種類です。" - }, - "value": { - "type": "string", - "description": "このドキュメントのメタデータフィールド値。" - } - } - }, - "description": "このドキュメントのカスタムメタデータキーバリューペア。" - }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "処理が完了した Unix タイムスタンプです。まだ完了していない場合は `null` です。" - }, - "updated_at": { - "type": "number", - "nullable": true, - "description": "最終更新の Unix タイムスタンプです。更新されたことがない場合は `null` です。" - }, - "indexing_latency": { - "type": "number", - "nullable": true, - "description": "インデックス作成にかかった時間(秒)です。未完了の場合は `null` です。" - }, - "segment_count": { - "type": "integer", - "description": "ドキュメント内のチャンク数です。" - }, - "average_segment_length": { - "type": "number", - "description": "チャンクの平均文字長です。" - }, - "summary_index_status": { - "type": "string", - "nullable": true, - "description": "要約インデックスのステータスです。要約インデックスが有効でない場合は `null` です。" - }, - "need_summary": { - "type": "boolean", - "description": "このドキュメントが要約生成を必要とするかどうかです。" - } - } + "$ref": "#/components/schemas/DocumentDetailResponse" }, "examples": { "success": { @@ -6652,6 +6488,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -6668,7 +6510,7 @@ ], "summary": "ドキュメントを削除", "description": "ナレッジベースからドキュメントとそのすべてのチャンクを完全に削除します。", - "operationId": "deleteDocument", + "operationId": "delete_document", "parameters": [ { "name": "dataset_id", @@ -6752,6 +6594,18 @@ } } } + }, + "400": { + "content": { + "application/json": {} + }, + "description": "リクエストパラメーターが無効です。" + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -6768,7 +6622,7 @@ ], "summary": "ドキュメントを更新", "description": "新しいファイルをアップロードしてドキュメントを更新し、再インデックスします。これはファイルベースのドキュメント更新の正規エンドポイントです。返された `batch` ID を使って [ドキュメント埋め込みステータス(進捗)を取得](/ja/api-reference/documents/get-document-indexing-status) で進捗を追跡します。", - "operationId": "updateDocument", + "operationId": "update_document_by_file", "parameters": [ { "name": "dataset_id", @@ -6792,7 +6646,7 @@ } ], "requestBody": { - "required": true, + "required": false, "content": { "multipart/form-data": { "schema": { @@ -6819,16 +6673,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "インデックス進捗を追跡するためのバッチ ID です。" - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -7012,22 +6857,11 @@ } } }, - "503": { - "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -7053,7 +6887,7 @@ ], "summary": "ドキュメントをダウンロード", "description": "ドキュメントの元のアップロードファイルをダウンロードするための署名付き URL を返します。", - "operationId": "downloadDocumentJa", + "operationId": "get_document_download_url", "parameters": [ { "name": "dataset_id", @@ -7082,13 +6916,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "元のアップロードファイルをダウンロードするための署名付き URL です。" - } - } + "$ref": "#/components/schemas/UrlResponse" }, "examples": { "success": { @@ -7166,6 +6994,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -7184,26 +7018,26 @@ ], "summary": "ドキュメント埋め込みステータス(進捗)を取得", "description": "バッチ内のすべてのドキュメントのインデックス進捗(現在の段階とチャンク完了数)を返します。各 `indexing_status` が `completed` または `error` に達するまでポーリングします。ステータスは `waiting` → `parsing` → `cleaning` → `splitting` → `indexing` → `completed` の順に進みます。", - "operationId": "getDocumentIndexingStatus", + "operationId": "get_document_indexing_status", "parameters": [ { - "name": "dataset_id", + "name": "batch", "in": "path", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" }, - "description": "ナレッジベース ID です。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) から取得します。" + "description": "ドキュメントの作成時または更新時に返されるバッチ ID です。" }, { - "name": "batch", + "name": "dataset_id", "in": "path", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" }, - "description": "ドキュメントの作成時または更新時に返されるバッチ ID です。" + "description": "ナレッジベース ID です。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) から取得します。" } ], "responses": { @@ -7212,74 +7046,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ドキュメント識別子です。" - }, - "indexing_status": { - "type": "string", - "description": "現在のインデックスステータスです:`waiting`、`parsing`、`cleaning`、`splitting`、`indexing`、`completed`、または `error`。" - }, - "processing_started_at": { - "type": "number", - "nullable": true, - "description": "処理開始時の Unix タイムスタンプです。" - }, - "parsing_completed_at": { - "type": "number", - "nullable": true, - "description": "解析完了時の Unix タイムスタンプです。" - }, - "cleaning_completed_at": { - "type": "number", - "nullable": true, - "description": "クリーニング完了時の Unix タイムスタンプです。" - }, - "splitting_completed_at": { - "type": "number", - "nullable": true, - "description": "分割完了時の Unix タイムスタンプです。" - }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "インデックス完了時の Unix タイムスタンプです。" - }, - "paused_at": { - "type": "number", - "nullable": true, - "description": "インデキシングが一時停止されたタイムスタンプ。一時停止されていない場合は `null`。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "インデキシングが失敗した場合のエラーメッセージ。エラーがない場合は `null`。" - }, - "stopped_at": { - "type": "number", - "nullable": true, - "description": "インデキシングが停止されたタイムスタンプ。停止されていない場合は `null`。" - }, - "completed_segments": { - "type": "integer", - "description": "インデックス済みのチャンク数です。" - }, - "total_segments": { - "type": "integer", - "description": "インデックス対象のチャンクの合計数です。" - } - } - }, - "description": "インデキシングステータスエントリのリスト。" - } - } + "$ref": "#/components/schemas/DocumentStatusListResponse" }, "examples": { "success": { @@ -7348,6 +7115,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -7366,7 +7139,7 @@ ], "summary": "テキストでドキュメントを更新", "description": "ドキュメントのテキスト内容、名前、または処理設定を更新します。テキストが変更されると、ドキュメントを再インデックスします。", - "operationId": "updateDocumentByText", + "operationId": "update_document_by_text", "parameters": [ { "name": "dataset_id", @@ -7394,99 +7167,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "ドキュメント名です。`text` を指定する場合は必須です。" - }, - "text": { - "type": "string", - "description": "ドキュメントのテキスト内容です。" - }, - "process_rule": { - "type": "object", - "description": "チャンキングの処理ルールです。", - "required": [ - "mode" - ], - "properties": { - "mode": { - "type": "string", - "enum": [ - "automatic", - "custom", - "hierarchical" - ], - "description": "`automatic` は組み込みルールを使用、`custom` は手動設定が可能、`hierarchical` は親子チャンク構造を有効にします(`doc_form: hierarchical_model` と組み合わせて使用)。" - }, - "rules": { - "type": "object", - "properties": { - "pre_processing_rules": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "remove_stopwords", - "remove_extra_spaces", - "remove_urls_emails" - ], - "description": "ルール識別子です。" - }, - "enabled": { - "type": "boolean", - "description": "この前処理ルールが有効かどうかです。" - } - } - } - }, - "segmentation": { - "type": "object", - "properties": { - "separator": { - "type": "string", - "default": "\n", - "description": "テキスト分割用のカスタムセパレーターです。" - }, - "max_tokens": { - "type": "integer", - "description": "チャンクあたりの最大トークン数です。" - }, - "chunk_overlap": { - "type": "integer", - "default": 0, - "description": "チャンク間のトークンオーバーラップです。" - } - } - } - } - } - } - }, - "doc_form": { - "type": "string", - "enum": [ - "text_model", - "hierarchical_model", - "qa_model" - ], - "default": "text_model", - "description": "`text_model` は標準テキストチャンキング、`hierarchical_model` は親子チャンク構造、`qa_model` は質問・回答ペアの抽出です。" - }, - "doc_language": { - "type": "string", - "default": "English", - "description": "処理最適化のためのドキュメント言語です。" - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" - } - } + "$ref": "#/components/schemas/DocumentTextUpdate" } } } @@ -7497,16 +7178,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "インデックス進捗を追跡するためのバッチ ID です。" - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -7648,22 +7320,11 @@ } } }, - "503": { - "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -7682,7 +7343,7 @@ ], "summary": "ファイルでドキュメントを更新", "description": "非推奨です。代わりに [ドキュメントを更新](/ja/api-reference/documents/update-document) を使用してください。新しいファイルをアップロードしてドキュメントを更新し、再インデックスします。", - "operationId": "updateDocumentByFile", + "operationId": "update_document_by_file_deprecated", "parameters": [ { "name": "dataset_id", @@ -7706,7 +7367,7 @@ } ], "requestBody": { - "required": true, + "required": false, "content": { "multipart/form-data": { "schema": { @@ -7733,16 +7394,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "インデックス進捗を追跡するためのバッチ ID です。" - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -7926,22 +7578,11 @@ } } }, - "503": { - "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "deprecated": true, @@ -7961,7 +7602,7 @@ ], "summary": "ドキュメントを一括ダウンロード(ZIP)", "description": "1 つ以上のドキュメントを単一の ZIP アーカイブとしてダウンロードします。ファイルとしてアップロードされたドキュメントのみ含められます。", - "operationId": "downloadDocumentsZipJa", + "operationId": "download_documents_as_zip", "parameters": [ { "name": "dataset_id", @@ -7979,22 +7620,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "document_ids" - ], - "properties": { - "document_ids": { - "type": "array", - "minItems": 1, - "maxItems": 100, - "items": { - "type": "string", - "format": "uuid" - }, - "description": "アーカイブに含めるドキュメント ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) から取得します。" - } - } + "$ref": "#/components/schemas/DocumentBatchDownloadZipPayload" } } } @@ -8085,6 +7711,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -8103,32 +7735,32 @@ ], "summary": "ドキュメントステータスを一括更新", "description": "複数のドキュメントを 1 回のリクエストで有効化、無効化、アーカイブ、またはアーカイブ解除します。", - "operationId": "batchUpdateDocumentStatus", + "operationId": "update_document_status", "parameters": [ { - "name": "dataset_id", + "name": "action", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "archive", + "disable", + "enable", + "un_archive" + ] }, - "description": "ナレッジベース ID です。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) から取得します。" + "description": "`enable` はドキュメントを検索対象として有効化し、`disable` は無効化し、`archive` はアーカイブに移動し、`un_archive` はアーカイブから復元します。" }, { - "name": "action", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", - "enum": [ - "enable", - "disable", - "archive", - "un_archive" - ] + "format": "uuid" }, - "description": "`enable` はドキュメントを検索対象として有効化し、`disable` は無効化し、`archive` はアーカイブに移動し、`un_archive` はアーカイブから復元します。" + "description": "ナレッジベース ID です。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) から取得します。" } ], "requestBody": { @@ -8136,19 +7768,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "document_ids" - ], - "properties": { - "document_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "更新するドキュメント ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) から取得します。" - } - } + "$ref": "#/components/schemas/DocumentStatusPayload" } } } @@ -8159,13 +7779,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "操作結果です。" - } - } + "$ref": "#/components/schemas/SimpleResultResponse" }, "examples": { "success": { @@ -8228,6 +7842,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -8246,7 +7866,7 @@ ], "summary": "ドキュメントにチャンクを追加", "description": "ドキュメント内に 1 つ以上のチャンクを作成します。", - "operationId": "createSegments", + "operationId": "create_segments", "parameters": [ { "name": "dataset_id", @@ -8274,48 +7894,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "segments" - ], - "properties": { - "segments": { - "type": "array", - "items": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "チャンクのテキスト内容です。", - "minLength": 1 - }, - "answer": { - "type": "string", - "description": "回答テキストです。Q&A モード(`qa_model`)のドキュメントでは必須です。" - }, - "keywords": { - "type": "array", - "items": { - "type": "string" - }, - "description": "チャンクのキーワードです。" - }, - "attachment_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "添付ファイル ID です。" - } - }, - "required": [ - "content" - ] - }, - "description": "作成するチャンクオブジェクトの配列です。", - "minItems": 1 - } - } + "$ref": "#/components/schemas/SegmentCreatePayload" } } } @@ -8326,20 +7905,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Segment" - }, - "description": "作成されたチャンクのリスト。" - }, - "doc_form": { - "type": "string", - "description": "このドキュメントが使用するドキュメントチャンキングモードです。" - } - } + "$ref": "#/components/schemas/SegmentCreateListResponse" }, "examples": { "success": { @@ -8500,22 +8066,11 @@ } } }, - "503": { - "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -8532,7 +8087,7 @@ ], "summary": "チャンク一覧を取得", "description": "ドキュメント内のチャンクのページネーションリストを返します。任意でキーワードまたはインデックスステータスでフィルタリングできます。", - "operationId": "listSegments", + "operationId": "list_segments", "parameters": [ { "name": "dataset_id", @@ -8555,14 +8110,14 @@ "description": "ドキュメント ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) から取得します。" }, { - "name": "page", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 1, - "minimum": 1 + "type": "string", + "description": "検索キーワードです。" }, - "description": "ページ番号。" + "description": "検索キーワードです。", + "required": false }, { "name": "limit", @@ -8570,9 +8125,22 @@ "schema": { "type": "integer", "default": 20, + "minimum": 1, + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。" + }, + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。", + "required": false + }, + { + "name": "page", + "in": "query", + "schema": { + "type": "integer", + "default": 1, "minimum": 1 }, - "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。" + "description": "ページ番号。", + "required": false }, { "name": "status", @@ -8583,17 +8151,8 @@ "type": "string" } }, - "style": "form", - "explode": true, - "description": "インデックスステータスでチャンクをフィルタリングします(例:`completed`、`indexing`、`error`)。" - }, - { - "name": "keyword", - "in": "query", - "schema": { - "type": "string" - }, - "description": "検索キーワードです。" + "description": "インデックスステータスでチャンクをフィルタリングします(例:`completed`、`indexing`、`error`)。", + "required": false } ], "responses": { @@ -8602,36 +8161,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Segment" - }, - "description": "チャンクのリスト。" - }, - "doc_form": { - "type": "string", - "description": "このドキュメントが使用するドキュメントチャンキングモードです。" - }, - "total": { - "type": "integer", - "description": "一致するチャンクの合計数です。" - }, - "has_more": { - "type": "boolean", - "description": "次のページにさらに項目が存在するかどうかです。" - }, - "limit": { - "type": "integer", - "description": "1 ページあたりの件数です。" - }, - "page": { - "type": "integer", - "description": "現在のページ番号です。" - } - } + "$ref": "#/components/schemas/SegmentListResponse" }, "examples": { "success": { @@ -8741,6 +8271,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -8759,7 +8295,7 @@ ], "summary": "ドキュメント内のチャンク詳細を取得", "description": "1 つのチャンクの詳細をすべて取得します。", - "operationId": "getSegmentDetail", + "operationId": "get_segment", "parameters": [ { "name": "dataset_id", @@ -8798,16 +8334,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Segment" - }, - "doc_form": { - "type": "string", - "description": "このドキュメントが使用するドキュメントチャンキングモードです。" - } - } + "$ref": "#/components/schemas/SegmentDetailResponse" }, "examples": { "success": { @@ -8919,6 +8446,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -8935,7 +8468,7 @@ ], "summary": "ドキュメント内のチャンクを更新", "description": "チャンクのフィールドを更新します。この更新により、そのチャンクのインデックス作成が再トリガーされます。", - "operationId": "updateSegment", + "operationId": "update_segment", "parameters": [ { "name": "dataset_id", @@ -8973,54 +8506,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "segment" - ], - "properties": { - "segment": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "チャンクのテキスト内容です。" - }, - "answer": { - "type": "string", - "description": "Q&A モード(`qa_model`)のドキュメントの回答テキストです。" - }, - "keywords": { - "type": "array", - "items": { - "type": "string" - }, - "description": "チャンクのキーワードです。" - }, - "enabled": { - "type": "boolean", - "description": "チャンクが有効かどうかです。" - }, - "regenerate_child_chunks": { - "type": "boolean", - "default": false, - "description": "子チャンクを再生成するかどうかです。" - }, - "attachment_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "添付ファイル ID です。" - }, - "summary": { - "type": "string", - "nullable": true, - "description": "サマリーインデックスのサマリー内容です。" - } - }, - "description": "更新するチャンクデータです。" - } - } + "$ref": "#/components/schemas/SegmentUpdatePayload" } } } @@ -9031,16 +8517,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Segment" - }, - "doc_form": { - "type": "string", - "description": "このドキュメントが使用するドキュメントチャンキングモードです。" - } - } + "$ref": "#/components/schemas/SegmentDetailResponse" }, "examples": { "success": { @@ -9177,22 +8654,11 @@ } } }, - "503": { - "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -9209,7 +8675,7 @@ ], "summary": "ドキュメント内のチャンクを削除", "description": "ドキュメントからチャンクを完全に削除します。", - "operationId": "deleteSegment", + "operationId": "delete_segment", "parameters": [ { "name": "dataset_id", @@ -9328,6 +8794,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -9346,7 +8818,7 @@ ], "summary": "子チャンクを作成", "description": "親チャンクの下に子チャンクを作成します。親子(`hierarchical_model`)チャンキングモードを使用するドキュメント向けです。", - "operationId": "createChildChunk", + "operationId": "create_child_chunk", "parameters": [ { "name": "dataset_id", @@ -9384,16 +8856,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "description": "子チャンクのテキスト内容です。" - } - } + "$ref": "#/components/schemas/ChildChunkCreatePayload" } } } @@ -9404,12 +8867,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/ChildChunk" - } - } + "$ref": "#/components/schemas/ChildChunkDetailResponse" }, "examples": { "success": { @@ -9530,22 +8988,11 @@ } } }, - "503": { - "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -9562,7 +9009,7 @@ ], "summary": "子チャンク一覧を取得", "description": "特定の親チャンク配下の子チャンクのページネーションリストを返します。", - "operationId": "getChildChunks", + "operationId": "list_child_chunks", "parameters": [ { "name": "dataset_id", @@ -9595,14 +9042,14 @@ "description": "親チャンク ID です。[チャンク一覧を取得](/ja/api-reference/chunks/list-chunks) から取得します。" }, { - "name": "page", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 1, - "minimum": 1 + "type": "string", + "description": "検索キーワードです。" }, - "description": "ページ番号。" + "description": "検索キーワードです。", + "required": false }, { "name": "limit", @@ -9610,17 +9057,22 @@ "schema": { "type": "integer", "default": 20, - "minimum": 1 + "minimum": 1, + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。" }, - "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。" + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。", + "required": false }, { - "name": "keyword", + "name": "page", "in": "query", "schema": { - "type": "string" + "type": "integer", + "default": 1, + "minimum": 1 }, - "description": "検索キーワードです。" + "description": "ページ番号。", + "required": false } ], "responses": { @@ -9629,32 +9081,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ChildChunk" - }, - "description": "子チャンクのリスト。" - }, - "total": { - "type": "integer", - "description": "子チャンクの合計数です。" - }, - "total_pages": { - "type": "integer", - "description": "合計ページ数です。" - }, - "page": { - "type": "integer", - "description": "現在のページ番号です。" - }, - "limit": { - "type": "integer", - "description": "1 ページあたりの件数です。" - } - } + "$ref": "#/components/schemas/ChildChunkListResponse" }, "examples": { "success": { @@ -9731,6 +9158,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -9749,8 +9182,19 @@ ], "summary": "子チャンクを更新", "description": "既存の子チャンクのコンテンツを更新します。", - "operationId": "updateChildChunk", + "operationId": "update_child_chunk", "parameters": [ + { + "name": "child_chunk_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "子チャンク ID です。" + }, + "description": "子チャンク ID です。" + }, { "name": "dataset_id", "in": "path", @@ -9780,16 +9224,6 @@ "format": "uuid" }, "description": "親チャンク ID です。[チャンク一覧を取得](/ja/api-reference/chunks/list-chunks) から取得します。" - }, - { - "name": "child_chunk_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - }, - "description": "子チャンク ID です。" } ], "requestBody": { @@ -9797,16 +9231,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "description": "子チャンクのテキスト内容です。" - } - } + "$ref": "#/components/schemas/ChildChunkUpdatePayload" } } } @@ -9817,12 +9242,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/ChildChunk" - } - } + "$ref": "#/components/schemas/ChildChunkDetailResponse" }, "examples": { "success": { @@ -9943,22 +9363,11 @@ } } }, - "503": { - "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -9975,47 +9384,48 @@ ], "summary": "子チャンクを削除", "description": "親チャンクから子チャンクを完全に削除します。", - "operationId": "deleteChildChunk", + "operationId": "delete_child_chunk", "parameters": [ { - "name": "dataset_id", + "name": "child_chunk_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "子チャンク ID です。" }, - "description": "ナレッジベース ID です。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) から取得します。" + "description": "子チャンク ID です。" }, { - "name": "document_id", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, - "description": "ドキュメント ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) から取得します。" + "description": "ナレッジベース ID です。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) から取得します。" }, { - "name": "segment_id", + "name": "document_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, - "description": "親チャンク ID です。[チャンク一覧を取得](/ja/api-reference/chunks/list-chunks) から取得します。" + "description": "ドキュメント ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) から取得します。" }, { - "name": "child_chunk_id", + "name": "segment_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, - "description": "子チャンク ID です。" + "description": "親チャンク ID です。[チャンク一覧を取得](/ja/api-reference/chunks/list-chunks) から取得します。" } ], "responses": { @@ -10112,6 +9522,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -10130,7 +9546,7 @@ ], "summary": "ナレッジベースからチャンクを取得 / テスト検索", "description": "ナレッジベースを検索し、クエリに最も関連性の高いチャンクを返します。本番環境の検索とテスト検索の両方に使用できます。", - "operationId": "retrieveSegments", + "operationId": "dataset_hit_testing", "parameters": [ { "name": "dataset_id", @@ -10148,47 +9564,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "query" - ], - "properties": { - "query": { - "type": "string", - "maxLength": 250, - "description": "検索クエリテキストです。" - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "検索モデルの設定です。このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" - }, - "attachment_ids": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true, - "description": "検索コンテキストに含める添付ファイル ID のリストです。" - }, - "external_retrieval_model": { - "type": "object", - "description": "外部ナレッジベースの検索設定です。", - "properties": { - "top_k": { - "type": "integer", - "description": "返す結果の最大数です。" - }, - "score_threshold": { - "type": "number", - "description": "結果をフィルタリングするための最小類似度スコアのしきい値です。" - }, - "score_threshold_enabled": { - "type": "boolean", - "description": "スコアしきい値によるフィルタリングを有効にするかどうか。" - } - } - } - } + "$ref": "#/components/schemas/HitTestingPayload" } } } @@ -10199,231 +9575,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "query": { - "type": "object", - "description": "元のクエリオブジェクトです。", - "properties": { - "content": { - "type": "string", - "description": "クエリテキストです。" - } - } - }, - "records": { - "type": "array", - "items": { - "type": "object", - "properties": { - "segment": { - "type": "object", - "description": "ナレッジベースから一致したチャンクです。", - "properties": { - "id": { - "type": "string", - "description": "チャンクの一意識別子です。" - }, - "position": { - "type": "integer", - "description": "ドキュメント内のチャンクの位置。" - }, - "document_id": { - "type": "string", - "description": "このチャンクが属するドキュメントの ID です。" - }, - "content": { - "type": "string", - "description": "チャンクのテキスト内容です。" - }, - "sign_content": { - "type": "string", - "description": "整合性検証用の署名付きコンテンツハッシュです。" - }, - "answer": { - "type": "string", - "description": "回答コンテンツです。Q&A モードのドキュメントで使用されます。" - }, - "word_count": { - "type": "integer", - "description": "チャンク内容の単語数です。" - }, - "tokens": { - "type": "integer", - "description": "チャンク内容のトークン数です。" - }, - "keywords": { - "type": "array", - "description": "キーワードベースの検索のためにこのチャンクに関連付けられたキーワードです。", - "items": { - "type": "string" - } - }, - "index_node_id": { - "type": "string", - "description": "ベクトルストア内のインデックスノードの ID です。" - }, - "index_node_hash": { - "type": "string", - "description": "インデックスされたコンテンツのハッシュです。変更の検出に使用されます。" - }, - "hit_count": { - "type": "integer", - "description": "このチャンクが検索クエリでマッチした回数です。" - }, - "enabled": { - "type": "boolean", - "description": "このチャンクが検索に対して有効かどうかです。" - }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "チャンクが無効化されたタイムスタンプです。有効な場合は `null` です。" - }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "チャンクを無効化したユーザーの ID です。有効な場合は `null` です。" - }, - "status": { - "type": "string", - "description": "チャンクのインデックスステータスです。" - }, - "created_by": { - "type": "string", - "description": "チャンクを作成したユーザーの ID です。" - }, - "created_at": { - "type": "number", - "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" - }, - "indexing_at": { - "type": "number", - "nullable": true, - "description": "インデックス作成が開始されたタイムスタンプです。まだ開始されていない場合は `null` です。" - }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "インデックス作成が完了したタイムスタンプです。まだ完了していない場合は `null` です。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "インデックス作成が失敗した場合のエラーメッセージです。エラーなしの場合は `null` です。" - }, - "stopped_at": { - "type": "number", - "nullable": true, - "description": "インデックス作成が停止されたタイムスタンプです。停止されていない場合は `null` です。" - }, - "document": { - "type": "object", - "description": "マッチしたチャンクの親ドキュメント情報です。", - "properties": { - "id": { - "type": "string", - "description": "ドキュメントの一意識別子です。" - }, - "data_source_type": { - "type": "string", - "description": "ドキュメントの作成方法です。" - }, - "name": { - "type": "string", - "description": "ドキュメント名です。" - }, - "doc_type": { - "type": "string", - "nullable": true, - "description": "ドキュメントタイプの分類です。未設定の場合は `null` です。" - }, - "doc_metadata": { - "type": "object", - "nullable": true, - "description": "ドキュメントのメタデータ値です。メタデータが設定されていない場合は `null` です。" - } - } - } - } - }, - "child_chunks": { - "type": "array", - "description": "階層インデックスを使用している場合、チャンク内でマッチした子チャンクです。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "子チャンクの一意識別子です。" - }, - "content": { - "type": "string", - "description": "子チャンクのテキスト内容です。" - }, - "position": { - "type": "integer", - "description": "親チャンク内の子チャンクの位置です。" - }, - "score": { - "type": "number", - "description": "子チャンクの関連性スコアです。" - } - } - } - }, - "score": { - "type": "number", - "description": "関連性スコアです。" - }, - "tsne_position": { - "type": "object", - "nullable": true, - "description": "t-SNE 可視化の位置です。" - }, - "files": { - "type": "array", - "description": "このチャンクに添付されたファイルです。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "添付ファイルの識別子です。" - }, - "name": { - "type": "string", - "description": "元のファイル名です。" - }, - "size": { - "type": "integer", - "description": "ファイルサイズ(バイト)。" - }, - "extension": { - "type": "string", - "description": "ファイル拡張子。" - }, - "mime_type": { - "type": "string", - "description": "ファイルの MIME タイプ。" - }, - "source_url": { - "type": "string", - "description": "添付ファイルにアクセスする URL です。" - } - } - } - }, - "summary": { - "type": "string", - "nullable": true, - "description": "要約インデックス経由で取得された場合の要約コンテンツです。" - } - } - }, - "description": "一致した検索レコードのリスト。" - } - } + "$ref": "#/components/schemas/HitTestingResponse" }, "examples": { "success": { @@ -10597,6 +9749,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -10615,24 +9773,13 @@ ], "summary": "ナレッジベースタグを作成", "description": "ナレッジベースを整理するためのタグを作成します。", - "operationId": "createKnowledgeTag", + "operationId": "create_dataset_tag", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 50, - "description": "タグ名です。ワークスペース内で一意である必要があります。" - } - } + "$ref": "#/components/schemas/TagCreatePayload" } } } @@ -10643,26 +9790,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "タグ識別子です。" - }, - "name": { - "type": "string", - "description": "タグの表示名です。" - }, - "type": { - "type": "string", - "description": "タグタイプです。ナレッジベースタグの場合は常に `knowledge` です。" - }, - "binding_count": { - "type": "string", - "nullable": true, - "description": "このタグにバインドされたナレッジベースの数です。" - } - } + "$ref": "#/components/schemas/KnowledgeTagResponse" }, "examples": { "success": { @@ -10694,6 +9822,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -10710,36 +9850,14 @@ ], "summary": "ナレッジベースタグリストを取得", "description": "ワークスペース内のすべてのナレッジベースタグを返します。", - "operationId": "getKnowledgeTags", + "operationId": "list_dataset_tags", "responses": { "200": { "description": "タグのリストです。", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "タグ識別子です。" - }, - "name": { - "type": "string", - "description": "タグの表示名です。" - }, - "type": { - "type": "string", - "description": "タグタイプです。ナレッジベースタグの場合は常に `knowledge` です。" - }, - "binding_count": { - "type": "string", - "nullable": true, - "description": "このタグにバインドされたナレッジベースの数です。" - } - } - } + "$ref": "#/components/schemas/KnowledgeTagListResponse" }, "examples": { "success": { @@ -10756,6 +9874,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -10772,29 +9902,13 @@ ], "summary": "ナレッジベースタグを変更", "description": "ナレッジベースタグの名前を変更します。", - "operationId": "updateKnowledgeTag", + "operationId": "update_dataset_tag", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "tag_id", - "name" - ], - "properties": { - "tag_id": { - "type": "string", - "description": "名前を変更するタグの ID です。[ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) を参照してください。" - }, - "name": { - "type": "string", - "minLength": 1, - "maxLength": 50, - "description": "タグの新しい名前です。ワークスペース内で一意である必要があります。" - } - } + "$ref": "#/components/schemas/TagUpdatePayload" } } } @@ -10805,26 +9919,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "タグ識別子です。" - }, - "name": { - "type": "string", - "description": "タグの表示名です。" - }, - "type": { - "type": "string", - "description": "タグタイプです。ナレッジベースタグの場合は常に `knowledge` です。" - }, - "binding_count": { - "type": "string", - "nullable": true, - "description": "このタグにバインドされたナレッジベースの数です。" - } - } + "$ref": "#/components/schemas/KnowledgeTagResponse" }, "examples": { "success": { @@ -10873,6 +9968,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -10889,22 +9996,13 @@ ], "summary": "ナレッジベースタグを削除", "description": "ナレッジベースタグを完全に削除します。タグ付けされたナレッジベース自体は削除されません。", - "operationId": "deleteKnowledgeTag", + "operationId": "delete_dataset_tag", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "tag_id" - ], - "properties": { - "tag_id": { - "type": "string", - "description": "削除するタグの ID です。[ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) を参照してください。" - } - } + "$ref": "#/components/schemas/TagDeletePayload" } } } @@ -10929,6 +10027,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -10947,31 +10057,13 @@ ], "summary": "タグをナレッジベースにバインド", "description": "ナレッジベースに 1 つ以上のタグをバインドします。ナレッジベースには複数のタグを設定できます。", - "operationId": "bindTagsToDataset", + "operationId": "bind_dataset_tags", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "tag_ids", - "target_id" - ], - "properties": { - "tag_ids": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "description": "バインドするタグの ID です。[ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) を参照してください。 不明なタグ ID はエラーにならず無視されます。" - }, - "target_id": { - "type": "string", - "description": "タグをバインドするナレッジベースです。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) を参照してください。" - } - } + "$ref": "#/components/schemas/TagBindingPayload" } } } @@ -10996,6 +10088,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -11014,35 +10118,13 @@ ], "summary": "タグとナレッジベースのバインドを解除", "description": "ナレッジベースから 1 つまたは複数のタグを削除します。", - "operationId": "unbindTagFromDataset", + "operationId": "unbind_dataset_tags", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "target_id" - ], - "properties": { - "tag_ids": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "description": "バインド解除するタグ ID のリストです。旧版の `tag_id` を指定しない限り必須です。[ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) を参照してください。" - }, - "tag_id": { - "type": "string", - "deprecated": true, - "description": "旧版の単一タグ用フィールドです。サーバーサイドで `tag_ids` に正規化されます。新規連携では `tag_ids` を使用してください。" - }, - "target_id": { - "type": "string", - "description": "タグのバインドを解除するナレッジベースです。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) を参照してください。" - } - } + "$ref": "#/components/schemas/TagUnbindingPayload" } } } @@ -11067,6 +10149,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -11085,7 +10179,7 @@ ], "summary": "ナレッジベースにバインドされたタグを取得", "description": "ナレッジベースにバインドされたタグを返します。", - "operationId": "queryDatasetTags", + "operationId": "get_dataset_tags_binding_status", "parameters": [ { "name": "dataset_id", @@ -11104,30 +10198,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "タグ識別子です。" - }, - "name": { - "type": "string", - "description": "タグの表示名です。" - } - } - }, - "description": "このナレッジベースにバインドされたタグのリスト。" - }, - "total": { - "type": "integer", - "description": "このナレッジベースにバインドされたタグの合計数です。" - } - } + "$ref": "#/components/schemas/DatasetBoundTagListResponse" }, "examples": { "success": { @@ -11163,22 +10234,11 @@ } } }, - "404": { - "description": "`not_found` : ナレッジベースが見つかりません。", + "401": { "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -11197,7 +10257,7 @@ ], "summary": "メタデータフィールドを作成", "description": "ナレッジベース内のドキュメントを構造化情報でアノテーションするための、カスタムメタデータフィールドを作成します。", - "operationId": "createMetadataFieldJa", + "operationId": "create_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11215,26 +10275,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "type", - "name" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "number", - "time" - ], - "description": "`string` はテキスト値、`number` は数値、`time` は日付/時刻値です。" - }, - "name": { - "type": "string", - "description": "メタデータフィールドの名前です。ナレッジベースのフィールド内で一意であり、255 文字以内である必要があります。" - } - } + "$ref": "#/components/schemas/MetadataArgs" } } } @@ -11245,21 +10286,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "メタデータフィールドの識別子です。" - }, - "name": { - "type": "string", - "description": "メタデータフィールド名です。" - }, - "type": { - "type": "string", - "description": "メタデータフィールドの種類です。" - } - } + "$ref": "#/components/schemas/DatasetMetadataResponse" }, "examples": { "success": { @@ -11332,6 +10359,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -11348,7 +10381,7 @@ ], "summary": "メタデータフィールドリストを取得", "description": "ナレッジベースのすべてのメタデータフィールド(カスタムと組み込みの両方)を、各フィールドを使用しているドキュメント数とともに返します。", - "operationId": "listMetadataFieldsJa", + "operationId": "get_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11367,38 +10400,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "doc_metadata": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "メタデータフィールドの識別子です。" - }, - "name": { - "type": "string", - "description": "メタデータフィールド名です。" - }, - "type": { - "type": "string", - "description": "メタデータフィールドの種類です。" - }, - "count": { - "type": "integer", - "description": "このメタデータフィールドを使用しているドキュメント数です。" - } - } - }, - "description": "メタデータフィールド定義のリスト。" - }, - "built_in_field_enabled": { - "type": "boolean", - "description": "このナレッジベースで組み込みメタデータフィールドが有効かどうかです。" - } - } + "$ref": "#/components/schemas/DatasetMetadataListResponse" }, "examples": { "success": { @@ -11452,6 +10454,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -11470,7 +10478,7 @@ ], "summary": "メタデータフィールドを更新", "description": "カスタムメタデータフィールドの名前を変更します。", - "operationId": "updateMetadataFieldJa", + "operationId": "update_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11498,16 +10506,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "フィールドの新しい名前です。ナレッジベースのフィールド内で一意であり、255 文字以内である必要があります。" - } - } + "$ref": "#/components/schemas/MetadataUpdatePayload" } } } @@ -11518,21 +10517,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "メタデータフィールドの識別子です。" - }, - "name": { - "type": "string", - "description": "メタデータフィールド名です。" - }, - "type": { - "type": "string", - "description": "メタデータフィールドの種類です。" - } - } + "$ref": "#/components/schemas/DatasetMetadataResponse" }, "examples": { "success": { @@ -11605,6 +10590,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -11621,7 +10612,7 @@ ], "summary": "メタデータフィールドを削除", "description": "カスタムメタデータフィールドを完全に削除します。このフィールドを使用していたドキュメントは、それに対応する値を失います。", - "operationId": "deleteMetadataFieldJa", + "operationId": "delete_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11689,6 +10680,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -11707,7 +10704,7 @@ ], "summary": "組み込みメタデータフィールドを取得", "description": "システムが提供する組み込みメタデータフィールドを返します。", - "operationId": "getBuiltInMetadataFieldsJa", + "operationId": "get_built_in_fields", "parameters": [ { "name": "dataset_id", @@ -11726,26 +10723,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "fields": { - "type": "array", - "description": "システム提供のメタデータフィールドのリストです。", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "組み込みフィールド識別子です。`document_name` はドキュメントタイトル、`uploader` は作成者、`upload_date` は作成日時、`last_update_date` は最終更新日時、`source` はドキュメントの出典を示します。" - }, - "type": { - "type": "string", - "description": "フィールドのデータ型です。テキスト値の場合は `string`、日時値の場合は `time` です。" - } - } - } - } - } + "$ref": "#/components/schemas/DatasetMetadataBuiltInFieldsResponse" }, "examples": { "success": { @@ -11796,22 +10774,11 @@ } } }, - "404": { - "description": "`not_found` : ナレッジベースが見つかりません。", + "401": { "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -11830,30 +10797,31 @@ ], "summary": "組み込みメタデータフィールドを更新", "description": "ナレッジベースの組み込みメタデータフィールドを有効または無効にします。", - "operationId": "toggleBuiltInMetadataFieldJa", + "operationId": "toggle_built_in_field", "parameters": [ { - "name": "dataset_id", + "name": "action", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "disable", + "enable" + ], + "description": "`enable` で内蔵メタデータフィールドを有効化、`disable` で無効化します。" }, - "description": "ナレッジベース ID です。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) を参照してください。" + "description": "`enable` で内蔵メタデータフィールドを有効化、`disable` で無効化します。" }, { - "name": "action", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", - "enum": [ - "enable", - "disable" - ] + "format": "uuid" }, - "description": "`enable` で内蔵メタデータフィールドを有効化、`disable` で無効化します。" + "description": "ナレッジベース ID です。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) を参照してください。" } ], "responses": { @@ -11862,13 +10830,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "操作結果です。" - } - } + "$ref": "#/components/schemas/DatasetMetadataActionResponse" }, "examples": { "success": { @@ -11922,6 +10884,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -11940,7 +10908,7 @@ ], "summary": "ドキュメントメタデータを一括更新", "description": "複数のドキュメントのメタデータ値を 1 回のリクエストで更新します。", - "operationId": "batchUpdateDocumentMetadataJa", + "operationId": "update_documents_metadata", "parameters": [ { "name": "dataset_id", @@ -11958,58 +10926,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "operation_data" - ], - "properties": { - "operation_data": { - "type": "array", - "items": { - "type": "object", - "required": [ - "document_id", - "metadata_list" - ], - "properties": { - "document_id": { - "type": "string", - "description": "更新するドキュメントの ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) を参照してください。" - }, - "metadata_list": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string", - "description": "メタデータフィールド ID です。[メタデータフィールドリストを取得](/ja/api-reference/metadata/list-metadata-fields) を参照してください。" - }, - "name": { - "type": "string", - "description": "メタデータフィールド名です。" - }, - "value": { - "description": "メタデータ値。文字列、数値、または `null` を指定できます。" - } - } - }, - "description": "ドキュメントに設定するメタデータフィールドです。" - }, - "partial_update": { - "type": "boolean", - "default": false, - "description": "メタデータを部分的に更新し、未指定フィールドの既存の値を保持するかどうかです。" - } - } - }, - "description": "ドキュメントメタデータの更新操作です。ドキュメントごとに 1 エントリです。" - } - } + "$ref": "#/components/schemas/MetadataOperationData" } } } @@ -12020,13 +10937,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "操作結果です。" - } - } + "$ref": "#/components/schemas/DatasetMetadataActionResponse" }, "examples": { "success": { @@ -12113,6 +11024,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -12131,7 +11048,7 @@ ], "summary": "利用可能なモデルを取得", "description": "指定したタイプの利用可能なモデルを返します。ナレッジベースに設定する `text-embedding` モデルと `rerank` モデルを見つけるために使用します。", - "operationId": "getAvailableModelsJa", + "operationId": "get_available_models", "parameters": [ { "name": "model_type", @@ -12140,12 +11057,12 @@ "schema": { "type": "string", "enum": [ - "text-embedding", - "rerank", "llm", - "tts", + "moderation", + "rerank", "speech2text", - "moderation" + "text-embedding", + "tts" ] }, "description": "取得するモデルのタイプです。ナレッジベースの設定には、埋め込みモデルの場合は `text-embedding`、リランキングモデルの場合は `rerank` を使用します。" @@ -12157,133 +11074,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "利用可能なモデルを持つモデルプロバイダーのリストです。", - "items": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "description": "モデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。以前のプロバイダーでは短縮形(例:`openai`)が返される場合があります。" - }, - "label": { - "type": "object", - "description": "プロバイダーのローカライズ表示名です。", - "properties": { - "en_US": { - "type": "string", - "description": "英語表示名。" - }, - "zh_Hans": { - "type": "string", - "description": "中国語表示名。" - } - } - }, - "icon_small": { - "type": "object", - "description": "プロバイダーの小アイコンの URL です。", - "properties": { - "en_US": { - "type": "string", - "description": "小アイコン URL。" - }, - "zh_Hans": { - "type": "string", - "description": "中国語アイコンの URL。" - } - } - }, - "status": { - "type": "string", - "description": "プロバイダーのステータスです。認証情報が設定済みで有効な場合は `active` です。" - }, - "models": { - "type": "array", - "description": "このプロバイダーから利用可能なモデルのリストです。", - "items": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "モデル識別子です。ナレッジベースの作成または更新時に `embedding_model` の値として使用します。" - }, - "label": { - "type": "object", - "description": "モデルのローカライズ表示名です。", - "properties": { - "en_US": { - "type": "string", - "description": "英語モデル名。" - }, - "zh_Hans": { - "type": "string", - "description": "中国語モデル名。" - } - } - }, - "model_type": { - "type": "string", - "description": "モデルのタイプです。`model_type` パスパラメータと一致します。" - }, - "features": { - "type": "array", - "nullable": true, - "description": "モデルがサポートする機能です。なしの場合は `null` です。", - "items": { - "type": "string" - } - }, - "fetch_from": { - "type": "string", - "description": "モデル定義の取得元です。`predefined-model` は組み込みモデル、`customizable-model` はユーザー設定モデルを示します。" - }, - "model_properties": { - "type": "object", - "description": "`context_size` などのモデル固有のプロパティです。" - }, - "status": { - "type": "string", - "description": "モデルの利用可能ステータスです。使用可能な場合は `active` です。" - }, - "deprecated": { - "type": "boolean", - "description": "モデルが非推奨かどうか。" - }, - "load_balancing_enabled": { - "type": "boolean", - "description": "モデルのロードバランシングが有効かどうか。" - }, - "has_invalid_load_balancing_configs": { - "type": "boolean", - "description": "モデルに無効なロードバランシング設定があるかどうか。" - } - } - } - }, - "tenant_id": { - "type": "string", - "description": "このプロバイダー設定が属するワークスペース ID。" - }, - "icon_small_dark": { - "type": "object", - "description": "ダークモード用アイコンの URL。プロバイダーにない場合は `null`。", - "properties": { - "en_US": { - "type": "string" - }, - "zh_Hans": { - "type": "string" - } - } - } - } - } - } - } + "$ref": "#/components/schemas/ProviderWithModelsListResponse" }, "examples": { "success": { @@ -12329,6 +11120,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -12347,7 +11144,7 @@ ], "summary": "パイプラインファイルをアップロード", "description": "ナレッジパイプラインで使用するファイルをアップロードします。返された `id` を [パイプラインを実行](/ja/api-reference/knowledge-pipeline/run-pipeline) の `local_file` アイテムの `reference` として使用します。", - "operationId": "uploadPipelineFileJa", + "operationId": "knowledgebase_pipeline_file_upload", "requestBody": { "required": true, "content": { @@ -12374,39 +11171,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "アップロードされたファイルの一意識別子です。" - }, - "name": { - "type": "string", - "description": "元のファイル名です。" - }, - "size": { - "type": "integer", - "description": "ファイルサイズ(バイト)。" - }, - "extension": { - "type": "string", - "description": "ファイル拡張子。" - }, - "mime_type": { - "type": "string", - "nullable": true, - "description": "ファイルの MIME タイプです。アップロードに MIME タイプが含まれない場合、`null` となることがあります。" - }, - "created_by": { - "type": "string", - "description": "ファイルをアップロードしたユーザーの ID。" - }, - "created_at": { - "type": "string", - "nullable": true, - "description": "アップロードのタイムスタンプ(ISO 8601 形式)です。レコード作成中は `null` となることがあります。" - } - } + "$ref": "#/components/schemas/PipelineUploadFileResponse" }, "examples": { "success": { @@ -12491,6 +11256,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } }, "x-mint": { @@ -12516,7 +11293,7 @@ ], "summary": "データソースプラグインリストを取得", "description": "ナレッジパイプラインに設定されたデータソースノードを、それぞれが使用するプラグインとノードの実行に必要なメタデータとともに返します。", - "operationId": "listDatasourcePluginsJa", + "operationId": "list_rag_pipeline_datasource_plugins", "parameters": [ { "name": "dataset_id", @@ -12535,7 +11312,8 @@ "type": "boolean", "default": true }, - "description": "ドラフトではなく公開済みパイプラインバージョンからノードを読み取るかどうかを指定します。" + "description": "ドラフトではなく公開済みパイプラインバージョンからノードを読み取るかどうかを指定します。", + "required": false } ], "responses": { @@ -12544,65 +11322,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "パイプラインワークフロー内のデータソースノードの ID です。 [データソースノードを実行](/ja/api-reference/knowledge-pipeline/run-datasource-node) では `node_id` として、 [パイプラインを実行](/ja/api-reference/knowledge-pipeline/run-pipeline) では `start_node_id` として渡します。" - }, - "plugin_id": { - "type": "string", - "description": "このノードを提供するデータソースプラグインの ID です。" - }, - "provider_name": { - "type": "string", - "description": "データソースプラグインが登録するプロバイダー名です。" - }, - "datasource_type": { - "type": "string", - "description": "データソースのタイプです。`local_file`、`online_document`、`online_drive`、`website_crawl` のいずれかです。" - }, - "title": { - "type": "string", - "description": "ノードに設定されている表示タイトルです。" - }, - "user_input_variables": { - "type": "array", - "description": "このデータソースに対して呼び出し元が指定するパイプライン入力変数です。ノードのデータソースパラメータ内の `{{#...#}}` 参照から導出されます。各要素はワークフローが使用するパイプライン変数のスキーマに従います。", - "items": { - "type": "object", - "additionalProperties": true - } - }, - "credentials": { - "type": "array", - "description": "このデータソースの認証に利用できる資格情報のリストです。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "資格情報の ID です。 [データソースノードを実行](/ja/api-reference/knowledge-pipeline/run-datasource-node) では `credential_id` として、 [パイプラインを実行](/ja/api-reference/knowledge-pipeline/run-pipeline) の各データソース項目の `credential_id` フィールドとして渡します。" - }, - "name": { - "type": "string", - "description": "資格情報の表示名です。" - }, - "type": { - "type": "string", - "description": "データソースプラグインが定義する資格情報のタイプです。" - }, - "is_default": { - "type": "boolean", - "description": "この資格情報がプロバイダーのデフォルトかどうかを示します。" - } - } - } - } - } - } + "$ref": "#/components/schemas/DatasourcePluginListResponse" }, "examples": { "success": { @@ -12680,6 +11400,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -12698,7 +11424,7 @@ ], "summary": "データソースノードを実行", "description": "ナレッジパイプライン内の単一のデータソースノードを実行し、その実行イベントをストリーミングします。", - "operationId": "runDatasourceNodeJa", + "operationId": "run_datasource_node", "parameters": [ { "name": "dataset_id", @@ -12725,38 +11451,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "inputs", - "datasource_type", - "is_published" - ], - "properties": { - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "データソースノードの入力変数です。" - }, - "datasource_type": { - "type": "string", - "enum": [ - "online_document", - "local_file", - "website_crawl", - "online_drive" - ], - "description": "データソースの種類です。" - }, - "credential_id": { - "type": "string", - "nullable": true, - "description": "データソースとの認証に使用する認証情報の ID です。[データソースプラグインリストを取得](/ja/api-reference/knowledge-pipeline/list-datasource-plugins) の `credentials` 配列から取得します。" - }, - "is_published": { - "type": "boolean", - "description": "ドラフトではなくノードの公開バージョンを実行するかどうかを指定します。" - } - } + "$ref": "#/components/schemas/DatasourceNodeRunPayload" } } } @@ -12823,6 +11518,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -12841,7 +11542,7 @@ ], "summary": "パイプラインを実行", "description": "1 つ以上のデータソースに対して完全なナレッジパイプラインを実行します。`response_mode` でストリーミングまたはブロッキングのレスポンスを選択します。", - "operationId": "runPipelineJa", + "operationId": "run_pipeline", "parameters": [ { "name": "dataset_id", @@ -12859,160 +11560,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "inputs", - "datasource_type", - "datasource_info_list", - "start_node_id", - "is_published", - "response_mode" - ], - "properties": { - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "パイプライン入力変数のキーと値のペア。ワークフローで定義されたパイプライン変数に対応します。入力変数がない場合は `{}` を渡してください。" - }, - "datasource_type": { - "type": "string", - "enum": [ - "local_file", - "online_document", - "website_crawl", - "online_drive" - ], - "description": "データソースのタイプ。`datasource_info_list` の各項目に必要なフィールドを決定します。" - }, - "datasource_info_list": { - "type": "array", - "description": "処理対象のデータソースオブジェクトのリストです。項目の構造は `datasource_type` によって異なります。", - "items": { - "oneOf": [ - { - "title": "Local File", - "type": "object", - "required": [ - "reference" - ], - "properties": { - "reference": { - "type": "string", - "description": "[パイプラインファイルアップロード](/ja/api-reference/knowledge-pipeline/upload-pipeline-file) エンドポイントから返される `id` を使用してください。`related_id` もエイリアスとして使用可能です。" - }, - "name": { - "type": "string", - "description": "ドキュメントのタイトルです。デフォルトは `\"untitled\"` です。" - } - } - }, - { - "title": "Online Document", - "type": "object", - "required": [ - "workspace_id", - "page" - ], - "properties": { - "workspace_id": { - "type": "string", - "description": "外部プラットフォームのワークスペースまたはデータベース ID(例:Notion のワークスペース ID)。" - }, - "page": { - "type": "object", - "description": "ページの詳細です。", - "required": [ - "page_id", - "type" - ], - "properties": { - "page_id": { - "type": "string", - "description": "ページ識別子です。" - }, - "type": { - "type": "string", - "description": "データソースプラグインで定義されたページタイプ(例:`\"page\"`、`\"database\"`)。" - }, - "page_name": { - "type": "string", - "description": "表示名です。デフォルトは `\"untitled\"` です。" - } - } - }, - "credential_id": { - "type": "string", - "description": "外部プラットフォームとの認証用クレデンシャルです。Dify コンソールで管理します。省略した場合、プロバイダーのデフォルトクレデンシャルが使用されます。" - } - } - }, - { - "title": "Website Crawl", - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "type": "string", - "description": "クロール対象の URL です。" - }, - "title": { - "type": "string", - "description": "ドキュメント名として使用されます。デフォルトは `\"untitled\"` です。" - } - } - }, - { - "title": "Online Drive", - "type": "object", - "required": [ - "id", - "type" - ], - "properties": { - "id": { - "type": "string", - "description": "ファイルまたはフォルダの ID です。" - }, - "type": { - "type": "string", - "enum": [ - "file", - "folder" - ], - "description": "この項目が単一ファイルか、展開対象のフォルダかを指定します。" - }, - "bucket": { - "type": "string", - "description": "ストレージバケット名です。一部のドライブプロバイダー(S3 互換ストレージなど)で必要です。プロバイダーがバケットを使用しない場合は省略できます。" - }, - "name": { - "type": "string", - "description": "ファイル名です。デフォルトは `\"untitled\"` です。" - } - } - } - ] - } - }, - "start_node_id": { - "type": "string", - "description": "実行を開始するノードの ID です。[データソースプラグインリストを取得](/ja/api-reference/knowledge-pipeline/list-datasource-plugins) から取得します。" - }, - "is_published": { - "type": "boolean", - "description": "現在のドラフトではなくパイプラインの公開バージョンを実行するかどうかを指定します。未公開の変更をテストするにはドラフトを実行します。" - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" - ], - "description": "パイプライン実行のレスポンスモードです。`streaming` は Server-Sent Events ストリームを返し、`blocking` は完了まで待機して完全な結果を返します。" - } - } + "$ref": "#/components/schemas/PipelineRunApiEntity" }, "examples": { "local_file": { @@ -13102,9 +11650,8 @@ }, "application/json": { "schema": { - "type": "object", "description": "パイプライン実行の完全な結果です。`response_mode` が `blocking` の場合に返されます。", - "additionalProperties": true + "$ref": "#/components/schemas/PipelineRunJsonResponse" }, "examples": { "success": { @@ -13192,6 +11739,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" } }, "x-mint": { @@ -13202,679 +11755,591 @@ } } } - } - }, - "components": { - "securitySchemes": { - "ApiKeyAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "API_KEY", - "description": "すべてのリクエストは API キーで認証します:`Authorization: Bearer {API_KEY}`。アプリのエンドポイントにはアプリの API キーを、ナレッジのエンドポイントにはナレッジベースの API キーを使用します([Dify API クイックスタート](/ja/api-reference/guides/get-started))。\n\nキーはサーバーサイドで保管し、クライアントコードには決して埋め込まないでください。キーが欠落または無効なリクエストは HTTP `401`(`unauthorized`)で失敗します。" - } }, - "responses": { - "SuccessResult": { - "description": "操作が成功しました。", - "content": { - "application/json": { + "/datasets/{dataset_id}/document/create_by_file": { + "post": { + "deprecated": true, + "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + "operationId": "create_document_by_file_75a87285", + "parameters": [ + { + "in": "path", + "name": "dataset_id", + "required": true, "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "操作結果。常に `success` です。" - } - } - }, - "examples": { - "success": { - "summary": "レスポンス例", - "value": { - "result": "success" - } - } + "format": "uuid", + "type": "string" } } - } - } - }, - "schemas": { - "ChatRequest": { - "type": "object", - "required": [ - "inputs", - "query", - "user" ], - "properties": { - "query": { - "type": "string", - "description": "ユーザーのメッセージです。" - }, - "inputs": { - "type": "object", - "description": "アプリの入力変数の値を、変数名をキーとして指定します。期待される名前と型は、[アプリケーションのパラメータ情報を取得](/ja/api-reference/applications/get-app-parameters) の `user_input_form` フィールドで確認できます。", - "additionalProperties": true - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" - ], - "description": "レスポンスの返却モードです。省略した場合はブロッキングになります。\n\n- `streaming`(推奨):応答は Server-Sent Events として届きます。\n- `blocking`:生成の完了後に返します。長時間の生成は中断されるおそれがあります。Dify Cloud では、応答がタイムアウト内に届かないと、エッジプロキシが接続を終了する場合があります。\n- Agent と新しい Agent アプリは `streaming` のみに対応します。`blocking` のリクエストは 400 で失敗します。" - }, - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。会話、メッセージ、ファイルは、同じ `user` を持つリクエストにのみ表示されます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" - }, - "conversation_id": { - "type": "string", - "description": "継続する会話の ID です。省略するか空文字列を渡すと新しい会話を開始します。レスポンスで `conversation_id` が返されるので、次のメッセージで渡します。以前の会話を再開するには、その ID を [会話一覧を取得](/ja/api-reference/conversations/list-conversations) から取得します。" - }, - "files": { - "type": "array", - "description": "メッセージに添付するファイルです。ローカルファイルの場合は、まず [ファイルをアップロード](/ja/api-reference/files/upload-file) でアップロードし、返された `id` を `upload_file_id` として `transfer_method: local_file` で参照します。新しい Agent アプリはファイル参照を受け付けますが、その内容は処理しません。", - "items": { - "type": "object", - "required": [ - "type", - "transfer_method" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "document", - "audio", - "video", - "custom" - ], - "description": "ファイルタイプ。" - }, - "transfer_method": { - "type": "string", - "enum": [ - "remote_url", - "local_file" - ], - "description": "転送方法です。ファイル URL の場合は `remote_url`、アップロードファイルの場合は `local_file` です。" - }, - "url": { - "type": "string", - "format": "url", - "description": "ファイル URL(`transfer_method` が `remote_url` の場合は必須)です。" + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "data": { + "type": "string" + }, + "file": { + "format": "binary", + "type": "string" + } }, - "upload_file_id": { - "type": "string", - "description": "[ファイルをアップロード](/ja/api-reference/files/upload-file) API から取得したアップロード済みファイル ID です(`transfer_method` が `local_file` の場合は必須)。" - } + "required": [ + "file" + ], + "type": "object" } } }, - "auto_generate_name": { - "type": "boolean", - "description": "会話タイトルを自動生成します。`false` の場合、[会話の名前を変更](/ja/api-reference/conversations/rename-conversation) API で `auto_generate: true` を設定して非同期でタイトルを生成します。", - "default": true - }, - "workflow_id": { - "type": "string", - "description": "Chatflow アプリでのみ使用できます。 実行する公開済みワークフローバージョンの ID を指定します。指定しない場合、最新の公開バージョンが使用されます。Dify Cloud では、バージョンの指定には有料プランが必要です。" - } - } - }, - "ChatCompletionResponse": { - "type": "object", - "properties": { - "event": { - "type": "string", - "description": "イベントタイプ。`message` に固定されています。" - }, - "task_id": { - "type": "string", - "format": "uuid", - "description": "リクエスト追跡およびレスポンス停止 API 用のタスク ID です。" - }, - "id": { - "type": "string", - "format": "uuid", - "description": "このレスポンスイベントの一意 ID です。" - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "一意のメッセージ ID です。フィードバックや推奨質問のエンドポイントを呼び出す際に `message_id` パラメータとして使用します。" + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" + } + } + }, + "description": "ドキュメントが正常に作成されました。" }, - "conversation_id": { - "type": "string", - "format": "uuid", - "description": "会話 ID。" + "400": { + "content": { + "application/json": {} + }, + "description": "リクエストパラメーターが無効です。" }, - "mode": { - "type": "string", - "description": "アプリモード。`chat` はチャットボットアプリ、`agent-chat` は Agent アプリ、`advanced-chat` は Chatflow アプリです。" + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" }, - "answer": { - "type": "string", - "description": "完全なレスポンスコンテンツ。" + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" }, - "metadata": { - "type": "object", - "description": "使用量と検索リソースを含むメタデータ。", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" - }, - "retriever_resources": { - "type": "array", - "description": "使用された検索リソースのリスト。", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } + "413": { + "content": { + "application/json": {} + }, + "description": "リクエストに失敗しました。" + } + }, + "summary": "非推奨の互換エンドポイント", + "tags": [ + "ドキュメント" + ] + } + }, + "/datasets/{dataset_id}/document/create_by_text": { + "post": { + "deprecated": true, + "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + "operationId": "create_document_by_text_deprecated", + "parameters": [ + { + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentTextCreatePayload" } } }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "メッセージ作成タイムスタンプ(Unix エポック秒)。" - } - } - }, - "ChunkChatEvent": { - "type": "object", - "description": "ストリーミングモードにおける Server-Sent Event チャンクのベーススキーマです。", - "properties": { - "event": { - "type": "string", - "description": "イベントの種類です。", - "enum": [ - "message", - "agent_message", - "agent_thought", - "tts_message", - "tts_message_end", - "message_file", - "message_end", - "message_replace", - "reasoning_chunk", - "workflow_started", - "workflow_finished", - "node_started", - "node_finished", - "node_retry", - "iteration_started", - "iteration_next", - "iteration_completed", - "loop_started", - "loop_next", - "loop_completed", - "workflow_paused", - "human_input_required", - "human_input_form_filled", - "human_input_form_timeout", - "agent_log", - "text_chunk", - "error", - "ping" - ] - } + "required": true }, - "discriminator": { - "propertyName": "event", - "mapping": { - "message": "#/components/schemas/StreamEventChatMessage", - "agent_message": "#/components/schemas/StreamEventChatAgentMessage", - "tts_message": "#/components/schemas/StreamEventChatTtsMessage", - "tts_message_end": "#/components/schemas/StreamEventChatTtsMessageEnd", - "agent_thought": "#/components/schemas/StreamEventChatAgentThought", - "message_file": "#/components/schemas/StreamEventChatMessageFile", - "message_end": "#/components/schemas/StreamEventChatMessageEnd", - "message_replace": "#/components/schemas/StreamEventChatMessageReplace", - "error": "#/components/schemas/StreamEventChatError", - "ping": "#/components/schemas/StreamEventChatPing", - "reasoning_chunk": "#/components/schemas/StreamEventChatReasoningChunk", - "workflow_started": "#/components/schemas/StreamEventWorkflowStarted", - "workflow_finished": "#/components/schemas/StreamEventWorkflowFinished", - "node_started": "#/components/schemas/StreamEventNodeStarted", - "node_finished": "#/components/schemas/StreamEventNodeFinished", - "node_retry": "#/components/schemas/StreamEventNodeRetry", - "iteration_started": "#/components/schemas/StreamEventIterationStarted", - "iteration_next": "#/components/schemas/StreamEventIterationNext", - "iteration_completed": "#/components/schemas/StreamEventIterationCompleted", - "loop_started": "#/components/schemas/StreamEventLoopStarted", - "loop_next": "#/components/schemas/StreamEventLoopNext", - "loop_completed": "#/components/schemas/StreamEventLoopCompleted", - "workflow_paused": "#/components/schemas/StreamEventWorkflowPaused", - "human_input_required": "#/components/schemas/StreamEventHumanInputRequired", - "human_input_form_filled": "#/components/schemas/StreamEventHumanInputFormFilled", - "human_input_form_timeout": "#/components/schemas/StreamEventHumanInputFormTimeout", - "agent_log": "#/components/schemas/StreamEventAgentLog", - "text_chunk": "#/components/schemas/StreamEventChatTextChunk" - } - } - }, - "StreamEventBase": { - "type": "object", - "description": "ストリームイベントの基本プロパティです。", - "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "タスク ID。" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" + } + } + }, + "description": "リクエストが成功しました。" }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "一意のメッセージ ID。" + "400": { + "content": { + "application/json": {} + }, + "description": "リクエストパラメーターが無効です。" }, - "conversation_id": { - "type": "string", - "format": "uuid", - "description": "会話 ID。" + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "作成タイムスタンプ。" + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" } - } - }, - "StreamEventChatMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, + }, + "tags": [ + "service_api" + ], + "summary": "非推奨の互換エンドポイント" + } + }, + "/datasets/{dataset_id}/documents/{document_id}/update_by_file": { + "post": { + "deprecated": true, + "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + "operationId": "update_document_by_file_deprecated_5dc5fe59", + "parameters": [ { - "$ref": "#/components/schemas/StreamEventBase" + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } }, { - "type": "object", - "properties": { - "answer": { - "type": "string", - "description": "LLM が返したテキストチャンクです。" - } + "in": "path", + "name": "document_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" } } - ] - }, - "StreamEventChatAgentMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "properties": { - "answer": { - "type": "string", - "description": "LLM が返したテキストチャンク(エージェントモード)です。" + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "data": { + "type": "string" + }, + "file": { + "format": "binary", + "type": "string" + } + }, + "type": "object" } } - } - ] - }, - "StreamEventChatTtsMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "TTS 音声ストリームイベント(base64 エンコードの Mp3)です。自動再生が有効な場合に利用できます。", - "properties": { - "audio": { - "type": "string", - "format": "byte", - "description": "Base64 エンコードされた MP3 音声チャンク。すべてのチャンクを順番にデコードして連結すると、完全な音声ファイルが生成されます。" + "required": false + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" + } } - } - } - ] - }, - "StreamEventChatTtsMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + }, + "description": "ドキュメントが正常に更新されました。" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "400": { + "content": { + "application/json": {} + }, + "description": "リクエストパラメーターが無効です。" }, - { - "type": "object", - "description": "TTS 音声ストリーム終了イベント。", - "properties": { - "audio": { - "type": "string", - "description": "空の文字列。音声ストリームの終了を示します。" - } - } - } - ] - }, - "StreamEventChatAgentThought": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" }, - { - "type": "object", - "description": "エージェントの思考、LLM の推論、ツール呼び出しの詳細(エージェントモード)です。", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "エージェント思考 ID です。" - }, - "position": { - "type": "integer", - "description": "メッセージ内のシーケンスにおけるこの思考の位置です。" - }, - "thought": { - "type": "string", - "description": "LLM が思考している内容です。" - }, - "observation": { - "type": "string", - "description": "ツール呼び出しからのレスポンスです。" - }, - "tool": { - "type": "string", - "description": "呼び出されたツールのリスト(`;` で区切り)です。" - }, - "tool_input": { - "type": "string", - "description": "ツールの入力(JSON 形式)です。" - }, - "message_files": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - }, - "description": "この思考に関連するファイルのファイル ID です。" - } - } - } - ] - }, - "StreamEventChatMessageFile": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "413": { + "content": { + "application/json": {} + }, + "description": "リクエストに失敗しました。" }, - { - "type": "object", - "description": "メッセージファイルイベント。ツールによって作成された新しいファイルです。", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ファイルの一意の ID。" - }, - "type": { - "type": "string", - "description": "ファイルタイプ(例:`image`)。" - }, - "belongs_to": { - "type": "string", - "description": "このファイルの所有者です。ツールが生成したファイルの場合は常に `assistant` です。" - }, - "url": { - "type": "string", - "format": "url", - "description": "ファイルのリモート URL。" - } - } + "415": { + "content": { + "application/json": {} + }, + "description": "リクエストに失敗しました。" } + }, + "summary": "非推奨の互換エンドポイント", + "tags": [ + "ドキュメント" ] - }, - "StreamEventChatMessageEnd": { - "allOf": [ + } + }, + "/datasets/{dataset_id}/documents/{document_id}/update_by_text": { + "post": { + "deprecated": true, + "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + "operationId": "update_document_by_text_deprecated", + "parameters": [ { - "$ref": "#/components/schemas/ChunkChatEvent" + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } }, { - "$ref": "#/components/schemas/StreamEventBase" + "in": "path", + "name": "document_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentTextUpdate" + } + } }, - { - "type": "object", - "description": "メッセージ終了イベント、ストリーミングが終了しました。", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "メッセージの一意な ID。" - }, - "metadata": { - "type": "object", - "description": "使用量と検索リソースを含むメタデータ。", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" - }, - "retriever_resources": { - "type": "array", - "description": "使用された検索リソースのリスト。", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } - } + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" } } - } - } - ] - }, - "StreamEventChatMessageReplace": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + }, + "description": "リクエストが成功しました。" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" }, + "404": { + "content": { + "application/json": {} + }, + "description": "リクエストされたリソースが見つかりません。" + } + }, + "tags": [ + "service_api" + ], + "summary": "非推奨の互換エンドポイント" + } + }, + "/datasets/{dataset_id}/hit-testing": { + "post": { + "deprecated": true, + "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + "operationId": "dataset_hit_testing_f584b2dd", + "parameters": [ { - "type": "object", - "description": "メッセージコンテンツ置換イベント(例:コンテンツモデレーションによるもの)。", - "properties": { - "answer": { - "type": "string", - "description": "置換コンテンツ。" - }, - "reason": { - "type": "string", - "description": "コンテンツ置換の理由。" - } + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" } } - ] - }, - "StreamEventChatError": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "ストリーミング中のエラーイベント。", - "properties": { - "status": { - "type": "integer", - "description": "HTTP ステータスコード。" - }, - "code": { - "type": "string", - "description": "エラーコード。" - }, - "message": { - "type": "string", - "description": "エラーメッセージ。" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HitTestingPayload" } } - } - ] - }, - "StreamEventChatPing": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" }, - { - "type": "object", - "description": "接続を維持するための Ping イベント。`event: ping` 行として送信され、`data:` ペイロードはありません。Chatflow アプリでは、`ping` はストリームの最初のイベントでもあります。" + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HitTestingResponse" + } + } + }, + "description": "検索結果です。" + }, + "400": { + "content": { + "application/json": {} + }, + "description": "リクエストパラメーターが無効です。" + }, + "401": { + "content": { + "application/json": {} + }, + "description": "認証に失敗しました。API トークンが無効です。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "このリソースにアクセスする権限がありません。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "`not_found` : ナレッジベースが見つかりません。" + }, + "500": { + "content": { + "application/json": {} + }, + "description": "`internal_server_error` : 検索中に内部エラーが発生しました。" } + }, + "summary": "非推奨の互換エンドポイント", + "tags": [ + "ナレッジベース" ] + } + } + }, + "components": { + "securitySchemes": { + "Bearer": { + "bearerFormat": "API_KEY", + "description": "すべてのリクエストは API キーで認証します:`Authorization: Bearer {API_KEY}`。アプリのエンドポイントにはアプリの API キーを、ナレッジのエンドポイントにはナレッジベースの API キーを使用します([Dify API クイックスタート](/ja/api-reference/guides/get-started))。\n\nキーはサーバーサイドで保管し、クライアントコードには決して埋め込まないでください。キーが欠落または無効なリクエストは HTTP `401`(`unauthorized`)で失敗します。", + "scheme": "bearer", + "type": "http" + } + }, + "responses": { + "AppInvokeQuotaExceededError": { + "description": "リクエストに失敗しました。" + }, + "Exception": { + "description": "リクエストに失敗しました。" }, - "Usage": { + "HTTPException": { + "description": "リクエストに失敗しました。" + }, + "MaskError": { + "description": "リクエストに失敗しました。" + }, + "ParseError": { + "description": "リクエストに失敗しました。" + }, + "PluginRuntimeError": { + "description": "リクエストに失敗しました。" + }, + "ValueError": { + "description": "リクエストに失敗しました。" + } + }, + "schemas": { + "RetrieverResource": { "type": "object", - "description": "モデルの使用情報です。", + "description": "検索リソースの引用および帰属情報です。", "properties": { - "prompt_tokens": { - "type": "integer", - "description": "プロンプト内のトークン数。" - }, - "prompt_unit_price": { - "type": "string", - "format": "decimal", - "description": "プロンプトトークンあたりの単価。" - }, - "prompt_price_unit": { + "id": { "type": "string", - "format": "decimal", - "description": "プロンプトトークンの価格単位。" + "format": "uuid", + "description": "検索リソースの一意の ID。" }, - "prompt_price": { + "message_id": { "type": "string", - "format": "decimal", - "description": "プロンプトトークンの合計価格。" + "format": "uuid", + "description": "このリソースが属するメッセージの ID。" }, - "completion_tokens": { + "position": { "type": "integer", - "description": "補完のトークン数。" - }, - "completion_unit_price": { - "type": "string", - "format": "decimal", - "description": "補完トークンあたりの単価。" - }, - "completion_price_unit": { - "type": "string", - "format": "decimal", - "description": "補完トークンの価格単位。" - }, - "completion_price": { - "type": "string", - "format": "decimal", - "description": "補完トークンの合計価格。" - }, - "total_tokens": { - "type": "integer", - "description": "使用されたトークンの合計数。" - }, - "total_price": { - "type": "string", - "format": "decimal", - "description": "すべてのトークンの合計価格。" - }, - "currency": { - "type": "string", - "description": "課金通貨。" - }, - "latency": { - "type": "number", - "format": "double", - "description": "レイテンシ(秒)。" - } - } - }, - "RetrieverResource": { - "type": "object", - "description": "検索リソースの引用および帰属情報です。", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "検索リソースの一意の ID。" - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "このリソースが属するメッセージの ID。" - }, - "position": { - "type": "integer", - "description": "リスト内のリソースの位置。" + "description": "リスト内のリソースの位置。" }, "dataset_id": { - "type": "string", - "format": "uuid", - "description": "ナレッジベース ID。" + "description": "ナレッジベース ID。", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "dataset_name": { - "type": "string", - "description": "ナレッジベース名。" + "description": "ナレッジベース名。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "document_id": { - "type": "string", - "format": "uuid", - "description": "ドキュメント ID。" + "description": "ドキュメント ID。", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "document_name": { - "type": "string", - "description": "ドキュメント名。" + "description": "ドキュメント名。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "data_source_type": { - "type": "string", - "description": "データソースのタイプ。" + "description": "データソースのタイプ。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "segment_id": { - "type": "string", - "format": "uuid", - "description": "ドキュメント内の特定のチャンクの ID。" + "description": "ドキュメント内の特定のチャンクの ID。", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "score": { - "type": "number", - "format": "float", - "description": "リソースの関連性スコア。" + "description": "リソースの関連性スコア。", + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "null" + } + ], + "default": null }, "hit_count": { - "type": "integer", - "description": "このチャンクがヒットした回数。" + "description": "このチャンクがヒットした回数。", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, "word_count": { - "type": "integer", - "description": "チャンクの単語数。" + "description": "チャンクの単語数。", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, "segment_position": { - "type": "integer", - "description": "ドキュメント内のチャンクの位置。" + "description": "ドキュメント内のチャンクの位置。", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, "index_node_hash": { - "type": "string", - "description": "インデックスノードのハッシュ。" + "description": "インデックスノードのハッシュ。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "content": { - "type": "string", - "description": "リソースからのコンテンツスニペット。" + "description": "リソースからのコンテンツスニペット。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "summary": { "type": "string", @@ -13882,92 +12347,22 @@ "description": "チャンクコンテンツの要約。" }, "created_at": { - "type": "integer", - "format": "int64", - "description": "作成タイムスタンプ(Unix エポック秒)。" - } - } - }, - "FileUploadResponse": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "一意のファイル ID。" - }, - "reference": { - "type": "string", - "nullable": true, - "description": "Agent やツールのコンテキストでファイルを添付する際に内部的に使用される不透明なファイル参照です。このエンドポイントでアップロードされたファイルでは常に `null` です。" - }, - "name": { - "type": "string", - "description": "ファイル名。" - }, - "size": { - "type": "integer", - "description": "ファイルサイズ(バイト)。" - }, - "extension": { - "type": "string", - "nullable": true, - "description": "ファイル拡張子。" - }, - "mime_type": { - "type": "string", - "nullable": true, - "description": "ファイルの MIME タイプ。" - }, - "created_by": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "アップロードしたエンドユーザーの ID。[エンドユーザー取得](/ja/api-reference/end-users/get-end-user-info) で詳細を確認できます。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "アップロードタイムスタンプ(Unix エポック秒)。" - }, - "preview_url": { - "type": "string", - "nullable": true, - "description": "ファイルのプレビュー URL。" - }, - "source_url": { - "type": "string", - "description": "ファイルの署名付きダウンロード URL です。" - }, - "original_url": { - "type": "string", - "nullable": true, - "description": "ファイルの元の URL。" - }, - "user_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "未使用です。常に `null` になります。" - }, - "tenant_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "関連付けられたテナントの ID。" - }, - "conversation_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "関連付けられた会話の ID。" - }, - "file_key": { - "type": "string", - "nullable": true, - "description": "未使用です。常に `null` になります。" + "description": "作成タイムスタンプ(Unix エポック秒)。", + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "position" + ] }, "EndUserDetail": { "type": "object", @@ -13983,24 +12378,45 @@ "description": "テナント ID。" }, "app_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "アプリケーション ID。" + "description": "アプリケーション ID。", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "type": { "type": "string", "description": "エンドユーザーのタイプ。Service API ユーザーの場合は常に `service-api` です。" }, "external_user_id": { - "type": "string", - "nullable": true, - "description": "API リクエストで提供された `user` 識別子です(例:[チャットメッセージを送信](/ja/api-reference/chat-messages/send-chat-message) の `user` フィールド)。" + "description": "API リクエストで提供された `user` 識別子です(例:[チャットメッセージを送信](/ja/api-reference/chat-messages/send-chat-message) の `user` フィールド)。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "name": { - "type": "string", - "nullable": true, - "description": "エンドユーザー名。" + "description": "エンドユーザー名。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "is_anonymous": { "type": "boolean", @@ -14020,5651 +12436,11488 @@ "format": "date-time", "description": "最終更新タイムスタンプ。" } - } + }, + "required": [ + "created_at", + "id", + "is_anonymous", + "session_id", + "tenant_id", + "type", + "updated_at" + ] }, - "MessageFeedbackRequest": { + "AppInfoResponse": { "type": "object", - "description": "メッセージフィードバックを送信するためのリクエストボディ。", - "required": [ - "user" - ], "properties": { - "rating": { + "name": { "type": "string", - "enum": [ - "like", - "dislike", - null - ], - "nullable": true, - "description": "フィードバック評価。以前送信したフィードバックを取り消すには `null` に設定します。" + "description": "アプリケーション名。" }, - "user": { + "description": { "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。フィードバックはそのエンドユーザーにスコープされるため、メッセージを受け取った `user` と一致する必要があります。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" + "description": "アプリケーションの説明。" }, - "content": { + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "アプリケーションタグ。" + }, + "mode": { "type": "string", - "description": "追加の詳細を提供する任意のテキストフィードバック。" + "description": "アプリケーションモード。`completion` はテキスト生成アプリ、`chat` は基本チャットアプリ、`agent-chat` はエージェントベースのアプリ、`advanced-chat` は Chatflow アプリ、`workflow` は Workflow アプリです、`agent` は新しい Agent アプリです。" + }, + "author_name": { + "description": "アプリケーション作成者の名前。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } - } + }, + "required": [ + "author_name", + "description", + "mode", + "name", + "tags" + ] }, - "AppFeedbacksResponse": { + "AppMetaResponse": { "type": "object", "properties": { - "data": { - "type": "array", - "description": "フィードバック項目のリスト。", - "items": { - "$ref": "#/components/schemas/FeedbackItem" - } + "tool_icons": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "format": "url", + "type": "string" + }, + { + "$ref": "#/components/schemas/ToolIcon" + } + ] + }, + "description": "ツールアイコン。キーはツール名です。" } } }, - "FeedbackItem": { + "HumanInputContent": { "type": "object", - "description": "単一のフィードバック項目。", + "description": "人間の入力ノードからの実行コンテンツです。フォーム定義と送信データを含みます。", "properties": { - "id": { + "workflow_run_id": { "type": "string", - "format": "uuid", - "description": "フィードバック ID。" + "description": "このコンテンツが属するワークフロー実行の ID です。" }, - "app_id": { - "type": "string", - "format": "uuid", - "description": "アプリケーション ID。" - }, - "conversation_id": { - "type": "string", - "format": "uuid", - "description": "会話 ID。" - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "メッセージ ID。" - }, - "rating": { - "type": "string", - "description": "フィードバック評価。肯定的な場合は `like`、否定的な場合は `dislike`。" - }, - "content": { - "type": "string", - "nullable": true, - "description": "任意のテキストフィードバック。" - }, - "from_source": { - "type": "string", - "description": "フィードバックのソース。API 経由でエンドユーザーが送信したフィードバックの場合は `user`、コンソールから送信されたフィードバックの場合は `admin`。" - }, - "from_end_user_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "フィードバックを送信したエンドユーザー ID。`from_source` が `user` の場合に存在します。" + "submitted": { + "type": "boolean", + "description": "人間の入力フォームが送信されたかどうかです。" }, - "from_account_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "フィードバックを送信したアカウント ID。`from_source` が `admin` の場合に存在します。" + "type": { + "description": "`human_input` は人間の入力コンテンツを示します。", + "$ref": "#/components/schemas/ExecutionContentType", + "default": "human_input" }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "作成タイムスタンプ。" + "form_definition": { + "description": "人間の入力ノードからのフォーム定義です。コンテンツが送信レスポンスを表す場合は `null` です。", + "anyOf": [ + { + "$ref": "#/components/schemas/HumanInputFormDefinition" + }, + { + "type": "null" + } + ], + "default": null }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "最終更新タイムスタンプ。" + "form_submission_data": { + "description": "送信されたフォームデータです。フォームがまだ送信されていない場合は `null` です。", + "anyOf": [ + { + "$ref": "#/components/schemas/HumanInputFormSubmissionData" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "submitted", + "workflow_run_id" + ] }, - "SuggestedQuestionsResponse": { + "HumanInputFormDefinition": { "type": "object", + "description": "人間の入力ノードによってレンダリングされる人間の入力フォームの定義です。", "properties": { - "result": { + "form_id": { "type": "string", - "description": "結果ステータス。" - }, - "data": { - "type": "array", - "items": { - "type": "string" - }, - "description": "提案された質問のリストです。" - } - } - }, - "ConversationHistoryResponse": { - "type": "object", - "properties": { - "limit": { - "type": "integer", - "description": "1 ページあたりの件数です。" - }, - "has_more": { - "type": "boolean", - "description": "さらにメッセージがあるかどうかです。" + "description": "フォームの一意識別子です。" }, - "data": { - "type": "array", - "description": "メッセージのリストです。", - "items": { - "$ref": "#/components/schemas/ConversationMessageItem" - } - } - } - }, - "ConversationMessageItem": { - "type": "object", - "properties": { - "id": { + "node_id": { "type": "string", - "format": "uuid", - "description": "メッセージ ID。" + "description": "このフォームを生成した人間の入力ノードの ID です。" }, - "conversation_id": { + "node_title": { "type": "string", - "format": "uuid", - "description": "会話 ID。" + "description": "人間の入力ノードのタイトルです。" }, - "parent_message_id": { + "form_content": { "type": "string", - "format": "uuid", - "nullable": true, - "description": "スレッド会話の親メッセージ ID です。" + "description": "フォームと共に表示される Markdown またはテキストコンテンツです。" }, "inputs": { - "type": "object", - "additionalProperties": true, - "description": "このメッセージの入力変数です。" - }, - "query": { - "type": "string", - "description": "ユーザークエリテキストです。" - }, - "answer": { - "type": "string", - "description": "アシスタントの回答テキストです。" - }, - "status": { - "type": "string", - "description": "メッセージステータスです。成功したメッセージの場合は `normal`、生成に失敗した場合は `error` です。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "`status` が `error` の場合のエラーメッセージです。" - }, - "message_files": { - "type": "array", - "description": "このメッセージに添付されたファイルです。", - "items": { - "$ref": "#/components/schemas/MessageFileItem" - } - }, - "feedback": { - "type": "object", - "nullable": true, - "description": "このメッセージのユーザーフィードバックです。", - "properties": { - "rating": { - "type": "string", - "description": "フィードバック評価。肯定的な場合は `like`、否定的な場合は `dislike`。" - } - } - }, - "retriever_resources": { "type": "array", - "description": "このメッセージに使用された検索リソースです。", + "description": "フォーム内の入力フィールドです。", "items": { - "$ref": "#/components/schemas/RetrieverResource" + "$ref": "#/components/schemas/FormInputConfig" } }, - "agent_thoughts": { + "actions": { "type": "array", - "description": "このメッセージのエージェント思考です。", + "description": "フォームで利用可能なアクションボタンです。", "items": { - "$ref": "#/components/schemas/AgentThoughtItem" + "$ref": "#/components/schemas/UserActionConfig" } }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "作成タイムスタンプ(Unix エポック秒)。" - }, - "extra_contents": { - "type": "array", - "description": "このメッセージに関連する追加の実行コンテンツです。chatflow ワークフローの人間の入力ノードからのフォームデータなどが含まれます。", - "items": { - "$ref": "#/components/schemas/HumanInputContent" - } + "display_in_ui": { + "type": "boolean", + "description": "フォームを UI に表示するかどうかです。", + "default": false }, - "message_tokens": { - "type": "integer", - "description": "入力メッセージのトークン数です。" + "form_token": { + "description": "フォーム送信認証用のトークンです。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "answer_tokens": { - "type": "integer", - "description": "生成された回答のトークン数です。" + "resolved_default_values": { + "type": "object", + "additionalProperties": true, + "description": "出力変数名をキーとする、フォーム入力の解決済みデフォルト値です。" }, - "total_tokens": { + "expiration_time": { "type": "integer", - "description": "使用されたトークンの合計。`message_tokens` と `answer_tokens` の合計です。" - }, - "provider_response_latency": { - "type": "number", - "format": "double", - "description": "モデルプロバイダーの応答レイテンシ(秒)です。" - }, - "total_price": { - "type": "string", - "format": "decimal", - "nullable": true, - "description": "使用されたトークンの合計金額です。価格情報が利用できない場合は `null` です。" - }, - "currency": { - "type": "string", - "nullable": true, - "description": "`total_price` の通貨(例:`USD`)です。価格情報が利用できない場合は `null` です。" + "description": "フォームが期限切れになる Unix タイムスタンプです。" } - } + }, + "required": [ + "expiration_time", + "form_content", + "form_id", + "node_id", + "node_title" + ] }, - "MessageFileItem": { + "HumanInputFormSubmissionData": { "type": "object", - "description": "メッセージに添付されたファイルです。", + "description": "送信された人間の入力フォームからのデータです。", "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "File ID." - }, - "filename": { + "node_id": { "type": "string", - "description": "元のファイル名です。" + "description": "人間の入力ノードの ID です。" }, - "type": { + "node_title": { "type": "string", - "description": "ファイルの種類(例: `image`)です。" + "description": "人間の入力ノードのタイトルです。" }, - "url": { + "rendered_content": { "type": "string", - "format": "url", - "nullable": true, - "description": "ファイルのプレビュー URL。" + "description": "フォーム送信のレンダリングされた内容です。" }, - "mime_type": { + "action_id": { "type": "string", - "nullable": true, - "description": "ファイルの MIME タイプ。" - }, - "size": { - "type": "integer", - "nullable": true, - "description": "ファイルサイズ(バイト)。" + "description": "クリックされたアクションボタンの ID です。" }, - "transfer_method": { + "action_text": { "type": "string", - "description": "使用された転送方法です。`remote_url` は URL ベースのファイル、`local_file` はアップロード済みファイル、`tool_file` はツール生成ファイルを示します。" + "description": "クリックされたアクションボタンの表示テキストです。" }, - "belongs_to": { - "type": "string", - "nullable": true, - "description": "このファイルの所有者です。ユーザーがアップロードしたファイルの場合は `user`、アシスタントが生成したファイルの場合は `assistant` です。" + "submitted_data": { + "anyOf": [ + { + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "action_id", + "action_text", + "node_id", + "node_title", + "rendered_content" + ] + }, + "WorkflowBlockingResponse": { + "anyOf": [ + { + "$ref": "#/components/schemas/WorkflowFinishedBlockingResponse" }, - "upload_file_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "`local_file` で転送された場合のアップロードファイル ID です。" + { + "$ref": "#/components/schemas/WorkflowPausedBlockingResponse" } - } + ] }, - "AgentThoughtItem": { + "RetrievalModel": { "type": "object", - "description": "メッセージ内のエージェント思考ステップです。", + "required": [ + "reranking_enable", + "score_threshold_enabled", + "search_method", + "top_k" + ], "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "エージェント思考 ID です。" + "search_method": { + "description": "検索に使用される検索メソッドです。", + "$ref": "#/components/schemas/RetrievalMethod" }, - "chain_id": { - "type": "string", - "nullable": true, - "description": "この思考のチェーン ID です。" + "reranking_enable": { + "type": "boolean", + "description": "リランキングが有効かどうかです。" }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "この思考が属する一意のメッセージ ID です。" + "reranking_model": { + "description": "リランキングモデルの設定です。", + "anyOf": [ + { + "$ref": "#/components/schemas/RerankingModel" + }, + { + "type": "null" + } + ], + "default": null }, - "position": { - "type": "integer", - "description": "この思考の位置です。" + "reranking_mode": { + "description": "リランキングモードです。`reranking_enable` が `true` の場合は必須です。", + "anyOf": [ + { + "enum": [ + "reranking_model", + "weighted_score" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "thought": { - "type": "string", - "description": "LLM が思考している内容です。" - }, - "tool": { - "type": "string", - "description": "呼び出されたツール(`;` で区切り)です。" - }, - "tool_labels": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "使用されたツールのラベルです。" + "top_k": { + "type": "integer", + "description": "返す結果の最大数です。" }, - "tool_input": { - "type": "string", - "description": "ツールの入力(JSON 形式)です。" + "score_threshold_enabled": { + "type": "boolean", + "description": "スコア閾値フィルタリングが有効かどうかです。" }, - "observation": { - "type": "string", - "description": "ツール呼び出しからのレスポンスです。" + "score_threshold": { + "description": "結果の最小関連性スコアです。`score_threshold_enabled` が `true` の場合にのみ有効です。", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null }, - "files": { - "type": "array", - "items": { - "type": "string" - }, - "description": "この思考に関連するファイル ID です。" + "weights": { + "description": "ハイブリッド検索の重み設定です。", + "anyOf": [ + { + "$ref": "#/components/schemas/WeightModel" + }, + { + "type": "null" + } + ], + "default": null }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "作成タイムスタンプ。" + "metadata_filtering_conditions": { + "description": "ドキュメントのメタデータが指定した条件に一致するチャンクのみを取得対象に絞り込みます。条件はサーバーサイドで評価されます。", + "anyOf": [ + { + "$ref": "#/components/schemas/MetadataFilteringCondition" + }, + { + "type": "null" + } + ], + "default": null } } }, - "ConversationsListResponse": { - "type": "object", + "AgentThought": { "properties": { - "limit": { - "type": "integer", - "description": "1 ページあたりの件数です。" + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "has_more": { - "type": "boolean", - "description": "さらに会話があるかどうかです。" + "chain_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "data": { - "type": "array", - "description": "会話のリストです。", + "created_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "files": { "items": { - "$ref": "#/components/schemas/ConversationListItem" - } - } - } - }, - "ConversationListItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "会話 ID。" + "type": "string" + }, + "type": "array" }, - "name": { - "type": "string", - "description": "会話名です。" + "id": { + "type": "string" }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "会話の入力変数です。" + "message_id": { + "type": "string" }, - "status": { - "type": "string", - "description": "会話ステータスです。アクティブな会話の場合は `normal` です。" + "observation": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "introduction": { - "type": "string", - "description": "会話の紹介文です。" + "position": { + "type": "integer" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "作成タイムスタンプ。" + "thought": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "updated_at": { - "type": "integer", - "format": "int64", - "description": "最終更新タイムスタンプ。" - } - } - }, - "ConversationRenameRequest": { - "type": "object", - "description": "会話の名前変更用リクエストボディです。", - "properties": { - "name": { - "type": "string", - "description": "新しい会話名です。`auto_generate` が `true` でない限り必須です。" + "tool": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "auto_generate": { - "type": "boolean", - "default": false, - "description": "会話名を自動生成します。`true` の場合、`name` フィールドは無視されます。" + "tool_input": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" + "tool_labels": { + "$ref": "#/components/schemas/JSONValue" } - } + }, + "required": [ + "files", + "id", + "message_id", + "position", + "tool_labels" + ], + "type": "object" }, - "ConversationVariablesResponse": { - "type": "object", + "Annotation": { "properties": { - "limit": { - "type": "integer", - "description": "1 ページあたりの件数です。" + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "has_more": { - "type": "boolean", - "description": "次のページがあるかどうかです。" + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "hit_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "data": { - "type": "array", - "description": "会話変数のリストです。", - "items": { - "$ref": "#/components/schemas/ConversationVariableItem" - } - } - } - }, - "ConversationVariableItem": { - "type": "object", - "properties": { "id": { - "type": "string", "format": "uuid", - "description": "Variable ID." - }, - "name": { - "type": "string", - "description": "変数名です。" - }, - "value_type": { - "type": "string", - "description": "変数の値の型です。指定可能な値:`string`、`number`、`object`、`secret`、`file`、`boolean`、`array[any]`、`array[string]`、`array[number]`、`array[object]`、`array[file]`、`array[boolean]`。" - }, - "value": { - "type": "string", - "description": "変数値(複雑な型の場合は JSON 文字列)。" - }, - "description": { - "type": "string", - "description": "変数の説明です。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "作成タイムスタンプ。" + "type": "string" }, - "updated_at": { - "type": "integer", - "format": "int64", - "description": "最終更新タイムスタンプ。" + "question": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } - } - }, - "ConversationVariableUpdateRequest": { - "type": "object", - "description": "会話変数を更新するためのリクエストボディです。", + }, "required": [ - "value" + "id" ], + "type": "object" + }, + "AnnotationCreatePayload": { "properties": { - "value": { - "description": "変数の新しい値。変数の期待される型と一致する必要があります。" + "answer": { + "type": "string" }, - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" + "question": { + "type": "string" } - } - }, - "AudioToTextRequest": { - "type": "object", - "description": "音声からテキストへの変換のリクエストボディ。", + }, "required": [ - "file" + "answer", + "question" ], + "type": "object" + }, + "AnnotationJobStatusDetailResponse": { "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "文字起こしする音声ファイルです。受け付ける MIME タイプは `audio/mp3`、`audio/m4a`(`audio/x-m4a` も受け付けます)、`audio/wav`、`audio/amr`、`audio/mpga` です。それ以外のタイプ(一般的な `audio/mpeg` を含む)は `unsupported_audio_type` で拒否されます。最大サイズは `30 MB` です。" + "error_msg": { + "default": "", + "type": "string" }, - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" + "job_id": { + "format": "uuid", + "type": "string" + }, + "job_status": { + "type": "string" } - } + }, + "required": [ + "job_id", + "job_status" + ], + "type": "object" }, - "AudioToTextResponse": { - "type": "object", + "AnnotationJobStatusResponse": { "properties": { - "text": { - "type": "string", - "description": "音声認識からの出力テキスト。" + "job_id": { + "format": "uuid", + "type": "string" + }, + "job_status": { + "type": "string" } - } + }, + "required": [ + "job_id", + "job_status" + ], + "type": "object" }, - "TextToAudioRequest": { - "type": "object", - "description": "テキストから音声への変換のリクエストボディ。`message_id` または `text` のいずれかを指定してください。", + "AnnotationList": { "properties": { - "message_id": { - "type": "string", - "format": "uuid", - "description": "回答を音声化するメッセージの ID です。両方が指定された場合、`text` よりも優先されます。メッセージ ID は [会話履歴メッセージ一覧を取得](/ja/api-reference/conversations/list-conversation-messages) から取得します。" + "data": { + "items": { + "$ref": "#/components/schemas/Annotation" + }, + "type": "array" }, - "text": { - "type": "string", - "description": "音声に合成するテキストです。" + "has_more": { + "type": "boolean" }, - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" + "limit": { + "type": "integer" }, - "voice": { - "type": "string", - "description": "テキスト読み上げに使用する音声。利用可能な音声は、このアプリに設定された TTS プロバイダーによって異なります。デフォルトには[アプリケーションのパラメータ情報を取得](/ja/api-reference/applications/get-app-parameters) → `text_to_speech.voice` の `voice` 値を使用してください。" + "page": { + "type": "integer" }, - "streaming": { - "type": "boolean", - "description": "後方互換性のために受け付けられますが、効果はありません。音声がストリーミングされるかどうかは、設定された TTS プロバイダーの出力によって決まり、このフィールドでは制御されません。" + "total": { + "type": "integer" } - } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "type": "object" }, - "AppInfoResponse": { - "type": "object", + "AnnotationListQuery": { "properties": { - "name": { - "type": "string", - "description": "アプリケーション名。" - }, - "description": { - "type": "string", - "description": "アプリケーションの説明。" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "アプリケーションタグ。" + "keyword": { + "default": "", + "description": "質問または回答の内容でアノテーションをフィルタリングするためのキーワードです。", + "type": "string" }, - "mode": { - "type": "string", - "description": "アプリケーションモード。`completion` はテキスト生成アプリ、`chat` は基本チャットアプリ、`agent-chat` はエージェントベースのアプリ、`advanced-chat` は Chatflow アプリ、`workflow` は Workflow アプリです、`agent` は新しい Agent アプリです。" + "limit": { + "default": 20, + "description": "1 ページあたりの件数です。", + "minimum": 1, + "type": "integer" }, - "author_name": { - "type": "string", - "description": "アプリケーション作成者の名前。" + "page": { + "default": 1, + "minimum": 1, + "type": "integer" } - } + }, + "type": "object" }, - "UserInputFormItem": { - "type": "object", - "oneOf": [ - { - "$ref": "#/components/schemas/TextInputControlWrapper" + "AnnotationReplyActionPayload": { + "properties": { + "embedding_model_name": { + "type": "string" }, - { - "$ref": "#/components/schemas/ParagraphControlWrapper" + "embedding_provider_name": { + "type": "string" }, - { - "$ref": "#/components/schemas/SelectControlWrapper" - } - ] - }, - "TextInputControlWrapper": { - "title": "Text Input", - "type": "object", - "properties": { - "text-input": { - "$ref": "#/components/schemas/TextInputControl" - } - } - }, - "ParagraphControlWrapper": { - "title": "Paragraph", - "type": "object", - "properties": { - "paragraph": { - "$ref": "#/components/schemas/ParagraphControl" + "score_threshold": { + "description": "アノテーションがマッチとみなされるための最低類似度スコアです。値が高いほど、より正確なマッチが必要になります。", + "format": "float", + "type": "number" } - } + }, + "required": [ + "embedding_model_name", + "embedding_provider_name", + "score_threshold" + ], + "type": "object" }, - "SelectControlWrapper": { - "title": "Select", - "type": "object", + "AppFeedbackListResponse": { "properties": { - "select": { - "$ref": "#/components/schemas/SelectControl" + "data": { + "items": { + "$ref": "#/components/schemas/AppFeedbackResponse" + }, + "type": "array" } - } + }, + "required": [ + "data" + ], + "type": "object" }, - "TextInputControl": { - "type": "object", + "AppFeedbackResponse": { "properties": { - "label": { - "type": "string", - "description": "フォームフィールドの表示ラベル。" + "app_id": { + "format": "uuid", + "type": "string" }, - "variable": { - "type": "string", - "description": "`inputs` オブジェクトのキーとして使用される変数名。" + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "required": { - "type": "boolean", - "description": "送信前にこのフィールドを入力する必要があるかどうか。" + "conversation_id": { + "format": "uuid", + "type": "string" }, - "default": { - "type": "string", - "description": "フォームフィールドに事前入力されるデフォルト値。" - } - } - }, - "ParagraphControl": { - "type": "object", - "properties": { - "label": { - "type": "string", - "description": "フォームフィールドの表示ラベル。" + "created_at": { + "type": "string" }, - "variable": { - "type": "string", - "description": "`inputs` オブジェクトのキーとして使用される変数名。" + "from_account_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "required": { - "type": "boolean", - "description": "送信前にこのフィールドを入力する必要があるかどうか。" + "from_end_user_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "default": { - "type": "string", - "description": "フォームフィールドに事前入力されるデフォルト値。" - } - } - }, - "SelectControl": { - "type": "object", - "properties": { - "label": { - "type": "string", - "description": "フォームフィールドの表示ラベル。" + "from_source": { + "type": "string" }, - "variable": { - "type": "string", - "description": "`inputs` オブジェクトのキーとして使用される変数名。" + "id": { + "format": "uuid", + "type": "string" }, - "required": { - "type": "boolean", - "description": "送信前に選択を行う必要があるかどうか。" + "message_id": { + "format": "uuid", + "type": "string" }, - "default": { - "type": "string", - "description": "デフォルトで選択される値。" + "rating": { + "type": "string" }, - "options": { - "type": "array", - "items": { - "type": "string" - }, - "description": "このフォームコントロールの選択可能な値のリスト。" + "updated_at": { + "type": "string" } - } + }, + "required": [ + "app_id", + "conversation_id", + "created_at", + "from_source", + "id", + "message_id", + "rating", + "updated_at" + ], + "type": "object" }, - "AppMetaResponse": { - "type": "object", + "AudioBinaryResponse": { + "format": "binary", + "type": "string" + }, + "AudioTranscriptResponse": { "properties": { - "tool_icons": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "title": "Icon URL", - "type": "string", - "format": "url", - "description": "アイコンの URL。" - }, - { - "$ref": "#/components/schemas/ToolIconDetail" - } - ] - }, - "description": "ツールアイコン。キーはツール名です。" + "text": { + "type": "string" } - } + }, + "required": [ + "text" + ], + "type": "object" }, - "ToolIconDetail": { - "title": "Emoji Icon", - "type": "object", - "description": "絵文字を使用したツールアイコンの詳細。", + "BinaryFileResponse": { + "format": "binary", + "type": "string" + }, + "BlockingMetadataResponse": { + "additionalProperties": true, "properties": { - "background": { - "type": "string", - "description": "16進数形式の背景色。" + "retriever_resources": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/BlockingRetrieverResourceResponse" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null }, - "content": { - "type": "string", - "description": "Emoji コンテンツ。" + "usage": { + "anyOf": [ + { + "$ref": "#/components/schemas/BlockingUsageResponse" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "type": "object" }, - "WebAppSettingsResponse": { - "type": "object", + "BlockingRetrieverResourceResponse": { + "additionalProperties": true, "properties": { - "title": { - "type": "string", - "description": "Web アプリタイトル。" + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "chat_color_theme": { - "type": "string", - "description": "チャットカラーテーマ。" + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "chat_color_theme_inverted": { - "type": "boolean", - "description": "チャットカラーテーマが反転しているかどうか。" + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "icon_type": { - "type": "string", - "description": "使用されるアイコンのタイプ。`emoji` は絵文字アイコン、`image` はアップロードされた画像アイコンです。" + "dataset_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "icon": { - "type": "string", - "description": "アイコンのコンテンツ(絵文字または画像 ID)。" + "dataset_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "icon_background": { - "type": "string", - "description": "アイコンの背景色。" + "document_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "icon_url": { - "type": "string", - "format": "url", - "nullable": true, - "description": "アイコン画像の URL。" + "document_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "description": { - "type": "string", - "description": "Web アプリの説明。" + "hit_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "copyright": { - "type": "string", - "description": "著作権テキスト。" + "id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "privacy_policy": { - "type": "string", - "description": "プライバシーポリシー URL。" + "index_node_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "input_placeholder": { - "type": "string", - "nullable": true, - "description": "Web アプリのメッセージ入力ボックスに表示されるプレースホルダーテキストです。設定されていない場合は `null` です。" + "message_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "custom_disclaimer": { - "type": "string", - "description": "カスタム免責事項テキスト。" + "position": { + "type": "integer" }, - "default_language": { - "type": "string", - "description": "デフォルト言語コード。" + "score": { + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "null" + } + ], + "default": null }, - "show_workflow_steps": { - "type": "boolean", - "description": "ワークフローステップを表示するかどうか。" + "segment_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "use_icon_as_answer_icon": { - "type": "boolean", - "description": "アプリアイコンを回答アイコンとして使用するかどうか。" + "segment_position": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "word_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "position" + ], + "type": "object" }, - "AnnotationListResponse": { - "type": "object", + "BlockingUsageResponse": { + "additionalProperties": true, "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AnnotationItem" - }, - "description": "現在のページのアノテーション項目のリストです。" + "completion_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "has_more": { - "type": "boolean", - "description": "現在の結果セットの後にさらにページがある場合は `true` です。" + "completion_price_unit": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "limit": { - "type": "integer", - "description": "1 ページあたりの件数です。" + "completion_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "total": { - "type": "integer", - "description": "クエリに一致するアノテーションの合計数です。" + "completion_unit_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "page": { - "type": "integer", - "description": "現在のページ番号です。" - } - } - }, - "AnnotationItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "アノテーションの一意識別子です。" + "currency": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "question": { - "type": "string", - "nullable": true, - "description": "このアノテーションをトリガーする質問テキストです。" + "latency": { + "anyOf": [ + { + "format": "double", + "type": "number" + }, + { + "type": "null" + } + ], + "default": null }, - "answer": { - "type": "string", - "nullable": true, - "description": "アノテーションがマッチした際に返される定義済みの回答です。" + "prompt_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "hit_count": { - "type": "integer", - "nullable": true, - "description": "このアノテーションがマッチして返信として返された回数です。" + "prompt_price_unit": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "created_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "作成タイムスタンプ(Unix エポック秒)。" - } - } - }, - "CreateAnnotationRequest": { - "type": "object", - "description": "新しいアノテーションを作成するためのリクエストボディです。", - "required": [ - "question", - "answer" - ], - "properties": { - "question": { - "type": "string", - "description": "アプリが受信したユーザー入力を照合する質問テキストです。" + "prompt_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "answer": { - "type": "string", - "description": "このアノテーションが一致したときに返される回答です。" - } - } - }, - "UpdateAnnotationRequest": { - "type": "object", - "description": "アノテーション更新のリクエストボディです。", - "required": [ - "question", - "answer" - ], - "properties": { - "question": { - "type": "string", - "description": "アノテーションの新しい質問テキストです。" + "prompt_unit_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "answer": { - "type": "string", - "description": "アノテーションの新しい回答テキストです。" + "total_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "type": "object" }, - "InitialAnnotationReplySettingsRequest": { - "type": "object", - "description": "アノテーション返信設定を構成するためのリクエストボディです。", - "required": [ - "score_threshold", - "embedding_provider_name", - "embedding_model_name" + "ButtonStyle": { + "enum": [ + "accent", + "default", + "ghost", + "primary" ], - "properties": { - "embedding_provider_name": { - "type": "string", - "description": "埋め込みモデルプロバイダーです(例:`openai`)。利用可能なプロバイダーは [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) から取得します。" + "type": "string" + }, + "ChatBlockingResponse": { + "discriminator": { + "mapping": { + "message": "#/components/schemas/ChatMessageBlockingResponse", + "workflow_paused": "#/components/schemas/ChatPausedBlockingResponse" }, - "embedding_model_name": { - "type": "string", - "description": "マッチングのためにアノテーションをベクトル化する埋め込みモデルです(例:`text-embedding-3-small`)。" + "propertyName": "event" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ChatMessageBlockingResponse" }, - "score_threshold": { - "type": "number", - "format": "float", - "description": "アノテーションがマッチとみなされるための最低類似度スコアです。値が高いほど、より正確なマッチが必要になります。" + { + "$ref": "#/components/schemas/ChatPausedBlockingResponse" } - } + ] }, - "InitialAnnotationReplySettingsResponse": { - "type": "object", + "ChatMessageBlockingResponse": { + "additionalProperties": true, "properties": { - "job_id": { - "type": "string", + "answer": { + "type": "string" + }, + "conversation_id": { "format": "uuid", - "description": "非同期ジョブ ID です。[アノテーション返信の初期設定タスクステータスを取得](/ja/api-reference/annotations/get-annotation-reply-job-status) と組み合わせて進捗を追跡します。" + "type": "string" }, - "job_status": { - "type": "string", - "description": "現在のジョブステータスです。このエンドポイントが返すのは `waiting`(キュー待ち)または `processing`(処理中)のみです。`completed` と `error` は [アノテーション返信の初期設定タスクステータスを取得](/ja/api-reference/annotations/get-annotation-reply-job-status) からのみ返されます。" - } - } - }, - "InitialAnnotationReplySettingsStatusResponse": { - "type": "object", - "properties": { - "job_id": { - "type": "string", + "created_at": { + "format": "int64", + "type": "integer" + }, + "event": { + "const": "message", + "type": "string" + }, + "id": { "format": "uuid", - "description": "[アノテーション返信を設定](/ja/api-reference/annotations/configure-annotation-reply) 呼び出しから取得したジョブ ID です。" + "type": "string" }, - "job_status": { - "type": "string", - "description": "現在のジョブステータスです。`waiting` はキュー待ち、`processing` は処理中、`completed` は完了、`error` は失敗を示します。" + "message_id": { + "format": "uuid", + "type": "string" }, - "error_msg": { - "type": "string", - "description": "ジョブが失敗した理由を説明するエラーメッセージです。`job_status` が `error` でない場合は空文字列です。" + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "type": "string" + }, + "task_id": { + "format": "uuid", + "type": "string" } - } + }, + "required": [ + "answer", + "conversation_id", + "created_at", + "event", + "id", + "message_id", + "metadata", + "mode", + "task_id" + ], + "type": "object" }, - "AppParametersResponse": { - "type": "object", + "ChatPauseReasonResponse": { + "additionalProperties": true, "properties": { - "opening_statement": { - "type": "string", - "nullable": true, - "description": "オープニングステートメントのテキストです。" + "TYPE": { + "type": "string" }, - "suggested_questions": { - "type": "array", + "actions": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "type": "array" + }, + "approval_channels": { "items": { "type": "string" }, - "description": "提案された質問のリストです。" + "type": "array" }, - "suggested_questions_after_answer": { - "type": "object", - "description": "回答後の提案質問の設定です。", - "properties": { - "enabled": { - "type": "boolean", - "description": "この機能が有効かどうか。" + "display_in_ui": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" } - } + ], + "default": null }, - "speech_to_text": { - "type": "object", - "description": "音声テキスト変換機能の設定です。", - "properties": { - "enabled": { - "type": "boolean", - "description": "この機能が有効かどうか。" + "expiration_time": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" } - } + ], + "default": null }, - "text_to_speech": { - "type": "object", - "description": "テキスト音声変換機能の設定です。", - "properties": { - "enabled": { - "type": "boolean", - "description": "この機能が有効かどうか。" - }, - "voice": { - "type": "string", - "description": "TTS 音声識別子。" - }, - "language": { - "type": "string", - "description": "TTS 言語。" + "form_content": { + "anyOf": [ + { + "type": "string" }, - "autoPlay": { - "type": "string", - "description": "自動再生設定です。音声を自動再生するには `enabled`、手動再生を要求するには `disabled` を指定します。" + { + "type": "null" } - } + ], + "default": null }, - "retriever_resource": { - "type": "object", - "description": "ナレッジ検索の引用リソース設定です。", - "properties": { - "enabled": { - "type": "boolean", - "description": "この機能が有効かどうか。" + "form_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "annotation_reply": { - "type": "object", - "description": "アノテーション返信機能の設定です。", - "properties": { - "enabled": { - "type": "boolean", - "description": "この機能が有効かどうか。" + "form_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "more_like_this": { - "type": "object", - "description": "類似コンテンツ機能の設定です。", - "properties": { - "enabled": { - "type": "boolean", - "description": "この機能が有効かどうか。" + "inputs": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "type": "array" + }, + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "sensitive_word_avoidance": { - "type": "object", - "description": "コンテンツモデレーション機能の設定です。", - "properties": { - "enabled": { - "type": "boolean", - "description": "この機能が有効かどうか。" + "node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "user_input_form": { - "type": "array", + "node_title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "resolved_default_values": { + "additionalProperties": true, + "type": "object" + } + }, + "required": [ + "TYPE" + ], + "type": "object" + }, + "ChatPausedBlockingDataResponse": { + "additionalProperties": true, + "properties": { + "answer": { + "type": "string" + }, + "conversation_id": { + "format": "uuid", + "type": "string" + }, + "created_at": { + "format": "int64", + "type": "integer" + }, + "elapsed_time": { + "format": "float", + "type": "number" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "message_id": { + "format": "uuid", + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "type": "string" + }, + "paused_nodes": { "items": { - "type": "object", - "oneOf": [ - { - "title": "Text Input", - "type": "object", - "properties": { - "text-input": { - "type": "object", + "type": "string" + }, + "type": "array" + }, + "reasons": { + "items": { + "$ref": "#/components/schemas/ChatPauseReasonResponse" + }, + "type": "array" + }, + "status": { + "const": "paused", + "type": "string" + }, + "total_steps": { + "type": "integer" + }, + "total_tokens": { + "type": "integer" + }, + "workflow_run_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "answer", + "conversation_id", + "created_at", + "elapsed_time", + "id", + "message_id", + "metadata", + "mode", + "paused_nodes", + "reasons", + "status", + "total_steps", + "total_tokens", + "workflow_run_id" + ], + "type": "object" + }, + "ChatPausedBlockingResponse": { + "additionalProperties": true, + "properties": { + "answer": { + "type": "string" + }, + "conversation_id": { + "format": "uuid", + "type": "string" + }, + "created_at": { + "format": "int64", + "type": "integer" + }, + "data": { + "$ref": "#/components/schemas/ChatPausedBlockingDataResponse" + }, + "event": { + "const": "workflow_paused", + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "message_id": { + "format": "uuid", + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "type": "string" + }, + "task_id": { + "format": "uuid", + "type": "string" + }, + "workflow_run_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "answer", + "conversation_id", + "created_at", + "data", + "event", + "id", + "message_id", + "metadata", + "mode", + "task_id", + "workflow_run_id" + ], + "type": "object" + }, + "ChatRequestPayload": { + "properties": { + "auto_generate_name": { + "default": true, + "type": "boolean" + }, + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { "properties": { - "label": { - "type": "string", - "description": "入力フィールドの表示ラベルです。" + "remote_url": { + "format": "url", + "type": "string" }, - "variable": { - "type": "string", - "description": "ワークフローで使用される変数名です。" + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" }, - "required": { - "type": "boolean", - "description": "このフィールドが必須かどうかです。" + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "default": { - "type": "string", - "description": "入力フィールドのデフォルト値です。" + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" } - } - } - } - }, - { - "title": "Paragraph", - "type": "object", - "properties": { - "paragraph": { - "type": "object", + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { "properties": { - "label": { - "type": "string", - "description": "段落フィールドの表示ラベルです。" + "remote_url": { + "format": "url", + "type": "string" }, - "variable": { - "type": "string", - "description": "ワークフローで使用される変数名です。" + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" }, - "required": { - "type": "boolean", - "description": "このフィールドが必須かどうかです。" + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "default": { - "type": "string", - "description": "段落フィールドのデフォルト値です。" + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" } - } - } - } - }, - { - "title": "Select", - "type": "object", - "properties": { - "select": { - "type": "object", + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { "properties": { - "label": { - "type": "string", - "description": "セレクトフィールドの表示ラベルです。" + "remote_url": { + "format": "url", + "type": "string" }, - "variable": { - "type": "string", - "description": "ワークフローで使用される変数名です。" + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" }, - "required": { - "type": "boolean", - "description": "このフィールドが必須かどうかです。" + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "default": { - "type": "string", - "description": "デフォルトで選択される値。" + "upload_file_id": { + "type": "string" }, - "options": { - "type": "array", - "items": { - "type": "string" - }, - "description": "このフォームコントロールの選択可能な値のリスト。" + "url": { + "format": "url", + "type": "string" } - } - } - } - } - ] - }, - "description": "ユーザー入力フォームの設定です。" - }, - "file_upload": { - "type": "object", - "description": "ファイルアップロードの設定。", - "properties": { - "image": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "画像アップロードが有効かどうか。" - }, - "number_limits": { - "type": "integer", - "description": "アップロード可能な画像の最大数です。" - }, - "detail": { - "type": "string", - "description": "ビジョンモデルの画像詳細レベルです。" - }, - "transfer_methods": { - "type": "array", - "items": { - "type": "string" + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" }, - "description": "画像アップロードで許可される転送方法です。`remote_url` はファイル URL 経由、`local_file` はアップロード済みファイルを示します。" - } - } + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" } - } + ], + "default": null }, - "system_parameters": { - "type": "object", - "description": "システムレベルのパラメータ制限です。", - "properties": { - "file_size_limit": { - "type": "integer", - "description": "一般ファイルの最大サイズ(MB)です。" - }, - "image_file_size_limit": { - "type": "integer", - "description": "最大画像ファイルサイズ(MB)。" - }, - "audio_file_size_limit": { - "type": "integer", - "description": "最大音声ファイルサイズ(MB)。" + "inputs": { + "additionalProperties": true, + "type": "object" + }, + "query": { + "type": "string" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "video_file_size_limit": { - "type": "integer", - "description": "最大動画ファイルサイズ(MB)。" + { + "type": "null" + } + ], + "default": null + }, + "workflow_id": { + "anyOf": [ + { + "type": "string" }, - "workflow_file_upload_limit": { - "type": "integer", - "description": "ワークフロー実行ごとの最大ファイル数です。" + { + "type": "null" } - } + ], + "default": null } - } + }, + "required": [ + "inputs", + "query" + ], + "type": "object" }, - "StreamEventWorkflowStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChatRequestPayloadWithUser": { + "properties": { + "auto_generate_name": { + "default": true, + "type": "boolean" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "description": "ワークフローの実行が開始されました。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ワークフロー実行 ID です。" - }, - "workflow_id": { - "type": "string", - "description": "関連するワークフロー ID です。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "このワークフロー実行の入力変数です。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "開始タイムスタンプ(Unix エポック秒)です。" - }, - "reason": { - "type": "string", - "description": "ワークフロー開始の理由です。`initial` は初回開始、`resumption` は一時停止後の再開(例:人間の入力後)を示します。" - } - } + { + "type": "null" } - } - } - ] - }, - "StreamEventWorkflowFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/StreamEventBase" + "inputs": { + "additionalProperties": true, + "type": "object" }, - { - "type": "object", - "description": "ワークフローの実行が完了しました。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" + "query": { + "type": "string" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ワークフロー実行 ID です。" - }, - "workflow_id": { - "type": "string", - "description": "関連するワークフロー ID です。" - }, - "status": { - "type": "string", - "description": "実行ステータスです。`running` は進行中、`succeeded` は成功、`failed` は失敗、`stopped` は手動停止、`partial-succeeded` は部分完了、`paused` は人間の入力待ちを示します。" - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "ワークフローの出力データです。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "実行が失敗した場合のエラーメッセージです。" - }, - "elapsed_time": { - "type": "number", - "description": "合計実行時間(秒)です。" - }, - "total_tokens": { - "type": "integer", - "description": "消費された合計トークン数です。" - }, - "total_steps": { - "type": "integer", - "description": "実行された合計ステップ数です。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "開始タイムスタンプ(Unix エポック秒)です。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "終了タイムスタンプ(Unix エポック秒)です。" - }, - "exceptions_count": { - "type": "integer", - "nullable": true, - "description": "実行中の例外数です。" - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "ワークフロー実行中に生成されたファイルです。" - } - } + { + "type": "null" } - } - } - ] - }, - "StreamEventNodeStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/StreamEventBase" + "user": { + "type": "string" }, - { - "type": "object", - "description": "ノードの実行が開始されました。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" + "workflow_id": { + "anyOf": [ + { + "type": "string" }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ノード実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "ワークフローグラフ内のノード ID です。" - }, - "node_type": { - "type": "string", - "description": "ノードタイプ(例:`llm`、`knowledge-retrieval`、`code`)です。" - }, - "title": { - "type": "string", - "description": "Node title." - }, - "index": { - "type": "integer", - "description": "実行インデックスです。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "先行ノードの ID です。" - }, - "inputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "ノードの入力データです。簡略化された API レスポンスでは `null` の場合があります。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "開始タイムスタンプ(Unix エポック秒)です。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "追加メタデータです。" - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "このノードがイテレーション内で実行される場合のイテレーション ID です。" - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "このノードがループ内で実行される場合のループ ID です。" - } - } + { + "type": "null" } - } + ], + "default": null } - ] + }, + "required": [ + "inputs", + "query", + "user" + ], + "type": "object" }, - "StreamEventNodeFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChildChunkCreatePayload": { + "properties": { + "content": { + "description": "子チャンクのテキスト内容です。", + "type": "string" + } + }, + "required": [ + "content" + ], + "type": "object" + }, + "ChildChunkDetailResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/ChildChunkResponse" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "ChildChunkListQuery": { + "properties": { + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "検索キーワードです。" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "limit": { + "default": 20, + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。", + "minimum": 1, + "type": "integer" }, - { - "type": "object", - "description": "ノードの実行が完了しました。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ノード実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "ワークフローグラフ内のノード ID です。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Node title." - }, - "index": { - "type": "integer", - "description": "実行インデックスです。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "先行ノードの ID です。" - }, - "inputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "ノードの入力データです。簡略化された API レスポンスでは `null` の場合があります。" - }, - "process_data": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "ノードの処理データです。簡略化された API レスポンスでは `null` の場合があります。" - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "ノードの出力データです。簡略化された API レスポンスでは `null` の場合があります。" - }, - "status": { - "type": "string", - "description": "ノードの実行ステータスです。`running` は進行中、`succeeded` は成功、`failed` は失敗、`exception` は例外発生を示します。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "ノードが失敗した場合のエラーメッセージです。" - }, - "elapsed_time": { - "type": "number", - "description": "ノードの実行時間(秒)です。" - }, - "execution_metadata": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "実行メタデータ(例:トークン使用量、モデル情報)です。簡略化された API レスポンスでは `null` の場合があります。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "開始タイムスタンプ(Unix エポック秒)です。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "終了タイムスタンプ(Unix エポック秒)です。" - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "このノードで生成されたファイルです。" - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "このノードがイテレーション内で実行される場合のイテレーション ID です。" - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "このノードがループ内で実行される場合のループ ID です。" - } - } - } - } + "page": { + "default": 1, + "minimum": 1, + "type": "integer" } - ] + }, + "type": "object" }, - "StreamEventNodeRetry": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChildChunkListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ChildChunkResponse" + }, + "type": "array" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "limit": { + "type": "integer" }, - { - "type": "object", - "description": "ノードのリトライ回数です。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ノード実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "ワークフローグラフ内のノード ID です。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Node title." - }, - "index": { - "type": "integer", - "description": "実行インデックスです。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "先行ノードの ID です。" - }, - "inputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "ノードの入力データです。" - }, - "process_data": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "ノードの処理データです。" - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "ノードの出力データです。" - }, - "status": { - "type": "string", - "description": "ノードの実行ステータスです。`running` は進行中、`succeeded` は成功、`failed` は失敗、`exception` は例外発生を示します。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "このリトライのエラーメッセージです。" - }, - "elapsed_time": { - "type": "number", - "description": "この試行の実行時間(秒)です。" - }, - "execution_metadata": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "実行メタデータです。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "開始タイムスタンプ(Unix エポック秒)です。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "終了タイムスタンプ(Unix エポック秒)です。" - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "このリトライ中に生成されたファイルです。" - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "イテレーション ID(該当する場合)です。" - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "ループ ID(該当する場合)です。" - }, - "retry_index": { - "type": "integer", - "description": "リトライ回数インデックス、`0` から開始します。" - } - } - } - } - } - ] - }, - "StreamEventIterationStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "page": { + "type": "integer" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "total": { + "type": "integer" }, - { - "type": "object", - "description": "イテレーションループが開始されました。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "イテレーション実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "イテレーションノード ID です。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "イテレーションノードのタイトルです。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "開始タイムスタンプ(Unix エポック秒)です。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "追加メタデータです。" - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "イテレーションのメタデータです。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "イテレーションの入力データです。" - } - } - } - } + "total_pages": { + "type": "integer" } - ] + }, + "required": [ + "data", + "limit", + "page", + "total", + "total_pages" + ], + "type": "object" }, - "StreamEventIterationNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChildChunkResponse": { + "properties": { + "content": { + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "created_at": { + "type": "integer" }, - { - "type": "object", - "description": "イテレーションが次の項目に進みました。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "イテレーション実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "イテレーションノード ID です。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "イテレーションノードのタイトルです。" - }, - "index": { - "type": "integer", - "description": "現在のイテレーションインデックス(0 始まり)です。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "タイムスタンプ(Unix エポック秒)です。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "追加メタデータです。" - } - } - } - } - } - ] - }, - "StreamEventIterationCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "id": { + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "position": { + "type": "integer" }, - { - "type": "object", - "description": "イテレーションループが完了しました。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "イテレーション実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "イテレーションノード ID です。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "イテレーションノードのタイトルです。" - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "イテレーションの出力データです。" - }, - "status": { - "type": "string", - "description": "イテレーションの実行ステータスです。`running` は進行中、`succeeded` は成功、`failed` は失敗、`exception` は例外発生を示します。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "イテレーションが失敗した場合のエラーメッセージです。" - }, - "elapsed_time": { - "type": "number", - "description": "イテレーションの合計時間(秒)です。" - }, - "total_tokens": { - "type": "integer", - "description": "すべてのイテレーションで消費されたトークンの合計です。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "開始タイムスタンプ(Unix エポック秒)です。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "終了タイムスタンプ(Unix エポック秒)です。" - }, - "steps": { - "type": "integer", - "description": "実行されたイテレーションステップの合計数です。" - } - } - } - } - } - ] - }, - "StreamEventLoopStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "segment_id": { + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "type": { + "type": "string" }, - { - "type": "object", - "description": "ループが開始されました。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ループ実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "ループノード ID です。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "ループノードのタイトルです。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "開始タイムスタンプ(Unix エポック秒)です。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "追加メタデータです。" - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "ループのメタデータです。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "ループの入力データです。" - } - } - } - } + "updated_at": { + "type": "integer" + }, + "word_count": { + "type": "integer" } - ] + }, + "required": [ + "content", + "created_at", + "id", + "position", + "segment_id", + "type", + "updated_at", + "word_count" + ], + "type": "object" }, - "StreamEventLoopNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "ループが次のイテレーションに進みました。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ループ実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "ループノード ID です。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "ループノードのタイトルです。" - }, - "index": { - "type": "integer", - "description": "現在のループインデックス(0 始まり)です。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "タイムスタンプ(Unix エポック秒)です。" - }, - "pre_loop_output": { - "description": "前回のループイテレーションからの出力です。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "追加メタデータです。" - } - } - } - } + "ChildChunkUpdatePayload": { + "properties": { + "content": { + "description": "子チャンクのテキスト内容です。", + "type": "string" } - ] + }, + "required": [ + "content" + ], + "type": "object" }, - "StreamEventLoopCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "CompletionBlockingResponse": { + "additionalProperties": true, + "properties": { + "answer": { + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "created_at": { + "format": "int64", + "type": "integer" }, - { - "type": "object", - "description": "ループが完了しました。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ループ実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "ループノード ID です。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "ループノードのタイトルです。" - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "ループの出力データです。" - }, - "status": { - "type": "string", - "description": "ループの実行ステータスです。`running` は進行中、`succeeded` は成功、`failed` は失敗、`exception` は例外発生を示します。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "ループが失敗した場合のエラーメッセージです。" - }, - "elapsed_time": { - "type": "number", - "description": "ループの合計実行時間(秒)です。" - }, - "total_tokens": { - "type": "integer", - "description": "すべてのループイテレーションで消費されたトークンの合計です。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "開始タイムスタンプ(Unix エポック秒)です。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "終了タイムスタンプ(Unix エポック秒)です。" - }, - "steps": { - "type": "integer", - "description": "実行されたループの合計ステップ数です。" - } - } - } - } - } - ] - }, - "StreamEventHumanInputRequired": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "event": { + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "id": { + "format": "uuid", + "type": "string" }, - { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" - }, - "data": { - "type": "object", - "properties": { - "form_id": { - "type": "string", - "description": "フォームインスタンスの識別子。エラーメッセージやログに含まれます。Service API の呼び出しには `form_token` を使用してください。" - }, - "node_id": { - "type": "string", - "description": "このフォームを生成した Human Input ノードの ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input ノードの表示タイトル。" - }, - "form_content": { - "type": "string", - "description": "ワークフロー変数が置換された、事前レンダリング済みのフォーム本文。" - }, - "inputs": { - "type": "array", - "items": { - "type": "object", + "message_id": { + "format": "uuid", + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "type": "string" + }, + "task_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "answer", + "created_at", + "event", + "id", + "message_id", + "metadata", + "mode", + "task_id" + ], + "type": "object" + }, + "CompletionRequestPayload": { + "properties": { + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, "type": { - "type": "string", - "description": "フォーム入力コントロールの種類。使用可能な値:`paragraph`(複数行テキスト)、`select`(リストからの単一選択)、`file`(単一ファイルのアップロード)、`file-list`(複数ファイルのアップロード)。" + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "output_variable_name": { - "type": "string", - "description": "この入力の送信値をワークフロー内で参照する変数名。送信時の `inputs` オブジェクトのキーに対応します。" + "upload_file_id": { + "type": "string" }, - "default": { - "type": "object", - "nullable": true, - "description": "ワークフローコンテキストから解決されるデフォルト値。デフォルトが設定されていない場合は `null`。", - "properties": { - "type": { - "type": "string", - "description": "デフォルト値のソース。`constant` は `value` をリテラル文字列として使用します。`variable` は `selector` がワークフロー変数を指します。" - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "`type` が `variable` の場合の変数参照パス(例:`[\"node_id\", \"var_name\"]`)。少なくとも 2 要素を含みます。" - }, - "value": { - "type": "string", - "description": "`type` が `constant` の場合のリテラルデフォルト値。常に文字列です。" - } - } + "url": { + "format": "url", + "type": "string" } - } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" }, - "description": "受信者が記入するフォーム入力フィールド。" - }, - "actions": { - "type": "array", - "items": { - "type": "object", + { "properties": { - "id": { - "type": "string", - "maxLength": 20, - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "アクションボタンの識別子。受信者がこのボタンを選択したら、`action` として [人間の入力フォームを送信](/ja/api-reference/human-input/submit-human-input-form) に渡します。" + "remote_url": { + "format": "url", + "type": "string" }, - "title": { - "type": "string", - "maxLength": 100, - "description": "受信者に表示されるボタンのラベル。" + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" }, - "button_style": { - "type": "string", - "description": "ボタンの視覚スタイル。使用可能な値:`primary`、`default`、`accent`、`ghost`。" + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" } - } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" }, - "description": "送信時に受信者が選択できるアクション(ボタン)。" - }, - "display_in_ui": { - "type": "boolean", - "description": "フォームが Dify コンソール UI にも表示されるかどうか。" - }, - "form_token": { - "type": "string", - "nullable": true, - "description": "[人間の入力フォームを取得](/ja/api-reference/human-input/get-human-input-form) と [人間の入力フォームを送信](/ja/api-reference/human-input/submit-human-input-form) のアクセストークン。人間の入力ノードがメール配信またはコンソール配信を使用する場合は `null` になります(Service API は Web アプリ配信のフォームのみ操作できます)。" - }, - "resolved_default_values": { - "type": "object", - "additionalProperties": { - "type": "string" + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" }, - "description": "入力の `output_variable_name` をキーとする事前入力デフォルト値。すべての値は文字列化されます。" - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix タイムスタンプ(秒)。これを過ぎるとフォームは送信できなくなります。" - } - } + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" } - } - } - ] - }, - "StreamEventWorkflowPaused": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" + ], + "default": null }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "このワークフロー実行記録の永続的な識別子です。[ワークフロー実行詳細を取得](/ja/api-reference/workflow-runs/get-workflow-run-detail) と組み合わせて、実行後に結果を取得します。" - }, - "paused_nodes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "一時停止中のノード ID のリストです。" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "description": "一時停止時の部分的な出力です。" - }, - "reasons": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "一時停止の理由です。" - }, - "status": { - "type": "string", - "description": "ワークフローの実行ステータスです。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "作成タイムスタンプ。" - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "合計経過時間(秒)です。" - }, - "total_tokens": { - "type": "integer", - "description": "消費された合計トークン数です。" - }, - "total_steps": { - "type": "integer", - "description": "実行された合計ステップ数です。" - } - } - } - } - } - ] - }, - "StreamEventHumanInputFormFilled": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "inputs": { + "additionalProperties": true, + "type": "object" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "query": { + "default": "", + "type": "string" }, - { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "フォームが記入された Human Input ノードの ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input ノードの表示タイトル。" - }, - "rendered_content": { - "type": "string", - "description": "受信者の入力値で描画されたフォーム本文(`human_input_required` の `form_content` は未入力のテンプレートです)。" - }, - "action_id": { - "type": "string", - "description": "受信者が選択したアクションの識別子([人間の入力フォームを送信](/ja/api-reference/human-input/submit-human-input-form) に渡された `action` の値と一致します)。" - }, - "action_text": { - "type": "string", - "description": "選択されたアクションの表示テキスト。" - }, - "submitted_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "受信者が送信したフォームの値。各入力項目の `output_variable_name` をキーとします。" - } - } + { + "type": "null" } - } + ], + "default": null } - ] + }, + "required": [ + "inputs" + ], + "type": "object" }, - "StreamEventHumanInputFormTimeout": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "ワークフロー実行の実行 ID です。" - }, - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "フォームが期限切れとなった Human Input ノードの ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input ノードの表示タイトル。" + "CompletionRequestPayloadWithUser": { + "properties": { + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null + }, + "inputs": { + "additionalProperties": true, + "type": "object" + }, + "query": { + "default": "", + "type": "string" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user": { + "type": "string" + } + }, + "required": [ + "inputs", + "user" + ], + "type": "object" + }, + "Condition": { + "properties": { + "comparison_operator": { + "enum": [ + "<", + "=", + ">", + "after", + "before", + "contains", + "empty", + "end with", + "in", + "is", + "is not", + "not contains", + "not empty", + "not in", + "start with", + "≠", + "≤", + "≥" + ], + "type": "string" + }, + "name": { + "description": "比較対象とするメタデータフィールド名です。", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "comparison_operator", + "name" + ], + "type": "object" + }, + "ConversationInfiniteScrollPagination": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/SimpleConversation" + }, + "type": "array" + }, + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit" + ], + "type": "object" + }, + "ConversationListQuery": { + "properties": { + "last_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "limit": { + "default": 20, + "description": "返すレコード数です。", + "maximum": 100, + "minimum": 1, + "type": "integer" + }, + "sort_by": { + "default": "-updated_at", + "enum": [ + "-created_at", + "-updated_at", + "created_at", + "updated_at" + ], + "type": "string" + } + }, + "type": "object" + }, + "ConversationRenamePayload": { + "anyOf": [ + { + "properties": { + "auto_generate": { + "description": "会話名を自動生成します。`true` の場合、`name` フィールドは無視されます。", + "enum": [ + true + ], + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "auto_generate" + ], + "type": "object" + }, + { + "properties": { + "auto_generate": { + "default": false, + "description": "会話名を自動生成します。`true` の場合、`name` フィールドは無視されます。", + "enum": [ + false + ], + "type": "boolean" + }, + "name": { + "pattern": ".*\\S.*", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + ], + "properties": { + "auto_generate": { + "default": false, + "description": "会話名を自動生成します。`true` の場合、`name` フィールドは無視されます。", + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "ConversationRenamePayloadWithUser": { + "anyOf": [ + { + "properties": { + "auto_generate": { + "description": "会話名を自動生成します。`true` の場合、`name` フィールドは無視されます。", + "enum": [ + true + ], + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user": { + "type": "string" + } + }, + "required": [ + "auto_generate" + ], + "type": "object" + }, + { + "properties": { + "auto_generate": { + "default": false, + "description": "会話名を自動生成します。`true` の場合、`name` フィールドは無視されます。", + "enum": [ + false + ], + "type": "boolean" + }, + "name": { + "pattern": ".*\\S.*", + "type": "string" + }, + "user": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + ], + "properties": { + "auto_generate": { + "default": false, + "description": "会話名を自動生成します。`true` の場合、`name` フィールドは無視されます。", + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user": { + "type": "string" + } + }, + "type": "object" + }, + "ConversationVariableInfiniteScrollPaginationResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ConversationVariableResponse" + }, + "type": "array" + }, + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit" + ], + "type": "object" + }, + "ConversationVariableResponse": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "format": "uuid", + "type": "string" + }, + "name": { + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "value_type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "value_type" + ], + "type": "object" + }, + "ConversationVariableUpdatePayload": { + "properties": { + "value": { + "description": "変数の新しい値。変数の期待される型と一致する必要があります。" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ConversationVariableUpdatePayloadWithUser": { + "properties": { + "user": { + "type": "string" + }, + "value": { + "description": "変数の新しい値。変数の期待される型と一致する必要があります。" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ConversationVariablesQuery": { + "properties": { + "last_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "limit": { + "default": 20, + "description": "返すレコード数です。", + "maximum": 100, + "minimum": 1, + "type": "integer" + }, + "variable_name": { + "anyOf": [ + { + "maxLength": 255, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "指定した名前で変数をフィルタリングします。" + } + }, + "type": "object" + }, + "CustomConfigurationStatus": { + "enum": [ + "active", + "no-configure" + ], + "type": "string" + }, + "DatasetBoundTagListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DatasetBoundTagResponse" + }, + "type": "array" + }, + "total": { + "type": "integer" + } + }, + "required": [ + "data", + "total" + ], + "type": "object" + }, + "DatasetBoundTagResponse": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "DatasetCreatePayload": { + "properties": { + "description": { + "default": "", + "description": "ナレッジベースの説明です。", + "maxLength": 400, + "type": "string" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_api_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "外部ナレッジベースの ID です。" + }, + "indexing_technique": { + "anyOf": [ + { + "enum": [ + "economy", + "high_quality" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "`high_quality` は埋め込みモデルを使用した精密検索、`economy` はキーワードベースのインデキシングです。" + }, + "name": { + "description": "ナレッジベース名。", + "maxLength": 40, + "minLength": 1, + "type": "string" + }, + "permission": { + "anyOf": [ + { + "$ref": "#/components/schemas/PermissionEnum" + }, + { + "type": "null" + } + ], + "default": "only_me" + }, + "provider": { + "default": "vendor", + "enum": [ + "external", + "vendor" + ], + "type": "string" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "summary_index_setting": { + "anyOf": [ + { + "properties": { + "enable": { + "description": "サマリーインデックスを有効にするかどうかです。", + "type": "boolean" + }, + "model_name": { + "description": "要約生成に使用されるモデルの名前です。", + "type": "string" + }, + "model_provider_name": { + "description": "要約生成モデルのプロバイダーです。", + "type": "string" + }, + "summary_prompt": { + "description": "要約生成用のカスタムプロンプトテンプレートです。", + "type": "string" + } + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "description": "サマリーインデックスの設定です。" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "DatasetDetailResponse": { + "properties": { + "app_count": { + "type": "integer" + }, + "author_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "built_in_field_enabled": { + "type": "boolean" + }, + "chunk_structure": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "integer" + }, + "created_by": { + "type": "string" + }, + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "doc_form": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DatasetDocMetadataResponse" + }, + "type": "array" + }, + "document_count": { + "type": "integer" + }, + "embedding_available": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "enable_api": { + "type": "boolean" + }, + "external_knowledge_info": { + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + }, + "external_retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/DatasetExternalRetrievalModelResponse" + }, + { + "type": "null" + } + ] + }, + "icon_info": { + "$ref": "#/components/schemas/DatasetIconInfoResponse" + }, + "id": { + "type": "string" + }, + "indexing_technique": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "is_multimodal": { + "type": "boolean" + }, + "is_published": { + "type": "boolean" + }, + "maintainer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "type": "string" + }, + "permission": { + "type": "string" + }, + "permission_keys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "pipeline_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "provider": { + "type": "string" + }, + "retrieval_model_dict": { + "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + }, + "runtime_mode": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "summary_index_setting": { + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + }, + "tags": { + "items": { + "$ref": "#/components/schemas/DatasetTagResponse" + }, + "type": "array" + }, + "total_available_documents": { + "type": "integer" + }, + "total_documents": { + "type": "integer" + }, + "updated_at": { + "type": "integer" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "word_count": { + "type": "integer" + } + }, + "required": [ + "app_count", + "author_name", + "built_in_field_enabled", + "chunk_structure", + "created_at", + "created_by", + "data_source_type", + "description", + "doc_form", + "doc_metadata", + "document_count", + "embedding_model", + "embedding_model_provider", + "enable_api", + "external_retrieval_model", + "id", + "indexing_technique", + "is_multimodal", + "is_published", + "name", + "permission", + "pipeline_id", + "provider", + "retrieval_model_dict", + "runtime_mode", + "tags", + "total_available_documents", + "total_documents", + "updated_at", + "updated_by", + "word_count" + ], + "type": "object" + }, + "DatasetDetailWithPartialMembersResponse": { + "properties": { + "app_count": { + "type": "integer" + }, + "author_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "built_in_field_enabled": { + "type": "boolean" + }, + "chunk_structure": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "integer" + }, + "created_by": { + "type": "string" + }, + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "doc_form": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DatasetDocMetadataResponse" + }, + "type": "array" + }, + "document_count": { + "type": "integer" + }, + "embedding_available": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "enable_api": { + "type": "boolean" + }, + "external_knowledge_info": { + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + }, + "external_retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/DatasetExternalRetrievalModelResponse" + }, + { + "type": "null" + } + ] + }, + "icon_info": { + "$ref": "#/components/schemas/DatasetIconInfoResponse" + }, + "id": { + "type": "string" + }, + "indexing_technique": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "is_multimodal": { + "type": "boolean" + }, + "is_published": { + "type": "boolean" + }, + "maintainer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "type": "string" + }, + "partial_member_list": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null + }, + "permission": { + "type": "string" + }, + "permission_keys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "pipeline_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "provider": { + "type": "string" + }, + "retrieval_model_dict": { + "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + }, + "runtime_mode": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "summary_index_setting": { + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + }, + "tags": { + "items": { + "$ref": "#/components/schemas/DatasetTagResponse" + }, + "type": "array" + }, + "total_available_documents": { + "type": "integer" + }, + "total_documents": { + "type": "integer" + }, + "updated_at": { + "type": "integer" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "word_count": { + "type": "integer" + } + }, + "required": [ + "app_count", + "author_name", + "built_in_field_enabled", + "chunk_structure", + "created_at", + "created_by", + "data_source_type", + "description", + "doc_form", + "doc_metadata", + "document_count", + "embedding_model", + "embedding_model_provider", + "enable_api", + "external_retrieval_model", + "id", + "indexing_technique", + "is_multimodal", + "is_published", + "name", + "permission", + "pipeline_id", + "provider", + "retrieval_model_dict", + "runtime_mode", + "tags", + "total_available_documents", + "total_documents", + "updated_at", + "updated_by", + "word_count" + ], + "type": "object" + }, + "DatasetDocMetadataResponse": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "DatasetExternalKnowledgeInfoResponse": { + "properties": { + "external_knowledge_api_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_api_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_api_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetExternalRetrievalModelResponse": { + "properties": { + "score_threshold": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + }, + "score_threshold_enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "top_k": { + "type": "integer" + } + }, + "required": [ + "top_k" + ], + "type": "object" + }, + "DatasetIconInfoResponse": { + "properties": { + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "icon_background": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "icon_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "icon_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetKeywordSettingResponse": { + "properties": { + "keyword_weight": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetListQuery": { + "properties": { + "include_all": { + "default": false, + "description": "権限に関係なくすべてのナレッジベースを含めるかどうかです。", + "type": "boolean" + }, + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "名前でフィルタリングする検索キーワードです。" + }, + "limit": { + "default": 20, + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。", + "type": "integer" + }, + "page": { + "default": 1, + "type": "integer" + }, + "tag_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "DatasetListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DatasetDetailResponse" + }, + "type": "array" + }, + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "total": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "type": "object" + }, + "DatasetMetadataActionResponse": { + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ], + "type": "object" + }, + "DatasetMetadataBuiltInFieldResponse": { + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "name", + "type" + ], + "type": "object" + }, + "DatasetMetadataBuiltInFieldsResponse": { + "properties": { + "fields": { + "items": { + "$ref": "#/components/schemas/DatasetMetadataBuiltInFieldResponse" + }, + "type": "array" + } + }, + "required": [ + "fields" + ], + "type": "object" + }, + "DatasetMetadataListItemResponse": { + "properties": { + "count": { + "default": 0, + "type": "integer" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "DatasetMetadataListResponse": { + "properties": { + "built_in_field_enabled": { + "type": "boolean" + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DatasetMetadataListItemResponse" + }, + "type": "array" + } + }, + "required": [ + "built_in_field_enabled", + "doc_metadata" + ], + "type": "object" + }, + "DatasetMetadataResponse": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "DatasetRerankingModelResponse": { + "properties": { + "reranking_model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "reranking_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetRetrievalModelResponse": { + "properties": { + "reranking_enable": { + "type": "boolean" + }, + "reranking_mode": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "reranking_model": { + "$ref": "#/components/schemas/DatasetRerankingModelResponse" + }, + "score_threshold": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + }, + "score_threshold_enabled": { + "type": "boolean" + }, + "search_method": { + "type": "string" + }, + "top_k": { + "type": "integer" + }, + "weights": { + "anyOf": [ + { + "$ref": "#/components/schemas/DatasetWeightedScoreResponse" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "reranking_enable", + "score_threshold_enabled", + "search_method", + "top_k" + ], + "type": "object" + }, + "DatasetSummaryIndexSettingResponse": { + "properties": { + "enable": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "model_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "summary_prompt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetTagResponse": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "DatasetUpdatePayload": { + "properties": { + "description": { + "anyOf": [ + { + "maxLength": 400, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ナレッジベースの説明です。" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_api_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "外部ナレッジベースの ID です。" + }, + "external_retrieval_model": { + "anyOf": [ + { + "properties": { + "score_threshold": { + "type": "number" + }, + "score_threshold_enabled": { + "description": "スコア閾値フィルタリングが有効かどうかです。", + "type": "boolean" + }, + "top_k": { + "description": "返す結果の最大数です。", + "type": "integer" + } + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "description": "外部ナレッジベースの検索設定です。" + }, + "indexing_technique": { + "anyOf": [ + { + "enum": [ + "economy", + "high_quality" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "`high_quality` は埋め込みモデルを使用した精密検索、`economy` はキーワードベースのインデキシングです。" + }, + "name": { + "anyOf": [ + { + "maxLength": 40, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ナレッジベース名。" + }, + "partial_member_list": { + "anyOf": [ + { + "items": { + "properties": { + "user_id": { + "description": "アクセス権を付与するチームメンバーの ID です。", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "`permission` が `partial_members` の場合にアクセス権を持つチームメンバーのリストです。" + }, + "permission": { + "anyOf": [ + { + "$ref": "#/components/schemas/PermissionEnum" + }, + { + "type": "null" + } + ], + "default": null + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetVectorSettingResponse": { + "properties": { + "embedding_model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "vector_weight": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetWeightedScoreResponse": { + "properties": { + "keyword_setting": { + "$ref": "#/components/schemas/DatasetKeywordSettingResponse" + }, + "vector_setting": { + "$ref": "#/components/schemas/DatasetVectorSettingResponse" + }, + "weight_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasourceCredentialInfoResponse": { + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "is_default": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasourceNodeRunPayload": { + "properties": { + "credential_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "datasource_type": { + "description": "データソースの種類です。", + "enum": [ + "local_file", + "online_document", + "online_drive", + "website_crawl" + ], + "type": "string" + }, + "inputs": { + "additionalProperties": true, + "description": "データソースノードの入力変数です。", + "type": "object" + }, + "is_published": { + "type": "boolean" + } + }, + "required": [ + "datasource_type", + "inputs", + "is_published" + ], + "type": "object" + }, + "DatasourcePluginListResponse": { + "items": { + "$ref": "#/components/schemas/DatasourcePluginResponse" + }, + "type": "array" + }, + "DatasourcePluginResponse": { + "properties": { + "credentials": { + "items": { + "$ref": "#/components/schemas/DatasourceCredentialInfoResponse" + }, + "type": "array" + }, + "datasource_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "plugin_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user_input_variables": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "DatasourcePluginsQuery": { + "properties": { + "is_published": { + "default": true, + "type": "boolean" + } + }, + "type": "object" + }, + "DocumentAndBatchResponse": { + "properties": { + "batch": { + "type": "string" + }, + "document": { + "$ref": "#/components/schemas/DocumentResponse" + } + }, + "required": [ + "batch", + "document" + ], + "type": "object" + }, + "DocumentBatchDownloadZipPayload": { + "properties": { + "document_ids": { + "items": { + "format": "uuid", + "type": "string" + }, + "maxItems": 100, + "minItems": 1, + "type": "array" + } + }, + "required": [ + "document_ids" + ], + "type": "object" + }, + "DocumentDetailResponse": { + "properties": { + "archived": { + "default": null, + "type": "boolean" + }, + "average_segment_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "number" + } + ], + "default": null + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_at": { + "default": null, + "type": "integer" + }, + "created_by": { + "default": null, + "type": "string" + }, + "created_from": { + "default": null, + "type": "string" + }, + "data_source_info": { + "additionalProperties": true, + "default": null, + "type": "object" + }, + "data_source_type": { + "default": null, + "type": "string" + }, + "dataset_process_rule": { + "additionalProperties": true, + "default": null, + "type": "object" + }, + "dataset_process_rule_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "disabled_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "display_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "doc_form": { + "default": null, + "type": "string" + }, + "doc_language": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "doc_metadata": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/DocumentMetadataResponse" + }, + "type": "array" + }, + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null + }, + "doc_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "document_process_rule": { + "additionalProperties": true, + "default": null, + "type": "object" + }, + "enabled": { + "default": null, + "type": "boolean" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "hit_count": { + "default": null, + "type": "integer" + }, + "id": { + "type": "string" + }, + "indexing_latency": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + }, + "indexing_status": { + "default": null, + "type": "string" + }, + "name": { + "default": null, + "type": "string" + }, + "need_summary": { + "default": null, + "type": "boolean" + }, + "position": { + "default": null, + "type": "integer" + }, + "segment_count": { + "default": null, + "type": "integer" + }, + "summary_index_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "updated_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "DocumentGetQuery": { + "properties": { + "metadata": { + "default": "all", + "description": "`all` はメタデータを含むすべてのフィールドを返します。`only` は `id`、`doc_type`、`doc_metadata` のみを返します。`without` は `doc_metadata` を除くすべてのフィールドを返します。", + "enum": [ + "all", + "only", + "without" + ], + "type": "string" + } + }, + "type": "object" + }, + "DocumentListQuery": { + "properties": { + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ドキュメント名でフィルタリングするための検索キーワードです。" + }, + "limit": { + "default": 20, + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。", + "type": "integer" + }, + "page": { + "default": 1, + "type": "integer" + }, + "status": { + "anyOf": [ + { + "enum": [ + "archived", + "available", + "disabled", + "error", + "indexing", + "paused", + "queuing" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "表示ステータスでフィルタリングします。" + } + }, + "type": "object" + }, + "DocumentListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DocumentResponse" + }, + "type": "array" + }, + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "total": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "type": "object" + }, + "DocumentMetadataOperation": { + "properties": { + "document_id": { + "format": "uuid", + "type": "string" + }, + "metadata_list": { + "items": { + "$ref": "#/components/schemas/MetadataDetail" + }, + "type": "array" + }, + "partial_update": { + "default": false, + "description": "メタデータを部分的に更新し、未指定フィールドの既存の値を保持するかどうかです。", + "type": "boolean" + } + }, + "required": [ + "document_id", + "metadata_list" + ], + "type": "object" + }, + "DocumentMetadataResponse": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "DocumentResponse": { + "properties": { + "archived": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_from": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "data_source_detail_dict": { + "additionalProperties": true, + "type": "object" + }, + "data_source_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null + }, + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "dataset_process_rule_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "disabled_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "display_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "doc_form": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DocumentMetadataResponse" + }, + "type": "array" + }, + "enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "hit_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "type": "string" + }, + "indexing_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "type": "string" + }, + "need_summary": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "position": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "summary_index_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "word_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "data_source_detail_dict", + "id", + "name" + ], + "type": "object" + }, + "DocumentStatusListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DocumentStatusResponse" + }, + "type": "array" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "DocumentStatusPayload": { + "properties": { + "document_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "DocumentStatusResponse": { + "properties": { + "cleaning_completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "completed_segments": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "error_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "estimated_vector_space_mb": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "type": "string" + }, + "indexing_status": { + "type": "string" + }, + "parsing_completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "paused_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "processing_started_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "splitting_completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "stopped_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "total_segments": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "vector_space_limit_mb": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "cleaning_completed_at", + "completed_at", + "error", + "id", + "indexing_status", + "parsing_completed_at", + "paused_at", + "processing_started_at", + "splitting_completed_at", + "stopped_at" + ], + "type": "object" + }, + "DocumentTextCreatePayload": { + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` は標準テキストチャンキング、`hierarchical_model` は親子チャンク構造、`qa_model` は質問・回答ペアの抽出です。", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "処理最適化のためのドキュメント言語です。", + "type": "string" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "indexing_technique": { + "anyOf": [ + { + "enum": [ + "economy", + "high_quality" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "description": "ドキュメント名です。", + "type": "string" + }, + "original_document_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "チャンキングの処理ルールです。" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "text": { + "description": "ドキュメントのテキスト内容です。", + "type": "string" + } + }, + "required": [ + "name", + "text" + ], + "type": "object" + }, + "DocumentTextUpdate": { + "anyOf": [ + { + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` は標準テキストチャンキング、`hierarchical_model` は親子チャンク構造、`qa_model` は質問・回答ペアの抽出です。", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "処理最適化のためのドキュメント言語です。", + "type": "string" + }, + "name": { + "default": null, + "description": "ドキュメント名です。`text` を指定する場合は必須です。", + "type": "string" + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "チャンキングの処理ルールです。" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "text": { + "default": null, + "description": "ドキュメントのテキスト内容です。", + "type": "string" + } + }, + "required": [ + "name", + "text" + ], + "type": "object" + }, + { + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` は標準テキストチャンキング、`hierarchical_model` は親子チャンク構造、`qa_model` は質問・回答ペアの抽出です。", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "処理最適化のためのドキュメント言語です。", + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ドキュメント名です。`text` を指定する場合は必須です。" + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "チャンキングの処理ルールです。" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "text": { + "description": "ドキュメントのテキスト内容です。", + "type": "null" + } + }, + "type": "object" + } + ], + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` は標準テキストチャンキング、`hierarchical_model` は親子チャンク構造、`qa_model` は質問・回答ペアの抽出です。", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "処理最適化のためのドキュメント言語です。", + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ドキュメント名です。`text` を指定する場合は必須です。" + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "チャンキングの処理ルールです。" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "text": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ドキュメントのテキスト内容です。" + } + }, + "type": "object" + }, + "EventStreamResponse": { + "type": "string" + }, + "ExecutionContentType": { + "enum": [ + "human_input" + ], + "type": "string" + }, + "FeedbackListQuery": { + "properties": { + "limit": { + "default": 20, + "maximum": 101, + "minimum": 1, + "type": "integer" + }, + "page": { + "default": 1, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "FetchFrom": { + "enum": [ + "customizable-model", + "predefined-model" + ], + "type": "string" + }, + "FileInputConfig": { + "properties": { + "allowed_file_extensions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "allowed_file_types": { + "items": { + "$ref": "#/components/schemas/FileType" + }, + "type": "array" + }, + "allowed_file_upload_methods": { + "items": { + "$ref": "#/components/schemas/FileTransferMethod" + }, + "type": "array" + }, + "output_variable_name": { + "type": "string" + }, + "type": { + "const": "file", + "default": "file", + "type": "string" + } + }, + "required": [ + "output_variable_name" + ], + "type": "object" + }, + "FileListInputConfig": { + "properties": { + "allowed_file_extensions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "allowed_file_types": { + "items": { + "$ref": "#/components/schemas/FileType" + }, + "type": "array" + }, + "allowed_file_upload_methods": { + "items": { + "$ref": "#/components/schemas/FileTransferMethod" + }, + "type": "array" + }, + "number_limits": { + "default": 0, + "minimum": 0, + "type": "integer" + }, + "output_variable_name": { + "type": "string" + }, + "type": { + "const": "file-list", + "default": "file-list", + "type": "string" + } + }, + "required": [ + "output_variable_name" + ], + "type": "object" + }, + "FilePreviewQuery": { + "properties": { + "as_attachment": { + "default": false, + "type": "boolean" + } + }, + "type": "object" + }, + "FileResponse": { + "properties": { + "conversation_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_by": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "extension": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "file_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "format": "uuid", + "type": "string" + }, + "mime_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "type": "string" + }, + "original_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "preview_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "reference": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "size": { + "type": "integer" + }, + "source_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tenant_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id", + "name", + "size" + ], + "type": "object" + }, + "FileTransferMethod": { + "enum": [ + "datasource_file", + "local_file", + "remote_url", + "tool_file" + ], + "type": "string" + }, + "FileType": { + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "FormInputConfig": { + "discriminator": { + "mapping": { + "file": "#/components/schemas/FileInputConfig", + "file-list": "#/components/schemas/FileListInputConfig", + "paragraph": "#/components/schemas/ParagraphInputConfig", + "select": "#/components/schemas/SelectInputConfig" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ParagraphInputConfig" + }, + { + "$ref": "#/components/schemas/SelectInputConfig" + }, + { + "$ref": "#/components/schemas/FileInputConfig" + }, + { + "$ref": "#/components/schemas/FileListInputConfig" + } + ] + }, + "HitTestingChildChunk": { + "properties": { + "content": { + "type": "string" + }, + "id": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "score": { + "type": "number" + } + }, + "required": [ + "content", + "id", + "position", + "score" + ], + "type": "object" + }, + "HitTestingDocument": { + "properties": { + "data_source_type": { + "type": "string" + }, + "doc_metadata": { + "anyOf": [ + {}, + { + "type": "null" + } + ] + }, + "doc_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "data_source_type", + "doc_metadata", + "doc_type", + "id", + "name" + ], + "type": "object" + }, + "HitTestingFile": { + "properties": { + "extension": { + "type": "string" + }, + "id": { + "type": "string" + }, + "mime_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "source_url": { + "type": "string" + } + }, + "required": [ + "extension", + "id", + "mime_type", + "name", + "size", + "source_url" + ], + "type": "object" + }, + "HitTestingPayload": { + "properties": { + "attachment_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "検索コンテキストに含める添付ファイル ID のリストです。" + }, + "external_retrieval_model": { + "anyOf": [ + { + "properties": { + "score_threshold": { + "type": "number" + }, + "score_threshold_enabled": { + "description": "スコア閾値フィルタリングが有効かどうかです。", + "type": "boolean" + }, + "top_k": { + "description": "返す結果の最大数です。", + "type": "integer" + } + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "description": "外部ナレッジベースの検索設定です。" + }, + "query": { + "description": "検索クエリテキストです。", + "maxLength": 250, + "type": "string" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "HitTestingQuery": { + "properties": { + "content": { + "type": "string" + } + }, + "required": [ + "content" + ], + "type": "object" + }, + "HitTestingRecord": { + "properties": { + "child_chunks": { + "items": { + "$ref": "#/components/schemas/HitTestingChildChunk" + }, + "type": "array" + }, + "files": { + "items": { + "$ref": "#/components/schemas/HitTestingFile" + }, + "type": "array" + }, + "score": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "segment": { + "$ref": "#/components/schemas/HitTestingSegment" + }, + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tsne_position": { + "anyOf": [ + {}, + { + "type": "null" + } + ] + } + }, + "required": [ + "child_chunks", + "files", + "score", + "segment", + "summary", + "tsne_position" + ], + "type": "object" + }, + "HitTestingResponse": { + "properties": { + "query": { + "$ref": "#/components/schemas/HitTestingQuery" + }, + "records": { + "items": { + "$ref": "#/components/schemas/HitTestingRecord" + }, + "type": "array" + } + }, + "required": [ + "query", + "records" + ], + "type": "object" + }, + "HitTestingSegment": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "content": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "created_by": { + "type": "string" + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "disabled_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "document": { + "$ref": "#/components/schemas/HitTestingDocument" + }, + "document_id": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "hit_count": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "index_node_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "index_node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "indexing_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "keywords": { + "items": { + "type": "string" + }, + "type": "array" + }, + "position": { + "type": "integer" + }, + "sign_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "stopped_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "tokens": { + "type": "integer" + }, + "word_count": { + "type": "integer" + } + }, + "required": [ + "answer", + "completed_at", + "content", + "created_at", + "created_by", + "disabled_at", + "disabled_by", + "document", + "document_id", + "enabled", + "error", + "hit_count", + "id", + "index_node_hash", + "index_node_id", + "indexing_at", + "keywords", + "position", + "sign_content", + "status", + "stopped_at", + "tokens", + "word_count" + ], + "type": "object" + }, + "HumanInputFormDefinitionResponse": { + "properties": { + "expiration_time": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "form_content": { + "type": "string" + }, + "inputs": { + "items": { + "$ref": "#/components/schemas/FormInputConfig" + }, + "type": "array" + }, + "resolved_default_values": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "user_actions": { + "items": { + "$ref": "#/components/schemas/UserActionConfig" + }, + "type": "array" + } + }, + "required": [ + "form_content", + "inputs", + "resolved_default_values", + "user_actions" + ], + "type": "object" + }, + "HumanInputFormSubmitPayload": { + "properties": { + "action": { + "type": "string" + }, + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + }, + "examples": [ + { + "attachment": { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "4e0d1b87-52f2-49f6-b8c6-95cd9c954b3e" + }, + "attachments": [ + { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee" + }, + { + "transfer_method": "remote_url", + "type": "document", + "url": "https://example.com/report.pdf" + } + ], + "decision": "approve" + } + ], + "type": "object" + } + }, + "required": [ + "action", + "inputs" + ], + "type": "object" + }, + "HumanInputFormSubmitPayloadWithUser": { + "properties": { + "action": { + "type": "string" + }, + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + }, + "examples": [ + { + "attachment": { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "4e0d1b87-52f2-49f6-b8c6-95cd9c954b3e" + }, + "attachments": [ + { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee" + }, + { + "transfer_method": "remote_url", + "type": "document", + "url": "https://example.com/report.pdf" + } + ], + "decision": "approve" + } + ], + "type": "object" + }, + "user": { + "type": "string" + } + }, + "required": [ + "action", + "inputs", + "user" + ], + "type": "object" + }, + "HumanInputFormSubmitResponse": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "I18nObject": { + "properties": { + "en_US": { + "type": "string" + }, + "zh_Hans": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "en_US" + ], + "type": "object" + }, + "IndexInfoResponse": { + "properties": { + "api_version": { + "type": "string" + }, + "server_version": { + "type": "string" + }, + "welcome": { + "type": "string" + } + }, + "required": [ + "api_version", + "server_version", + "welcome" + ], + "type": "object" + }, + "JSONObject": { + "additionalProperties": true, + "type": "object" + }, + "JSONValue": {}, + "JSONValueType": {}, + "JsonValue": {}, + "KnowledgeTagListResponse": { + "items": { + "$ref": "#/components/schemas/KnowledgeTagResponse" + }, + "type": "array" + }, + "KnowledgeTagResponse": { + "properties": { + "binding_count": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "MessageFeedbackPayload": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "追加の詳細を提供する任意のテキストフィードバック。" + }, + "rating": { + "anyOf": [ + { + "enum": [ + "dislike", + "like" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "フィードバック評価。以前送信したフィードバックを取り消すには `null` に設定します。" + } + }, + "type": "object" + }, + "MessageFeedbackPayloadWithUser": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "追加の詳細を提供する任意のテキストフィードバック。" + }, + "rating": { + "anyOf": [ + { + "enum": [ + "dislike", + "like" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "フィードバック評価。以前送信したフィードバックを取り消すには `null` に設定します。" + }, + "user": { + "type": "string" + } + }, + "required": [ + "user" + ], + "type": "object" + }, + "MessageFile": { + "properties": { + "belongs_to": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "filename": { + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "mime_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "transfer_method": { + "type": "string" + }, + "type": { + "type": "string" + }, + "upload_file_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "url": { + "anyOf": [ + { + "format": "url", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "filename", + "id", + "transfer_method", + "type" + ], + "type": "object" + }, + "MessageInfiniteScrollPagination": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/MessageListItem" + }, + "type": "array" + }, + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit" + ], + "type": "object" + }, + "MessageListItem": { + "properties": { + "agent_thoughts": { + "items": { + "$ref": "#/components/schemas/AgentThought" + }, + "type": "array" + }, + "answer": { + "type": "string" + }, + "answer_tokens": { + "default": 0, + "type": "integer" + }, + "conversation_id": { + "format": "uuid", + "type": "string" + }, + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "currency": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "extra_contents": { + "items": { + "$ref": "#/components/schemas/HumanInputContent" + }, + "type": "array" + }, + "feedback": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleFeedback" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "format": "uuid", + "type": "string" + }, + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JSONValueType" + }, + "type": "object" + }, + "message_files": { + "items": { + "$ref": "#/components/schemas/MessageFile" + }, + "type": "array" + }, + "message_tokens": { + "default": 0, + "type": "integer" + }, + "parent_message_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "provider_response_latency": { + "default": 0, + "format": "float", + "type": "number" + }, + "query": { + "type": "string" + }, + "retriever_resources": { + "items": { + "$ref": "#/components/schemas/RetrieverResource" + }, + "type": "array" + }, + "status": { + "type": "string" + }, + "total_price": { + "anyOf": [ + { + "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "total_tokens": { + "readOnly": true, + "type": "integer" + } + }, + "required": [ + "agent_thoughts", + "answer", + "conversation_id", + "extra_contents", + "id", + "inputs", + "message_files", + "query", + "retriever_resources", + "status", + "total_tokens" + ], + "type": "object" + }, + "MessageListQuery": { + "properties": { + "conversation_id": { + "description": "会話 ID。", + "type": "string" + }, + "first_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "limit": { + "default": 20, + "description": "リクエストごとに返すチャット履歴メッセージの数です。", + "maximum": 100, + "minimum": 1, + "type": "integer" + } + }, + "required": [ + "conversation_id" + ], + "type": "object" + }, + "MetadataArgs": { + "properties": { + "name": { + "description": "メタデータフィールド名です。", + "type": "string" + }, + "type": { + "description": "`string` はテキスト値、`number` は数値、`time` は日付/時刻値です。", + "enum": [ + "number", + "string", + "time" + ], + "type": "string" + } + }, + "required": [ + "name", + "type" + ], + "type": "object" + }, + "MetadataDetail": { + "properties": { + "id": { + "format": "uuid", + "type": "string" + }, + "name": { + "description": "メタデータフィールド名です。", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "メタデータ値。文字列、数値、または `null` を指定できます。" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "MetadataFilteringCondition": { + "properties": { + "conditions": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/Condition" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "deprecated": true, + "description": "評価するメタデータ条件のリストです。" + }, + "logical_operator": { + "anyOf": [ + { + "enum": [ + "and", + "or" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "and", + "description": "複数の条件を組み合わせる方法です。" + } + }, + "type": "object" + }, + "MetadataOperationData": { + "properties": { + "operation_data": { + "items": { + "$ref": "#/components/schemas/DocumentMetadataOperation" + }, + "type": "array" + } + }, + "required": [ + "operation_data" + ], + "type": "object" + }, + "MetadataUpdatePayload": { + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "ModelFeature": { + "enum": [ + "agent-thought", + "audio", + "document", + "multi-tool-call", + "polling", + "stream-tool-call", + "structured-output", + "tool-call", + "video", + "vision" + ], + "type": "string" + }, + "ModelPropertyKey": { + "enum": [ + "audio_type", + "context_size", + "default_voice", + "file_upload_limit", + "max_characters_per_chunk", + "max_chunks", + "max_workers", + "mode", + "supported_file_extensions", + "voices", + "word_limit" + ], + "type": "string" + }, + "ModelStatus": { + "enum": [ + "active", + "credential-removed", + "disabled", + "no-configure", + "no-permission", + "quota-exceeded" + ], + "type": "string" + }, + "ModelType": { + "enum": [ + "llm", + "moderation", + "rerank", + "speech2text", + "text-embedding", + "tts" + ], + "type": "string" + }, + "OptionalServiceApiUserPayload": { + "properties": { + "user": { + "type": "string" + } + }, + "type": "object" + }, + "ParagraphInputConfig": { + "properties": { + "default": { + "anyOf": [ + { + "$ref": "#/components/schemas/StringSource" + }, + { + "type": "null" + } + ], + "default": null + }, + "output_variable_name": { + "type": "string" + }, + "type": { + "const": "paragraph", + "default": "paragraph", + "type": "string" + } + }, + "required": [ + "output_variable_name" + ], + "type": "object" + }, + "Parameters": { + "properties": { + "annotation_reply": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "file_upload": { + "properties": { + "allowed_file_extensions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "allowed_file_types": { + "items": { + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "type": "array" + }, + "allowed_file_upload_methods": { + "items": { + "enum": [ + "local_file", + "remote_url" + ], + "type": "string" + }, + "type": "array" + }, + "enabled": { + "type": "boolean" + }, + "image": { + "properties": { + "detail": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "number_limits": { + "type": "integer" + }, + "transfer_methods": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "number_limits": { + "type": "integer" + } + }, + "type": "object" + }, + "more_like_this": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "opening_statement": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "retriever_resource": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "sensitive_word_avoidance": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "speech_to_text": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "suggested_questions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "suggested_questions_after_answer": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "system_parameters": { + "$ref": "#/components/schemas/SystemParameters" + }, + "text_to_speech": { + "properties": { + "autoPlay": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "language": { + "type": "string" + }, + "voice": { + "type": "string" + } + }, + "type": "object" + }, + "user_input_form": { + "items": { + "oneOf": [ + { + "additionalProperties": false, + "properties": { + "text-input": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "text-input" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "select": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "select" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "paragraph": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "paragraph" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "number": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "number" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "external_data_tool": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "external_data_tool" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "file": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "file" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "file-list": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "file-list" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "checkbox": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "checkbox" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "json_object": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix タイムスタンプ(秒)。フォームが期限切れとなった時刻。" - } + "required": [ + "json_object" + ], + "type": "object" } - } - } + ], + "type": "object" + }, + "type": "array" } - ] + }, + "required": [ + "annotation_reply", + "file_upload", + "more_like_this", + "retriever_resource", + "sensitive_word_avoidance", + "speech_to_text", + "suggested_questions", + "suggested_questions_after_answer", + "system_parameters", + "text_to_speech", + "user_input_form" + ], + "type": "object" }, - "StreamEventAgentLog": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "ワークフロー内のエージェントノードからのエージェントログです。", - "properties": { - "data": { - "type": "object", - "properties": { - "node_execution_id": { - "type": "string", - "description": "ノード実行 ID です。" - }, - "id": { - "type": "string", - "description": "ログエントリ ID です。" - }, - "label": { - "type": "string", - "description": "ログエントリのラベルです。" - }, - "parent_id": { - "type": "string", - "nullable": true, - "description": "ネストされたエントリの親ログエントリ ID です。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "エラーメッセージ(該当する場合)です。" - }, - "status": { - "type": "string", - "description": "ログエントリのステータスです。" - }, - "data": { - "type": "object", - "additionalProperties": true, - "description": "ログエントリのデータです。" - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "追加メタデータです。" - }, - "node_id": { - "type": "string", - "description": "ワークフローグラフ内のノード ID です。" - } - } - } - } - } - ] + "PermissionEnum": { + "enum": [ + "all_team_members", + "only_me", + "partial_members" + ], + "type": "string" }, - "StreamEventChatReasoningChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" + "PipelineDataset": { + "properties": { + "chunk_structure": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "message_id": { - "type": "string", - "format": "uuid", - "description": "この推論が属するメッセージの ID(トップレベルの `message_id` と同じ値)。" - }, - "reasoning": { - "type": "string", - "description": "`reasoning_format` が `separated` の LLM ノードが発行する思考過程のデルタです。連続する `reasoning_chunk` イベントを連結すると、完全な推論を復元できます。このストリームは `message` と並行しており、`message`(回答)ストリームには `` タグが含まれません。" - }, - "node_id": { - "type": "string", - "nullable": true, - "description": "推論を生成している LLM ノードの ID です。複数の LLM ノードが実行される場合に、推論の出所を特定できます。" - }, - "is_final": { - "type": "boolean", - "description": "`true` は LLM ノードの推論フェーズの終了(「思考完了」のシグナル)を示します。空の `reasoning` を伴う場合があります。" - } - } - } - } - } - ] - }, - "StreamEventChatTextChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "description": { + "default": "", + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "id": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "テキスト内容のチャンクです。" - }, - "from_variable_selector": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true, - "description": "ワークフロー内のテキスト変数のソースパスです。" - } - } - } - } + "name": { + "type": "string" } - ] + }, + "required": [ + "chunk_structure", + "id", + "name" + ], + "type": "object" }, - "WorkflowRunDetailResponse": { - "type": "object", + "PipelineDocument": { "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ワークフロー実行 ID です。" - }, - "workflow_id": { - "type": "string", - "format": "uuid", - "description": "Workflow ID." - }, - "status": { - "type": "string", - "description": "ワークフローの実行ステータスです。`running` は実行中、`succeeded` は正常完了、`failed` は実行エラー、`stopped` は手動停止、`partial-succeeded` は一部のノードが成功し他が失敗、`paused` は人間の入力待ちを示します。" + "data_source_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null }, - "inputs": { - "type": "string", - "nullable": true, - "description": "ワークフロー実行の入力変数です。生の JSON 文字列として返されるため(例:`{\"query\": \"...\"}`)、クライアント側でパースする必要があります。`null` の場合もあります。" + "data_source_type": { + "type": "string" }, - "outputs": { - "type": "object", - "additionalProperties": true, - "description": "ワークフローからの出力データです。出力がまだない場合は空のオブジェクトです。" + "enabled": { + "type": "boolean" }, "error": { - "type": "string", - "nullable": true, - "description": "ワークフローが失敗した場合のエラーメッセージです。" - }, - "total_steps": { - "type": "integer", - "description": "実行されたワークフローの合計ステップ数です。" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "total_tokens": { - "type": "integer", - "description": "消費された合計トークン数です。" + "id": { + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "ワークフロー実行が作成された Unix タイムスタンプです。" + "indexing_status": { + "type": "string" }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "ワークフロー実行が完了した Unix タイムスタンプです。" + "name": { + "type": "string" }, - "elapsed_time": { - "type": "number", - "format": "float", - "nullable": true, - "description": "合計経過時間(秒)です。" + "position": { + "type": "integer" } - } + }, + "required": [ + "data_source_type", + "enabled", + "id", + "indexing_status", + "name", + "position" + ], + "type": "object" }, - "WorkflowLogsResponse": { - "type": "object", + "PipelineRunApiEntity": { "properties": { - "page": { - "type": "integer", - "description": "現在のページ番号です。" - }, - "limit": { - "type": "integer", - "description": "1 ページあたりの件数です。" - }, - "total": { - "type": "integer", - "description": "ログエントリの合計数です。" - }, - "has_more": { - "type": "boolean", - "description": "さらにページがあるかどうかです。" - }, - "data": { - "type": "array", + "datasource_info_list": { + "description": "処理対象のデータソースオブジェクトのリストです。項目の構造は `datasource_type` によって異なります。", "items": { - "$ref": "#/components/schemas/WorkflowLogItem" - }, - "description": "ワークフローログエントリのリストです。" - } - } - }, - "WorkflowLogItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ログエントリ ID です。" - }, - "workflow_run": { - "$ref": "#/components/schemas/WorkflowRunSummary" + "oneOf": [ + { + "properties": { + "name": { + "type": "string" + }, + "reference": { + "type": "string" + } + }, + "required": [ + "reference" + ], + "title": "Local File", + "type": "object" + }, + { + "properties": { + "credential_id": { + "type": "string" + }, + "page": { + "description": "ページの詳細です。", + "properties": { + "page_id": { + "description": "ページ識別子です。", + "type": "string" + }, + "page_name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "page_id", + "type" + ], + "type": "object" + }, + "workspace_id": { + "type": "string" + } + }, + "required": [ + "page", + "workspace_id" + ], + "title": "Online Document", + "type": "object" + }, + { + "properties": { + "title": { + "type": "string" + }, + "url": { + "description": "クロール対象の URL です。", + "type": "string" + } + }, + "required": [ + "url" + ], + "title": "Website Crawl", + "type": "object" + }, + { + "properties": { + "bucket": { + "type": "string" + }, + "id": { + "description": "ファイルまたはフォルダの ID です。", + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "description": "この項目が単一ファイルか、展開対象のフォルダかを指定します。", + "enum": [ + "file", + "folder" + ], + "type": "string" + } + }, + "required": [ + "id", + "type" + ], + "title": "Online Drive", + "type": "object" + } + ] + }, + "type": "array" }, - "created_from": { - "type": "string", - "description": "ワークフロー実行のソース(例:`service-api`)です。" + "datasource_type": { + "description": "データソースのタイプ。`datasource_info_list` の各項目に必要なフィールドを決定します。", + "enum": [ + "local_file", + "online_document", + "online_drive", + "website_crawl" + ], + "type": "string" }, - "created_by_role": { - "type": "string", - "description": "作成者のロール(例:`end_user`、`account`)です。" + "inputs": { + "additionalProperties": true, + "description": "パイプライン入力変数のキーと値のペア。ワークフローで定義されたパイプライン変数に対応します。入力変数がない場合は `{}` を渡してください。", + "type": "object" }, - "created_by_account": { - "type": "object", - "nullable": true, - "description": "管理者ユーザーが作成した場合のアカウント詳細です。", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "アカウント ID。" - }, - "name": { - "type": "string", - "description": "アカウント表示名。" - }, - "email": { - "type": "string", - "description": "アカウントメールアドレス。" - } - } + "is_published": { + "type": "boolean" }, - "created_by_end_user": { - "$ref": "#/components/schemas/EndUserSummary" + "response_mode": { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "ログエントリが作成された Unix タイムスタンプです。" + "start_node_id": { + "type": "string" + } + }, + "required": [ + "datasource_info_list", + "datasource_type", + "inputs", + "is_published", + "response_mode", + "start_node_id" + ], + "type": "object" + }, + "PipelineRunJsonResponse": { + "anyOf": [ + { + "$ref": "#/components/schemas/PublishedPipelineRunResponse" }, - "details": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "ログエントリの追加詳細です。" + { + "$ref": "#/components/schemas/WorkflowBlockingResponse" } - } + ] }, - "WorkflowRunSummary": { - "type": "object", + "PipelineUploadFileResponse": { "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ワークフロー実行 ID です。" - }, - "version": { - "type": "string", - "description": "ワークフローバージョン識別子です。" - }, - "status": { - "type": "string", - "description": "ワークフローの実行ステータスです。`running` は実行中、`succeeded` は正常完了、`failed` は実行エラー、`stopped` は手動停止、`partial-succeeded` は一部のノードが成功し他が失敗、`paused` は人間の入力待ちを示します。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "ワークフローが失敗した場合のエラーメッセージです。" - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "合計経過時間(秒)です。" + "created_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "total_tokens": { - "type": "integer", - "description": "消費された合計トークン数です。" + "created_by": { + "type": "string" }, - "total_steps": { - "type": "integer", - "description": "実行されたワークフローの合計ステップ数です。" + "extension": { + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "ワークフロー実行が作成された Unix タイムスタンプです。" + "id": { + "type": "string" }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "ワークフロー実行が完了した Unix タイムスタンプです。" + "mime_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "exceptions_count": { - "type": "integer", - "description": "実行中に発生した例外の数です。" + "name": { + "type": "string" }, - "triggered_from": { - "type": "string", - "description": "ワークフロー実行をトリガーしたソースです。`app-run` はアプリまたは API からの実行、`webhook` は Webhook トリガーによる実行、`schedule` はスケジュールトリガーによる実行、`plugin` はインテグレーショントリガーによる実行を示します。" + "size": { + "type": "integer" } - } + }, + "required": [ + "created_by", + "extension", + "id", + "name", + "size" + ], + "type": "object" }, - "EndUserSummary": { - "type": "object", + "PreProcessingRule": { "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "エンドユーザー ID。" - }, - "type": { - "type": "string", - "description": "エンドユーザーの種類です。" - }, - "is_anonymous": { - "type": "boolean", - "description": "エンドユーザーが匿名かどうかです。" + "enabled": { + "description": "この前処理ルールが有効かどうかです。", + "type": "boolean" }, - "session_id": { - "type": "string", - "description": "セッション識別子です。" + "id": { + "description": "ルール識別子です。", + "enum": [ + "remove_extra_spaces", + "remove_stopwords", + "remove_urls_emails" + ], + "type": "string" } - } + }, + "required": [ + "enabled", + "id" + ], + "type": "object" }, - "HumanInputContent": { - "type": "object", - "description": "人間の入力ノードからの実行コンテンツです。フォーム定義と送信データを含みます。", + "ProcessRule": { "properties": { - "workflow_run_id": { - "type": "string", - "description": "このコンテンツが属するワークフロー実行の ID です。" - }, - "submitted": { - "type": "boolean", - "description": "人間の入力フォームが送信されたかどうかです。" - }, - "type": { - "type": "string", - "description": "`human_input` は人間の入力コンテンツを示します。" - }, - "form_definition": { - "nullable": true, - "description": "人間の入力ノードからのフォーム定義です。コンテンツが送信レスポンスを表す場合は `null` です。", - "$ref": "#/components/schemas/HumanInputFormDefinition" + "mode": { + "$ref": "#/components/schemas/ProcessRuleMode" }, - "form_submission_data": { - "nullable": true, - "description": "送信されたフォームデータです。フォームがまだ送信されていない場合は `null` です。", - "$ref": "#/components/schemas/HumanInputFormSubmissionData" + "rules": { + "anyOf": [ + { + "$ref": "#/components/schemas/Rule" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "mode" + ], + "type": "object" }, - "HumanInputFormDefinition": { - "type": "object", - "description": "人間の入力ノードによってレンダリングされる人間の入力フォームの定義です。", + "ProcessRuleMode": { + "enum": [ + "automatic", + "custom", + "hierarchical" + ], + "type": "string" + }, + "ProviderModelWithStatusEntity": { "properties": { - "form_id": { - "type": "string", - "description": "フォームの一意識別子です。" - }, - "node_id": { - "type": "string", - "description": "このフォームを生成した人間の入力ノードの ID です。" + "deprecated": { + "default": false, + "type": "boolean" }, - "node_title": { - "type": "string", - "description": "人間の入力ノードのタイトルです。" + "features": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ModelFeature" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null }, - "form_content": { - "type": "string", - "description": "フォームと共に表示される Markdown またはテキストコンテンツです。" + "fetch_from": { + "$ref": "#/components/schemas/FetchFrom" }, - "inputs": { - "type": "array", - "description": "フォーム内の入力フィールドです。", - "items": { - "$ref": "#/components/schemas/FormInput" - } + "has_invalid_load_balancing_configs": { + "default": false, + "type": "boolean" }, - "actions": { - "type": "array", - "description": "フォームで利用可能なアクションボタンです。", - "items": { - "$ref": "#/components/schemas/UserAction" - } + "label": { + "$ref": "#/components/schemas/I18nObject" }, - "display_in_ui": { - "type": "boolean", - "description": "フォームを UI に表示するかどうかです。" + "load_balancing_enabled": { + "default": false, + "type": "boolean" }, - "form_token": { - "type": "string", - "nullable": true, - "description": "フォーム送信認証用のトークンです。" + "model": { + "type": "string" }, - "resolved_default_values": { - "type": "object", + "model_properties": { "additionalProperties": true, - "description": "出力変数名をキーとする、フォーム入力の解決済みデフォルト値です。" + "propertyNames": { + "$ref": "#/components/schemas/ModelPropertyKey" + }, + "type": "object" }, - "expiration_time": { - "type": "integer", - "description": "フォームが期限切れになる Unix タイムスタンプです。" + "model_type": { + "$ref": "#/components/schemas/ModelType" + }, + "status": { + "$ref": "#/components/schemas/ModelStatus" } - } + }, + "required": [ + "fetch_from", + "label", + "model", + "model_properties", + "model_type", + "status" + ], + "type": "object" }, - "HumanInputFormSubmissionData": { - "type": "object", - "description": "送信された人間の入力フォームからのデータです。", + "ProviderWithModelsListResponse": { "properties": { - "node_id": { - "type": "string", - "description": "人間の入力ノードの ID です。" - }, - "node_title": { - "type": "string", - "description": "人間の入力ノードのタイトルです。" - }, - "rendered_content": { - "type": "string", - "description": "フォーム送信のレンダリングされた内容です。" - }, - "action_id": { - "type": "string", - "description": "クリックされたアクションボタンの ID です。" - }, - "action_text": { - "type": "string", - "description": "クリックされたアクションボタンの表示テキストです。" + "data": { + "items": { + "$ref": "#/components/schemas/ProviderWithModelsResponse" + }, + "type": "array" } - } + }, + "required": [ + "data" + ], + "type": "object" }, - "FormInput": { - "type": "object", - "description": "フォーム入力フィールドの定義です。", + "ProviderWithModelsResponse": { "properties": { - "type": { - "type": "string", - "description": "フォーム入力コントロールの種類。使用可能な値:`paragraph`(複数行テキスト)、`select`(リストからの単一選択)、`file`(単一ファイルのアップロード)、`file-list`(複数ファイルのアップロード)。" + "icon_small": { + "anyOf": [ + { + "$ref": "#/components/schemas/I18nObject" + }, + { + "type": "null" + } + ], + "default": null }, - "output_variable_name": { - "type": "string", - "description": "入力値が格納される変数名です。" + "icon_small_dark": { + "anyOf": [ + { + "$ref": "#/components/schemas/I18nObject" + }, + { + "type": "null" + } + ], + "default": null }, - "default": { - "nullable": true, - "description": "この入力のデフォルト値設定です。", - "$ref": "#/components/schemas/FormInputDefault" - } - } - }, - "FormInputDefault": { - "type": "object", - "description": "フォーム入力のデフォルト値設定です。", - "properties": { - "type": { - "type": "string", - "description": "`variable` はワークフロー変数からの動的な値、`constant` は静的な値です。" + "label": { + "$ref": "#/components/schemas/I18nObject" }, - "selector": { - "type": "array", + "models": { "items": { - "type": "string" + "$ref": "#/components/schemas/ProviderModelWithStatusEntity" }, - "description": "`type` が `variable` の場合の変数セレクターパスです。" + "type": "array" }, - "value": { - "type": "string", - "description": "`type` が `constant` の場合の静的値。" + "provider": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/CustomConfigurationStatus" + }, + "tenant_id": { + "type": "string" } - } + }, + "required": [ + "label", + "models", + "provider", + "status", + "tenant_id" + ], + "type": "object" }, - "UserAction": { - "type": "object", - "description": "人間の入力フォーム上のアクションボタンです。", + "PublishedPipelineRunResponse": { "properties": { - "id": { - "type": "string", - "description": "アクションの一意識別子です。" + "batch": { + "type": "string" }, - "title": { - "type": "string", - "description": "ボタンの表示テキストです。" + "dataset": { + "$ref": "#/components/schemas/PipelineDataset" }, - "button_style": { - "type": "string", - "description": "`primary`, `default`, `accent`, or `ghost`." + "documents": { + "items": { + "$ref": "#/components/schemas/PipelineDocument" + }, + "type": "array" } - } + }, + "required": [ + "batch", + "dataset", + "documents" + ], + "type": "object" }, - "WorkflowExecutionRequest": { - "type": "object", + "RequiredServiceApiUserPayload": { + "properties": { + "user": { + "type": "string" + } + }, "required": [ - "inputs", "user" ], + "type": "object" + }, + "RerankingModel": { "properties": { - "inputs": { - "type": "object", - "description": "ワークフロー入力変数のキーと値のペアです。アプリが期待する変数名と型は、[アプリケーションのパラメータ情報を取得](/ja/api-reference/applications/get-app-parameters) の `user_input_form` フィールドで確認できます。\n\nファイル型の変数には、`type`、`transfer_method`、および `url` または `upload_file_id` を持つファイルオブジェクトの配列を渡します。", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "object" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/InputFileObject" - } - } - ] - } - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" + "reranking_model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], - "description": "レスポンスモードです。同期レスポンスには `blocking`(Cloudflare タイムアウトは `100 s`)、サーバー送信イベントには `streaming` を使用します。省略した場合、デフォルトはブロッキング動作になります。" - }, - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。データアクセスをスコープします。ワークフロー実行とそのファイルは、同じ `user` を持つ後続のリクエストにのみ表示されます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" + "default": null, + "description": "リランキングモデル名です。" }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/InputFileObject" - }, - "nullable": true, - "description": "ファイルリストです。ファイルとテキストを組み合わせて入力する場合に適しており、モデルが Vision 機能をサポートしている場合にのみ使用できます。ローカルファイルを添付するには、まず [ファイルをアップロード](/ja/api-reference/files/upload-file) でアップロードし、返された `id` を `upload_file_id` として `transfer_method: local_file` で使用します。" + "reranking_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "type": "object" }, - "InputFileObject": { - "type": "object", + "ResultResponse": { + "properties": { + "result": { + "type": "string" + } + }, "required": [ - "type", - "transfer_method" + "result" + ], + "type": "object" + }, + "RetrievalMethod": { + "enum": [ + "full_text_search", + "hybrid_search", + "keyword_search", + "semantic_search" ], + "type": "string" + }, + "Rule": { "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "document", - "audio", - "video", - "custom" + "parent_mode": { + "anyOf": [ + { + "enum": [ + "full-doc", + "paragraph" + ], + "type": "string" + }, + { + "type": "null" + } ], - "description": "ファイルタイプ。" + "default": null }, - "transfer_method": { - "type": "string", - "enum": [ - "remote_url", - "local_file" + "pre_processing_rules": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/PreProcessingRule" + }, + "type": "array" + }, + { + "type": "null" + } ], - "description": "転送方法です。ファイル URL の場合は `remote_url`、アップロードファイルの場合は `local_file` です。" + "default": null }, - "url": { - "type": "string", - "format": "url", - "description": "ファイル URL(`transfer_method` が `remote_url` の場合)です。" + "segmentation": { + "anyOf": [ + { + "$ref": "#/components/schemas/Segmentation" + }, + { + "type": "null" + } + ], + "default": null }, - "upload_file_id": { - "type": "string", - "description": "事前に [ファイルをアップロード](/ja/api-reference/files/upload-file) API でアップロードして取得したファイル ID です(`transfer_method` が `local_file` の場合に使用)。" + "subchunk_segmentation": { + "anyOf": [ + { + "$ref": "#/components/schemas/Segmentation" + }, + { + "type": "null" + } + ], + "default": null } }, - "anyOf": [ - { - "properties": { - "transfer_method": { - "enum": [ - "remote_url" - ] + "type": "object" + }, + "SegmentAttachmentResponse": { + "properties": { + "extension": { + "type": "string" + }, + "id": { + "type": "string" + }, + "mime_type": { + "anyOf": [ + { + "type": "string" }, - "url": { - "type": "string", - "format": "url" + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "source_url": { + "type": "string" + } + }, + "required": [ + "extension", + "id", + "mime_type", + "name", + "size", + "source_url" + ], + "type": "object" + }, + "SegmentCreateItemPayload": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - }, - "required": [ - "url" ], - "not": { - "required": [ - "upload_file_id" - ] - } + "default": null }, - { - "properties": { - "transfer_method": { - "enum": [ - "local_file" - ] + "attachment_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" }, - "upload_file_id": { - "type": "string" + { + "type": "null" } - }, - "required": [ - "upload_file_id" ], - "not": { - "required": [ - "url" - ] - } + "default": null, + "description": "添付ファイル ID です。" + }, + "content": { + "description": "チャンクのテキスト内容です。", + "minLength": 1, + "type": "string" + }, + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "チャンクのキーワードです。" } - ] + }, + "required": [ + "content" + ], + "type": "object" }, - "WorkflowBlockingResponse": { - "type": "object", + "SegmentCreateListResponse": { "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "進行中の実行のタスク ID です。[ワークフロータスクを停止](/ja/api-reference/workflow-runs/stop-workflow-task) と組み合わせて、実行中のワークフローをキャンセルします。実行中のみ有効です。" - }, - "workflow_run_id": { - "type": "string", - "format": "uuid", - "description": "このワークフロー実行記録の永続的な識別子です。[ワークフロー実行詳細を取得](/ja/api-reference/workflow-runs/get-workflow-run-detail) と組み合わせて、実行後に結果を取得します。" - }, "data": { - "$ref": "#/components/schemas/WorkflowFinishedData" + "items": { + "$ref": "#/components/schemas/SegmentResponse" + }, + "type": "array" + }, + "doc_form": { + "type": "string" } - } - }, - "ChunkWorkflowEvent": { - "type": "object", + }, "required": [ - "event" + "data", + "doc_form" ], + "type": "object" + }, + "SegmentCreatePayload": { "properties": { - "event": { - "type": "string", - "enum": [ - "workflow_started", - "node_started", - "node_finished", - "node_retry", - "iteration_started", - "iteration_next", - "iteration_completed", - "loop_started", - "loop_next", - "loop_completed", - "reasoning_chunk", - "text_chunk", - "workflow_finished", - "tts_message", - "tts_message_end", - "workflow_paused", - "agent_log", - "human_input_required", - "human_input_form_filled", - "human_input_form_timeout", - "error", - "ping" - ], - "description": "ストリーミングイベントの種類。" + "segments": { + "description": "作成するチャンクオブジェクトの配列です。", + "items": { + "$ref": "#/components/schemas/SegmentCreateItemPayload" + }, + "minItems": 1, + "type": "array" } }, - "discriminator": { - "propertyName": "event", - "mapping": { - "workflow_started": "#/components/schemas/WorkflowStreamEventWorkflowStarted", - "node_started": "#/components/schemas/WorkflowStreamEventNodeStarted", - "node_finished": "#/components/schemas/WorkflowStreamEventNodeFinished", - "node_retry": "#/components/schemas/WorkflowStreamEventNodeRetry", - "iteration_started": "#/components/schemas/WorkflowStreamEventIterationStarted", - "iteration_next": "#/components/schemas/WorkflowStreamEventIterationNext", - "iteration_completed": "#/components/schemas/WorkflowStreamEventIterationCompleted", - "loop_started": "#/components/schemas/WorkflowStreamEventLoopStarted", - "loop_next": "#/components/schemas/WorkflowStreamEventLoopNext", - "loop_completed": "#/components/schemas/WorkflowStreamEventLoopCompleted", - "reasoning_chunk": "#/components/schemas/StreamEventReasoningChunk", - "text_chunk": "#/components/schemas/StreamEventTextChunk", - "workflow_finished": "#/components/schemas/WorkflowStreamEventWorkflowFinished", - "tts_message": "#/components/schemas/StreamEventTtsMessage", - "tts_message_end": "#/components/schemas/StreamEventTtsMessageEnd", - "error": "#/components/schemas/StreamEventError", - "ping": "#/components/schemas/StreamEventPing", - "workflow_paused": "#/components/schemas/WorkflowStreamEventWorkflowPaused", - "agent_log": "#/components/schemas/WorkflowStreamEventAgentLog", - "human_input_required": "#/components/schemas/WorkflowStreamEventHumanInputRequired", - "human_input_form_filled": "#/components/schemas/WorkflowStreamEventHumanInputFormFilled", - "human_input_form_timeout": "#/components/schemas/WorkflowStreamEventHumanInputFormTimeout" + "required": [ + "segments" + ], + "type": "object" + }, + "SegmentDetailResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/SegmentResponse" + }, + "doc_form": { + "type": "string" } - } + }, + "required": [ + "data", + "doc_form" + ], + "type": "object" }, - "StreamEventReasoningChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentListQuery": { + "properties": { + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "検索キーワードです。" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "limit": { + "default": 20, + "description": "1 ページあたりの項目数です。サーバーの上限は `100` です。", + "minimum": 1, + "type": "integer" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "reasoning": { - "type": "string", - "description": "`reasoning_format` が `separated` の LLM ノードが発行する思考過程のデルタです。連続する `reasoning_chunk` イベントを連結すると、完全な推論を復元できます。このストリームは `text_chunk` と並行しており、`text` ストリームには `` タグが含まれません。" - }, - "node_id": { - "type": "string", - "nullable": true, - "description": "推論を生成している LLM ノードの ID です。複数の LLM ノードが実行される場合に、推論の出所を特定できます。" - }, - "is_final": { - "type": "boolean", - "description": "`true` は LLM ノードの推論フェーズの終了(「思考完了」のシグナル)を示します。空の `reasoning` を伴う場合があります。" - } - } - } - } + "page": { + "default": 1, + "minimum": 1, + "type": "integer" + }, + "status": { + "items": { + "type": "string" + }, + "type": "array" } - ] + }, + "type": "object" }, - "StreamEventTextChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/SegmentResponse" + }, + "type": "array" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "doc_form": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "テキスト内容のチャンクです。" - }, - "from_variable_selector": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true, - "description": "ワークフロー内のテキスト変数のソースパスです。" - } - } - } - } + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "total": { + "type": "integer" } - ] + }, + "required": [ + "data", + "doc_form", + "has_more", + "limit", + "page", + "total" + ], + "type": "object" }, - "StreamEventTtsMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentResponse": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "attachments": { + "items": { + "$ref": "#/components/schemas/SegmentAttachmentResponse" + }, + "type": "array" }, - { - "type": "object", - "properties": { - "audio": { - "type": "string", - "format": "byte", - "description": "Base64 エンコードされた MP3 音声チャンク。すべてのチャンクを順番にデコードして連結すると、完全な音声ファイルが生成されます。" + "child_chunks": { + "items": { + "$ref": "#/components/schemas/ChildChunkResponse" + }, + "type": "array" + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "このオーディオチャンクが生成された Unix タイムスタンプです。" + { + "type": "null" } - } - } - ] - }, - "StreamEventTtsMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ] }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "content": { + "type": "string" }, - { - "type": "object", - "properties": { - "audio": { - "type": "string", - "description": "空の文字列。音声ストリームの終了を示します。" + "created_at": { + "type": "integer" + }, + "created_by": { + "type": "string" + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "音声ストリームが終了した Unix タイムスタンプです。" + { + "type": "null" } - } - } - ] - }, - "StreamEventError": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" - }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + ] }, - { - "type": "object", - "properties": { - "status": { - "type": "integer", - "description": "エラーの HTTP ステータスコードです。" + "disabled_by": { + "anyOf": [ + { + "type": "string" }, - "code": { - "type": "string", - "description": "エラーコード。" + { + "type": "null" + } + ] + }, + "document_id": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "error": { + "anyOf": [ + { + "type": "string" }, - "message": { - "type": "string", - "description": "エラーメッセージ。" + { + "type": "null" } - } - } - ] - }, - "StreamEventPing": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ] + }, + "hit_count": { + "type": "integer" }, - { - "type": "object", - "description": "キープアライブ ping イベントです。`event: ping` 行として送信され、`data:` ペイロードはありません。ストリームの最初のイベントは `ping` です。" - } - ] - }, - "WorkflowFinishedData": { - "type": "object", - "properties": { "id": { - "type": "string", - "format": "uuid", - "description": "ワークフロー実行 ID です。" + "type": "string" }, - "workflow_id": { - "type": "string", - "format": "uuid", - "description": "Workflow ID." + "index_node_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "status": { - "type": "string", - "description": "ワークフローの実行ステータスです。`running` は実行中、`succeeded` は正常完了、`failed` は実行エラー、`stopped` は手動停止、`partial-succeeded` は一部のノードが成功し他が失敗、`paused` は人間の入力待ちを示します。" + "index_node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "ワークフローからの出力データです。" + "indexing_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] }, - "error": { - "type": "string", - "nullable": true, - "description": "ワークフローが失敗した場合のエラーメッセージです。" + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "合計経過時間(秒)です。" + "position": { + "type": "integer" }, - "total_tokens": { - "type": "integer", - "description": "全ノードで消費された合計トークン数です。" + "sign_content": { + "type": "string" }, - "total_steps": { - "type": "integer", - "description": "実行されたワークフローの合計ステップ数です。" + "status": { + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "ワークフロー実行が作成された Unix タイムスタンプです。" + "stopped_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "ワークフロー実行が完了した Unix タイムスタンプです。" + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "created_by": { - "type": "object", - "additionalProperties": true, - "description": "作成者情報です。ストリーミングの `workflow_finished` イベントにのみ存在します。" + "tokens": { + "type": "integer" }, - "exceptions_count": { - "type": "integer", - "nullable": true, - "description": "実行中に発生した例外の数です。ストリーミングの `workflow_finished` イベントにのみ含まれます。" + "updated_at": { + "type": "integer" }, - "files": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "nullable": true, - "description": "ワークフロー実行中に生成されたファイルです。ストリーミングの `workflow_finished` イベントにのみ存在します。" - } - } - }, - "WorkflowStreamEventBase": { - "type": "object", - "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "進行中の実行のタスク ID です。[ワークフロータスクを停止](/ja/api-reference/workflow-runs/stop-workflow-task) と組み合わせて、実行中のワークフローをキャンセルします。実行中のみ有効です。" + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "workflow_run_id": { - "type": "string", - "format": "uuid", - "description": "このワークフロー実行記録の永続的な識別子です。[ワークフロー実行詳細を取得](/ja/api-reference/workflow-runs/get-workflow-run-detail) と組み合わせて、実行後に結果を取得します。" + "word_count": { + "type": "integer" } - } + }, + "required": [ + "answer", + "attachments", + "child_chunks", + "completed_at", + "content", + "created_at", + "created_by", + "disabled_at", + "disabled_by", + "document_id", + "enabled", + "error", + "hit_count", + "id", + "index_node_hash", + "index_node_id", + "indexing_at", + "keywords", + "position", + "sign_content", + "status", + "stopped_at", + "summary", + "tokens", + "updated_at", + "updated_by", + "word_count" + ], + "type": "object" }, - "WorkflowStreamEventWorkflowStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentUpdateArgs": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "attachment_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "添付ファイル ID です。" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ワークフロー実行 ID です。" - }, - "workflow_id": { - "type": "string", - "format": "uuid", - "description": "Workflow ID." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "このワークフロー実行の入力変数です。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "ワークフロー実行が開始した Unix タイムスタンプです。" - }, - "reason": { - "type": "string", - "description": "ワークフロー開始の理由です。`initial` は新規実行、`resumption` は一時停止状態からの再開を示します。" - } - } + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventWorkflowFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "チャンクが有効かどうかです。" }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/WorkflowFinishedData" + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventNodeStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "regenerate_child_chunks": { + "default": false, + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ノード実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "ワークフローグラフ内のノード ID です。" - }, - "node_type": { - "type": "string", - "description": "ノードタイプ(例:`llm`、`code`、`template-transform`)です。" - }, - "title": { - "type": "string", - "description": "ノードの表示名です。" - }, - "index": { - "type": "integer", - "description": "実行シーケンスインデックスです。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "先行ノードの ID(存在する場合)です。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "このノードの入力変数です。" - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` データが切り捨てられたかどうかです。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "ノード実行が開始した Unix タイムスタンプです。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "ノード実行の追加メタデータです。" - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "このノードがイテレーション内で実行される場合の親イテレーション ID です。" - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "このノードがループ内で実行される場合の親ループ ID です。" - } - } + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "description": "サマリーインデックスのサマリー内容です。" } - ] + }, + "type": "object" }, - "WorkflowStreamEventNodeFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentUpdatePayload": { + "properties": { + "segment": { + "$ref": "#/components/schemas/SegmentUpdateArgs" + } + }, + "required": [ + "segment" + ], + "type": "object" + }, + "Segmentation": { + "properties": { + "chunk_overlap": { + "default": 0, + "description": "チャンク間のトークンオーバーラップです。", + "type": "integer" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "max_tokens": { + "description": "チャンクあたりの最大トークン数です。", + "type": "integer" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ノード実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "ワークフローグラフ内のノード ID です。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "ノードの表示名です。" - }, - "index": { - "type": "integer", - "description": "実行シーケンスインデックスです。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "先行ノードの ID(存在する場合)です。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "このノードの入力変数です。" - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` データが切り捨てられたかどうかです。" - }, - "process_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "ノード実行中に生成された処理データです。" - }, - "process_data_truncated": { - "type": "boolean", - "description": "`process_data` が切り詰められたかどうかです。" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "ノードからの出力データです。" - }, - "outputs_truncated": { - "type": "boolean", - "description": "`outputs` データが切り詰められたかどうかです。" - }, - "status": { - "type": "string", - "description": "ノードの実行ステータスです。`running` は進行中、`succeeded` は完了、`failed` はエラー、`stopped` は手動停止、`exception` は予期しない障害を示します。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "ノードが失敗した場合のエラーメッセージです。" - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "経過時間(秒)です。" - }, - "execution_metadata": { - "type": "object", - "nullable": true, - "description": "トークン使用量を含む実行メタデータです。", - "properties": { - "total_tokens": { - "type": "integer", - "nullable": true, - "description": "このノードで消費された合計トークン数です。" - }, - "total_price": { - "type": "number", - "format": "float", - "nullable": true, - "description": "このノード実行の合計コストです。" - }, - "currency": { - "type": "string", - "nullable": true, - "description": "コストの通貨(例: `USD`)です。" - } - } - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "ノード実行が開始した Unix タイムスタンプです。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "ノード実行が完了した Unix タイムスタンプです。" - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "このノードで生成されたファイルです。" - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "このノードがイテレーション内で実行される場合の親イテレーション ID です。" - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "このノードがループ内で実行される場合の親ループ ID です。" - } - } - } - } + "separator": { + "default": "\n", + "description": "テキスト分割用のカスタムセパレーターです。", + "type": "string" } - ] + }, + "required": [ + "max_tokens" + ], + "type": "object" }, - "WorkflowStreamEventNodeRetry": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SelectInputConfig": { + "properties": { + "option_source": { + "$ref": "#/components/schemas/StringListSource" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "output_variable_name": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ノード実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "ワークフローグラフ内のノード ID です。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "ノードの表示名です。" - }, - "index": { - "type": "integer", - "description": "実行シーケンスインデックスです。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "先行ノードの ID(存在する場合)です。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` データが切り捨てられたかどうかです。" - }, - "process_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "ノード実行中に生成された処理データです。" - }, - "process_data_truncated": { - "type": "boolean", - "description": "`process_data` が切り詰められたかどうかです。" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "outputs_truncated": { - "type": "boolean", - "description": "`outputs` データが切り詰められたかどうかです。" - }, - "status": { - "type": "string", - "description": "リトライ時点のノード実行ステータスです。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "リトライをトリガーしたエラーメッセージです。" - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "経過時間(秒)です。" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "finished_at": { - "type": "integer", - "format": "int64" - }, - "retry_index": { - "type": "integer", - "description": "ゼロ始まりのリトライ回数インデックスです。" - }, - "iteration_id": { - "type": "string", - "nullable": true - }, - "loop_id": { - "type": "string", - "nullable": true - }, - "execution_metadata": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "ノード実行のメタデータです。" - }, - "files": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "実行中にノードが生成したファイルです。" - } - } - } - } + "type": { + "const": "select", + "default": "select", + "type": "string" } - ] + }, + "required": [ + "option_source", + "output_variable_name" + ], + "type": "object" }, - "WorkflowStreamEventIterationStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SimpleAccountResponse": { + "properties": { + "email": { + "type": "string" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "id": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ノード実行 ID です。" - }, - "node_id": { - "type": "string", - "description": "イテレーションノード ID です。" - }, - "node_type": { - "type": "string", - "description": "ノードの種類(常に `iteration`)です。" - }, - "title": { - "type": "string", - "description": "イテレーションノードの表示名です。" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "イテレーションの入力変数です。" - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` データが切り捨てられたかどうかです。" - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "イテレーションのメタデータです。" - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } - } - } + "name": { + "type": "string" } - ] + }, + "required": [ + "email", + "id", + "name" + ], + "type": "object" }, - "WorkflowStreamEventIterationNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SimpleConversation": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "id": { + "format": "uuid", + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "index": { - "type": "integer", - "description": "現在のイテレーションインデックス(ゼロ始まり)です。" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JSONValue" + }, + "type": "object" + }, + "introduction": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventIterationCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "name": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "outputs_truncated": { - "type": "boolean", - "description": "`outputs` データが切り詰められたかどうかです。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "イテレーションの入力変数です。" - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` データが切り捨てられたかどうかです。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "イテレーションが開始した Unix タイムスタンプです。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "イテレーションの追加メタデータです。" - }, - "status": { - "type": "string", - "description": "イテレーションの完了ステータスです。" - }, - "error": { - "type": "string", - "nullable": true - }, - "elapsed_time": { - "type": "number", - "format": "float" - }, - "total_tokens": { - "type": "integer" - }, - "execution_metadata": { - "type": "object", - "additionalProperties": true, - "description": "トークン使用量を含む実行メタデータです。" - }, - "finished_at": { - "type": "integer", - "format": "int64" - }, - "steps": { - "type": "integer", - "description": "完了したイテレーションステップ数です。" - } - } + "status": { + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" } - } + ], + "default": null } - ] + }, + "required": [ + "id", + "inputs", + "name", + "status" + ], + "type": "object" }, - "WorkflowStreamEventLoopStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SimpleEndUser": { + "properties": { + "id": { + "type": "string" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "is_anonymous": { + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "inputs": { - "type": "object", - "additionalProperties": true - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` データが切り捨てられたかどうかです。" - }, - "metadata": { - "type": "object", - "additionalProperties": true - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } + "session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "is_anonymous", + "type" + ], + "type": "object" + }, + "SimpleFeedback": { + "properties": { + "rating": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null } - ] + }, + "type": "object" }, - "WorkflowStreamEventLoopNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" - }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "SimpleResultResponse": { + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ], + "type": "object" + }, + "SimpleResultStringListResponse": { + "properties": { + "data": { + "items": { + "type": "string" + }, + "type": "array" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "index": { - "type": "integer", - "description": "現在のループイテレーションインデックス(ゼロベース)です。" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "pre_loop_output": { - "description": "前回のループイテレーションからの出力です。", - "nullable": true - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } - } - } + "result": { + "type": "string" } - ] + }, + "required": [ + "data", + "result" + ], + "type": "object" }, - "WorkflowStreamEventLoopCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "Site": { + "properties": { + "chat_color_theme": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "chat_color_theme_inverted": { + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "outputs_truncated": { - "type": "boolean", - "description": "`outputs` データが切り詰められたかどうかです。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "ループの入力変数です。" - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` データが切り捨てられたかどうかです。" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "ループの追加メタデータです。" - }, - "status": { - "type": "string", - "description": "ループの完了ステータスです。" - }, - "error": { - "type": "string", - "nullable": true - }, - "elapsed_time": { - "type": "number", - "format": "float" - }, - "total_tokens": { - "type": "integer" - }, - "execution_metadata": { - "type": "object", - "additionalProperties": true, - "description": "トークン使用量を含む実行メタデータです。" - }, - "finished_at": { - "type": "integer", - "format": "int64" - }, - "steps": { - "type": "integer", - "description": "完了したループイテレーション数です。" - } - } + "copyright": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventHumanInputRequired": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "custom_disclaimer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "form_id": { - "type": "string", - "description": "フォームインスタンスの識別子。エラーメッセージやログに含まれます。Service API の呼び出しには `form_token` を使用してください。" - }, - "node_id": { - "type": "string", - "description": "このフォームを生成した Human Input ノードの ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input ノードの表示タイトル。" - }, - "form_content": { - "type": "string", - "description": "ワークフロー変数が置換された、事前レンダリング済みのフォーム本文。" - }, - "inputs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "フォーム入力コントロールの種類。使用可能な値:`paragraph`(複数行テキスト)、`select`(リストからの単一選択)、`file`(単一ファイルのアップロード)、`file-list`(複数ファイルのアップロード)。" - }, - "output_variable_name": { - "type": "string", - "description": "この入力の送信値をワークフロー内で参照する変数名。送信時の `inputs` オブジェクトのキーに対応します。" - }, - "default": { - "type": "object", - "nullable": true, - "description": "ワークフローコンテキストから解決されるデフォルト値。デフォルトが設定されていない場合は `null`。", - "properties": { - "type": { - "type": "string", - "description": "デフォルト値のソース。`constant` は `value` をリテラル文字列として使用します。`variable` は `selector` がワークフロー変数を指します。" - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "`type` が `variable` の場合の変数参照パス(例:`[\"node_id\", \"var_name\"]`)。少なくとも 2 要素を含みます。" - }, - "value": { - "type": "string", - "description": "`type` が `constant` の場合のリテラルデフォルト値。常に文字列です。" - } - } - } - } - }, - "description": "受信者が記入するフォーム入力フィールド。" - }, - "actions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "maxLength": 20, - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "アクションボタンの識別子。受信者がこのボタンを選択したら、`action` として [人間の入力フォームを送信](/ja/api-reference/human-input/submit-human-input-form) に渡します。" - }, - "title": { - "type": "string", - "maxLength": 100, - "description": "受信者に表示されるボタンのラベル。" - }, - "button_style": { - "type": "string", - "description": "ボタンの視覚スタイル。使用可能な値:`primary`、`default`、`accent`、`ghost`。" - } - } - }, - "description": "送信時に受信者が選択できるアクション(ボタン)。" - }, - "display_in_ui": { - "type": "boolean", - "description": "フォームが Dify コンソール UI にも表示されるかどうか。" - }, - "form_token": { - "type": "string", - "nullable": true, - "description": "[人間の入力フォームを取得](/ja/api-reference/human-input/get-human-input-form) と [人間の入力フォームを送信](/ja/api-reference/human-input/submit-human-input-form) のアクセストークン。人間の入力ノードがメール配信またはコンソール配信を使用する場合は `null` になります(Service API は Web アプリ配信のフォームのみ操作できます)。" - }, - "resolved_default_values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "入力の `output_variable_name` をキーとする事前入力デフォルト値。すべての値は文字列化されます。" - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix タイムスタンプ(秒)。これを過ぎるとフォームは送信できなくなります。" - } - } + "default_language": { + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventWorkflowPaused": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "format": "uuid", - "description": "このワークフロー実行記録の永続的な識別子です。[ワークフロー実行詳細を取得](/ja/api-reference/workflow-runs/get-workflow-run-detail) と組み合わせて、実行後に結果を取得します。" - }, - "paused_nodes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "一時停止中のノード ID のリストです。" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "description": "一時停止時の部分的な出力です。" - }, - "reasons": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "一時停止の理由です。" - }, - "status": { - "type": "string", - "description": "ワークフローの実行ステータスです。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "作成タイムスタンプ。" - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "合計経過時間(秒)です。" - }, - "total_tokens": { - "type": "integer", - "description": "消費された合計トークン数です。" - }, - "total_steps": { - "type": "integer", - "description": "実行された合計ステップ数です。" - } - } + "icon_background": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventHumanInputFormFilled": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "icon_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "フォームが記入された Human Input ノードの ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input ノードの表示タイトル。" - }, - "rendered_content": { - "type": "string", - "description": "受信者の入力値で描画されたフォーム本文(`human_input_required` の `form_content` は未入力のテンプレートです)。" - }, - "action_id": { - "type": "string", - "description": "受信者が選択したアクションの識別子([人間の入力フォームを送信](/ja/api-reference/human-input/submit-human-input-form) に渡された `action` の値と一致します)。" - }, - "action_text": { - "type": "string", - "description": "選択されたアクションの表示テキスト。" - }, - "submitted_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "受信者が送信したフォームの値。各入力項目の `output_variable_name` をキーとします。" - } - } + "icon_url": { + "anyOf": [ + { + "format": "url", + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventHumanInputFormTimeout": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "readOnly": true }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "input_placeholder": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "フォームが期限切れとなった Human Input ノードの ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input ノードの表示タイトル。" - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix タイムスタンプ(秒)。フォームが期限切れとなった時刻。" - } - } + "privacy_policy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventAgentLog": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "show_workflow_steps": { + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "node_execution_id": { - "type": "string", - "description": "ノード実行 ID です。" - }, - "id": { - "type": "string", - "description": "エージェントログエントリ ID です。" - }, - "label": { - "type": "string", - "description": "Log label." - }, - "parent_id": { - "type": "string", - "nullable": true, - "description": "親ログエントリ ID です。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "エージェントステップが失敗した場合のエラーメッセージです。" - }, - "status": { - "type": "string", - "description": "エージェントステップのステータスです。" - }, - "data": { - "type": "object", - "additionalProperties": true, - "description": "エージェントステップのデータです。" - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "エージェントステップのメタデータです。" - }, - "node_id": { - "type": "string", - "description": "Node ID." - } - } - } - } + "title": { + "type": "string" + }, + "use_icon_as_answer_icon": { + "type": "boolean" } - ] - }, - "CompletionRequest": { - "type": "object", + }, "required": [ - "inputs", - "user" + "chat_color_theme_inverted", + "default_language", + "icon_url", + "show_workflow_steps", + "title", + "use_icon_as_answer_icon" ], + "type": "object" + }, + "StringListSource": { "properties": { - "inputs": { - "type": "object", - "description": "アプリの入力変数の値を、変数名をキーとして指定します。期待される名前と型は、[アプリケーションのパラメータ情報を取得](/ja/api-reference/applications/get-app-parameters) の `user_input_form` フィールドで確認できます。", - "additionalProperties": true - }, - "query": { - "type": "string", - "default": "", - "description": "処理するテキストです。レガシーフィールドで、新しいアプリではこの値を `inputs` の中で渡します。" - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" - ], - "description": "レスポンスの返却モード。`streaming`(推奨)は SSE を使用します。`blocking` は完了後に返却します(長時間の処理では中断される場合があります)。Cloudflare のタイムアウトは `100 s` です。省略した場合、デフォルトでブロッキングモードになります。" + "selector": { + "items": { + "type": "string" + }, + "type": "array" }, - "user": { - "type": "string", - "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。メッセージとファイルは、同じ `user` を持つリクエストにのみ表示されます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" + "type": { + "$ref": "#/components/schemas/ValueSourceType" }, - "files": { - "type": "array", + "value": { "items": { - "$ref": "#/components/schemas/InputFileObject" + "type": "string" }, - "description": "リクエストに添付するファイルです。ローカルファイルの場合は、まず [ファイルをアップロード](/ja/api-reference/files/upload-file) でアップロードし、返された `id` を `upload_file_id` として `transfer_method: local_file` で参照します。" + "type": "array" } - } + }, + "required": [ + "type" + ], + "type": "object" }, - "CompletionResponse": { - "type": "object", + "StringSource": { "properties": { - "event": { - "type": "string", - "description": "イベントタイプ。`message` に固定されています。" + "selector": { + "items": { + "type": "string" + }, + "type": "array" }, - "task_id": { - "type": "string", - "format": "uuid", - "description": "リクエスト追跡および [生成を停止](/ja/api-reference/completion-messages/stop-completion-message-generation) API 用のタスク ID です。" + "type": { + "$ref": "#/components/schemas/ValueSourceType" }, - "id": { - "type": "string", - "format": "uuid", - "description": "このレスポンスイベントの一意 ID です。" + "value": { + "default": "", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "SystemParameters": { + "properties": { + "audio_file_size_limit": { + "type": "integer" }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "一意のメッセージ ID です。フィードバックや推奨質問のエンドポイントを呼び出す際に `message_id` パラメータとして使用します。" + "file_size_limit": { + "type": "integer" }, - "mode": { - "type": "string", - "description": "アプリモード、`completion` 固定です。" + "image_file_size_limit": { + "type": "integer" }, - "answer": { - "type": "string", - "description": "完全なレスポンスコンテンツ。" + "video_file_size_limit": { + "type": "integer" }, - "metadata": { - "type": "object", - "description": "使用量と検索リソースを含むメタデータ。", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" - }, - "retriever_resources": { - "type": "array", - "description": "使用された検索リソースのリスト。", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } - } - } + "workflow_file_upload_limit": { + "type": "integer" + } + }, + "required": [ + "audio_file_size_limit", + "file_size_limit", + "image_file_size_limit", + "video_file_size_limit", + "workflow_file_upload_limit" + ], + "type": "object" + }, + "TagBindingPayload": { + "properties": { + "tag_ids": { + "items": { + "type": "string" + }, + "minItems": 1, + "type": "array" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "メッセージ作成タイムスタンプ(Unix エポック秒)。" + "target_id": { + "type": "string" } - } + }, + "required": [ + "tag_ids", + "target_id" + ], + "type": "object" }, - "ChunkCompletionEvent": { - "type": "object", + "TagCreatePayload": { "properties": { - "event": { - "type": "string", - "enum": [ - "message", - "message_end", - "message_file", - "tts_message", - "tts_message_end", - "message_replace", - "error", - "ping" - ], - "description": "ストリーミングイベントのタイプ。" + "name": { + "description": "Tag name.", + "maxLength": 50, + "minLength": 1, + "type": "string" } }, - "discriminator": { - "propertyName": "event", - "mapping": { - "message": "#/components/schemas/StreamEventMessage", - "message_end": "#/components/schemas/StreamEventMessageEnd", - "message_file": "#/components/schemas/StreamEventMessageFile", - "tts_message": "#/components/schemas/CompletionStreamEventTtsMessage", - "tts_message_end": "#/components/schemas/CompletionStreamEventTtsMessageEnd", - "message_replace": "#/components/schemas/StreamEventMessageReplace", - "error": "#/components/schemas/CompletionStreamEventError", - "ping": "#/components/schemas/CompletionStreamEventPing" + "required": [ + "name" + ], + "type": "object" + }, + "TagDeletePayload": { + "properties": { + "tag_id": { + "type": "string" } - } + }, + "required": [ + "tag_id" + ], + "type": "object" }, - "StreamEventMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" - }, + "TagUnbindingPayload": { + "anyOf": [ { - "type": "object", - "description": "LLM がテキストチャンクイベントを返します。", "properties": { - "answer": { - "type": "string", - "description": "LLM が返したテキストチャンクのコンテンツ。" + "tag_id": { + "deprecated": true, + "type": "string" + }, + "tag_ids": { + "items": { + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "target_id": { + "type": "string" } - } - } - ] - }, - "StreamEventMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + }, + "required": [ + "tag_id", + "target_id" + ], + "type": "object" }, { - "type": "object", - "description": "メッセージ終了イベント。このイベントを受信すると、ストリーミングが終了したことを意味します。", "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "メッセージの一意な ID。" - }, - "metadata": { - "type": "object", - "description": "使用量と検索リソースを含むメタデータ。", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" + "tag_id": { + "anyOf": [ + { + "type": "string" }, - "retriever_resources": { - "type": "array", - "description": "使用された検索リソースのリスト。", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } + { + "type": "null" } - } + ], + "deprecated": true }, - "files": { - "type": "array", - "nullable": true, - "description": "このメッセージで生成されたファイル(モデルが生成した画像など)。ファイルが生成されなかった場合は `null` です。", + "tag_ids": { "items": { - "type": "object", - "properties": { - "related_id": { - "type": "string", - "description": "メッセージファイルレコードの ID。" - }, - "type": { - "type": "string", - "description": "ファイルタイプ(例:`image`)。" - }, - "filename": { - "type": "string", - "description": "ファイル名。" - }, - "extension": { - "type": "string", - "description": "先頭のドットを含むファイル拡張子(例:`.png`)。" - }, - "mime_type": { - "type": "string", - "description": "ファイルの MIME タイプ。" - }, - "size": { - "type": "integer", - "description": "ファイルサイズ(バイト単位)。" - }, - "transfer_method": { - "type": "string", - "description": "ファイルの参照方法:`remote_url`、`local_file`、`tool_file` のいずれか。" - }, - "url": { - "type": "string", - "description": "ファイルのアクセス可能な URL。" - }, - "upload_file_id": { - "type": "string", - "description": "関連するアップロードファイルの ID。" - }, - "remote_url": { - "type": "string", - "nullable": true, - "description": "ファイルがリモート URL として提供された場合の元のリモート URL。それ以外の場合は空文字列。" - } - } - } + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "target_id": { + "type": "string" } - } + }, + "required": [ + "tag_ids", + "target_id" + ], + "type": "object" } ] }, - "StreamEventMessageFile": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "TagUpdatePayload": { + "properties": { + "name": { + "description": "Tag name.", + "maxLength": 50, + "minLength": 1, + "type": "string" }, - { - "type": "object", - "description": "メッセージファイルイベント。生成中に作成されたファイル(通常はモデルが生成した画像)です。", - "properties": { - "id": { - "type": "string", + "tag_id": { + "type": "string" + } + }, + "required": [ + "name", + "tag_id" + ], + "type": "object" + }, + "TextToAudioPayload": { + "properties": { + "message_id": { + "anyOf": [ + { "format": "uuid", - "description": "ファイルの一意の ID。" + "type": "string" }, - "type": { - "type": "string", - "description": "ファイルタイプ(例:`image`)。" + { + "type": "null" + } + ], + "default": null + }, + "streaming": { + "anyOf": [ + { + "type": "boolean" }, - "belongs_to": { - "type": "string", - "enum": [ - "assistant" - ], - "description": "このファイルの所有者。ここでは常に `assistant` です。" + { + "type": "null" + } + ], + "default": null + }, + "text": { + "anyOf": [ + { + "type": "string" }, - "url": { - "type": "string", - "format": "url", - "description": "ファイルのリモート URL。" + { + "type": "null" } - } + ], + "default": null + }, + "voice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } - ] + }, + "type": "object" }, - "StreamEventMessageReplace": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "TextToAudioPayloadWithUser": { + "properties": { + "message_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + "streaming": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "description": "メッセージコンテンツ置換イベント(例:コンテンツモデレーションによるもの)。", - "properties": { - "answer": { - "type": "string", - "description": "置換コンテンツ。" + "text": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user": { + "type": "string" + }, + "voice": { + "anyOf": [ + { + "type": "string" }, - "reason": { - "type": "string", - "description": "コンテンツ置換の理由。" + { + "type": "null" } - } + ], + "default": null } - ] + }, + "type": "object" }, - "CompletionStreamEventBase": { - "type": "object", + "ToolIcon": { "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "タスク ID。" - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "一意のメッセージ ID。" + "background": { + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "作成タイムスタンプ。" + "content": { + "type": "string" } - } + }, + "required": [ + "background", + "content" + ], + "type": "object" }, - "CompletionStreamEventTtsMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" - }, - { - "type": "object", - "description": "TTS 音声ストリームイベント(base64 エンコード MP3)。自動再生が有効な場合に利用できます。", - "properties": { - "audio": { - "type": "string", - "format": "byte", - "description": "Base64 エンコードされた MP3 音声チャンク。すべてのチャンクを順番にデコードして連結すると、完全な音声ファイルが生成されます。" - } - } + "UrlResponse": { + "properties": { + "url": { + "type": "string" } - ] + }, + "required": [ + "url" + ], + "type": "object" }, - "CompletionStreamEventTtsMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "UserActionConfig": { + "properties": { + "button_style": { + "$ref": "#/components/schemas/ButtonStyle", + "default": "default" }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + "id": { + "maxLength": 20, + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "type": "string" }, - { - "type": "object", - "description": "TTS 音声ストリーム終了イベント。", - "properties": { - "audio": { - "type": "string", - "description": "空の文字列。音声ストリームの終了を示します。" - } - } + "title": { + "maxLength": 100, + "type": "string" } - ] + }, + "required": [ + "id", + "title" + ], + "type": "object" }, - "CompletionStreamEventError": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + "ValueSourceType": { + "enum": [ + "constant", + "variable" + ], + "type": "string" + }, + "WeightKeywordSetting": { + "properties": { + "keyword_weight": { + "description": "キーワード検索結果に割り当てられた重みです。", + "type": "number" + } + }, + "required": [ + "keyword_weight" + ], + "type": "object" + }, + "WeightModel": { + "properties": { + "keyword_setting": { + "anyOf": [ + { + "$ref": "#/components/schemas/WeightKeywordSetting" + }, + { + "type": "null" + } + ], + "default": null, + "description": "キーワード検索の重み設定です。" }, - { - "type": "object", - "description": "ストリーミング中のエラーイベント。", - "properties": { - "status": { - "type": "integer", - "description": "HTTP ステータスコード。" + "vector_setting": { + "anyOf": [ + { + "$ref": "#/components/schemas/WeightVectorSetting" }, - "code": { - "type": "string", - "description": "エラーコード。" + { + "type": "null" + } + ], + "default": null, + "description": "セマンティック検索の重み設定です。" + }, + "weight_type": { + "anyOf": [ + { + "enum": [ + "customized", + "keyword_first", + "semantic_first" + ], + "type": "string" }, - "message": { - "type": "string", - "description": "エラーメッセージ。" + { + "type": "null" } - } + ], + "default": null, + "description": "セマンティック検索とキーワード検索の重みを調整するための戦略です。" } - ] + }, + "type": "object" }, - "CompletionStreamEventPing": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "WeightVectorSetting": { + "properties": { + "embedding_model_name": { + "description": "ベクトル検索に使用される埋め込みモデルの名前です。", + "type": "string" }, - { - "type": "object", - "description": "接続を維持するための Ping イベント。`event: ping` 行として送信され、`data:` ペイロードはありません。" + "embedding_provider_name": { + "description": "ベクトル検索に使用される埋め込みモデルのプロバイダーです。", + "type": "string" + }, + "vector_weight": { + "type": "number" } - ] + }, + "required": [ + "embedding_model_name", + "embedding_provider_name", + "vector_weight" + ], + "type": "object" }, - "Dataset": { - "type": "object", + "WorkflowAppLogPaginationResponse": { "properties": { - "id": { - "type": "string", - "description": "ナレッジベースの一意識別子です。" - }, - "name": { - "type": "string", - "description": "ナレッジベースの表示名です。ワークスペース内で一意です。" - }, - "description": { - "type": "string", - "description": "ナレッジベースの目的または内容を説明するオプションのテキストです。" - }, - "provider": { - "type": "string", - "description": "プロバイダータイプです。内部管理の場合は `vendor`、外部ナレッジベース接続の場合は `external` です。" - }, - "permission": { - "type": "string", - "description": "このナレッジベースにアクセスできるユーザーを制御します。指定可能な値:`only_me`、`all_team_members`、`partial_members`。" - }, - "data_source_type": { - "type": "string", - "description": "ドキュメントのデータソースタイプです。まだ設定されていない場合は `null` です。" - }, - "indexing_technique": { - "type": "string", - "description": "`high_quality` は埋め込みモデルを使用した精密検索、`economy` はキーワードベースのインデキシングです。" - }, - "app_count": { - "type": "integer", - "description": "現在このナレッジベースを使用しているアプリケーションの数です。" - }, - "document_count": { - "type": "integer", - "description": "ナレッジベース内のドキュメント総数です。" + "data": { + "items": { + "$ref": "#/components/schemas/WorkflowAppLogPartialResponse" + }, + "type": "array" }, - "word_count": { - "type": "integer", - "description": "全ドキュメントの合計単語数です。" + "has_more": { + "type": "boolean" }, - "created_by": { - "type": "string", - "description": "ナレッジベースを作成したユーザーの ID です。" + "limit": { + "type": "integer" }, - "author_name": { - "type": "string", - "description": "作成者の表示名です。" + "page": { + "type": "integer" }, + "total": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "type": "object" + }, + "WorkflowAppLogPartialResponse": { + "properties": { "created_at": { - "type": "number", - "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" - }, - "updated_by": { - "type": "string", - "description": "ナレッジベースを最後に更新したユーザーの ID です。" - }, - "updated_at": { - "type": "number", - "description": "最終更新タイムスタンプ(Unix エポック、秒単位)です。" - }, - "embedding_model": { - "type": "string", - "description": "インデックス作成に使用される埋め込みモデルの名前です。" - }, - "embedding_model_provider": { - "type": "string", - "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。以前のナレッジベースでは短縮形(例:`openai`)が返される場合があります。" - }, - "embedding_available": { - "type": "boolean", - "description": "設定された埋め込みモデルが現在利用可能かどうかです。" - }, - "retrieval_model_dict": { - "type": "object", - "description": "ナレッジベースの検索設定です。", - "properties": { - "search_method": { - "type": "string", - "description": "検索に使用する検索方法です。`keyword_search` はキーワードマッチング、`semantic_search` は埋め込みベースの類似度検索、`full_text_search` は全文インデックス検索、`hybrid_search` はセマンティックとキーワードの組み合わせ検索を示します。" - }, - "reranking_enable": { - "type": "boolean", - "description": "リランキングが有効かどうかです。" - }, - "reranking_mode": { - "type": "string", - "nullable": true, - "description": "リランキングモードです。`reranking_model` はモデルベースのリランキング、`weighted_score` はスコアベースの重み付けを示します。リランキングが無効の場合は `null` です。" - }, - "reranking_model": { - "type": "object", - "description": "リランキングモデルの設定です。", - "properties": { - "reranking_provider_name": { - "type": "string", - "description": "リランクモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/cohere/cohere`)。以前のナレッジベースでは短縮形(例:`cohere`)が返される場合があります。" - }, - "reranking_model_name": { - "type": "string", - "description": "リランキングモデル名です。" - } - } - }, - "weights": { - "type": "object", - "nullable": true, - "description": "ハイブリッド検索の重み設定です。", - "properties": { - "weight_type": { - "type": "string", - "description": "セマンティック検索とキーワード検索の重みを調整するための戦略です。" - }, - "vector_setting": { - "type": "object", - "description": "セマンティック検索の重み設定です。", - "properties": { - "vector_weight": { - "type": "number", - "description": "セマンティック(ベクトル)検索結果に割り当てられた重みです。" - }, - "embedding_provider_name": { - "type": "string", - "description": "ベクトル検索に使用される埋め込みモデルのプロバイダーです。" - }, - "embedding_model_name": { - "type": "string", - "description": "ベクトル検索に使用される埋め込みモデルの名前です。" - } - } - }, - "keyword_setting": { - "type": "object", - "description": "キーワード検索の重み設定です。", - "properties": { - "keyword_weight": { - "type": "number", - "description": "キーワード検索結果に割り当てられた重みです。" - } - } - } - } - }, - "top_k": { - "type": "integer", - "description": "返す結果の最大数です。" - }, - "score_threshold_enabled": { - "type": "boolean", - "description": "スコア閾値フィルタリングが有効かどうかです。" + "anyOf": [ + { + "format": "int64", + "type": "integer" }, - "score_threshold": { - "type": "number", - "description": "結果の最小関連性スコアです。`score_threshold_enabled` が `true` の場合にのみ有効です。" + { + "type": "null" } - } + ], + "default": null }, - "summary_index_setting": { - "type": "object", - "nullable": true, - "description": "サマリーインデックスの設定です。", - "properties": { - "enable": { - "type": "boolean", - "description": "サマリーインデックスが有効かどうかです。" - }, - "model_name": { - "type": "string", - "description": "要約生成に使用されるモデルの名前です。" + "created_by_account": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleAccountResponse" }, - "model_provider_name": { - "type": "string", - "description": "要約生成モデルのプロバイダーです。" + { + "type": "null" + } + ], + "default": null + }, + "created_by_end_user": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleEndUser" }, - "summary_prompt": { - "type": "string", - "description": "要約生成に使用されるプロンプトテンプレートです。" + { + "type": "null" } - } + ], + "default": null }, - "tags": { - "type": "array", - "description": "このナレッジベースに関連付けられたタグです。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "タグ識別子です。" - }, - "name": { - "type": "string", - "description": "Tag name." - }, - "type": { - "type": "string", - "description": "タグタイプです。ナレッジベースタグの場合は常に `knowledge` です。" - } + "created_by_role": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "doc_form": { - "type": "string", - "description": "ドキュメントのチャンキングモードです。`text_model` は標準テキストチャンキング、`hierarchical_model` は親子構造、`qa_model` は QA ペア抽出を示します。" + "created_from": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "external_knowledge_info": { - "type": "object", - "nullable": true, - "description": "外部ナレッジベースの接続詳細です。`provider` が `external` の場合に存在します。", - "properties": { - "external_knowledge_id": { - "type": "string", - "description": "外部ナレッジベースの ID です。" + "details": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" }, - "external_knowledge_api_id": { - "type": "string", - "description": "外部ナレッジ API 接続の ID です。" + { + "items": {}, + "type": "array" }, - "external_knowledge_api_name": { - "type": "string", - "description": "外部ナレッジ API の表示名です。" + { + "type": "string" }, - "external_knowledge_api_endpoint": { - "type": "string", - "description": "外部ナレッジ API のエンドポイント URL です。" - } - } - }, - "external_retrieval_model": { - "type": "object", - "nullable": true, - "description": "外部ナレッジベースの検索設定です。内部ナレッジベースの場合は `null` です。", - "properties": { - "top_k": { - "type": "integer", - "description": "外部ナレッジベースから返す結果の最大数です。" + { + "type": "integer" + }, + { + "type": "number" }, - "score_threshold": { - "type": "number", - "description": "最小関連性スコアのしきい値です。" + { + "type": "boolean" }, - "score_threshold_enabled": { - "type": "boolean", - "description": "スコア閾値フィルタリングが有効かどうかです。" + { + "type": "null" } - } + ], + "default": null }, - "doc_metadata": { - "type": "array", - "description": "ナレッジベースのメタデータフィールド定義です。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "メタデータフィールドの識別子です。" - }, - "name": { - "type": "string", - "description": "メタデータフィールド名です。" - }, - "type": { - "type": "string", - "description": "メタデータフィールドの値の種類です。" - } - } - } + "id": { + "format": "uuid", + "type": "string" }, - "built_in_field_enabled": { - "type": "boolean", - "description": "組み込みメタデータフィールド(例:`document_name`、`uploader`)が有効かどうかです。" + "workflow_run": { + "anyOf": [ + { + "$ref": "#/components/schemas/WorkflowRunForLogResponse" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "WorkflowEventsQuery": { + "properties": { + "continue_on_pause": { + "default": false, + "type": "boolean" }, - "pipeline_id": { - "type": "string", - "nullable": true, - "description": "カスタム処理パイプラインが設定されている場合のパイプライン ID です。" + "include_state_snapshot": { + "default": false, + "description": "`true` の場合、永続化された状態スナップショットからリプレイし、新しいイベントのストリーミング開始前に実行済みノードのステータスサマリーを含めます。", + "type": "boolean" }, - "runtime_mode": { - "type": "string", - "nullable": true, - "description": "ランタイム処理モードです。" + "user": { + "type": "string" + } + }, + "required": [ + "user" + ], + "type": "object" + }, + "WorkflowFinishedBlockingDataResponse": { + "additionalProperties": true, + "properties": { + "created_at": { + "format": "int64", + "type": "integer" }, - "chunk_structure": { - "type": "string", - "nullable": true, - "description": "チャンク構造の設定です。" + "elapsed_time": { + "format": "float", + "type": "number" }, - "icon_info": { - "type": "object", - "nullable": true, - "description": "ナレッジベースのアイコン表示設定です。", - "properties": { - "icon_type": { - "type": "string", - "description": "アイコンの種類です。" - }, - "icon": { - "type": "string", - "description": "アイコン識別子または絵文字です。" - }, - "icon_background": { - "type": "string", - "description": "アイコンの背景色です。" + "error": { + "anyOf": [ + { + "type": "string" }, - "icon_url": { - "type": "string", - "description": "カスタムアイコン画像の URL です。" + { + "type": "null" } - } + ] }, - "is_published": { - "type": "boolean", - "description": "ナレッジベースが公開済みかどうかです。" + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ] }, - "total_documents": { - "type": "integer", - "description": "ドキュメントの合計数です。" + "id": { + "format": "uuid", + "type": "string" }, - "total_available_documents": { - "type": "integer", - "description": "有効で利用可能なドキュメントの数です。" + "outputs": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] }, - "enable_api": { - "type": "boolean", - "description": "このナレッジベースで API アクセスが有効かどうかです。" + "status": { + "enum": [ + "failed", + "partial-succeeded", + "stopped", + "succeeded" + ], + "type": "string" }, - "is_multimodal": { - "type": "boolean", - "description": "マルチモーダルコンテンツ処理が有効かどうかです。" + "total_steps": { + "type": "integer" }, - "maintainer": { - "type": "string", - "nullable": true, - "description": "ナレッジベースのメンテナーの表示名です。設定されていない場合は `null` です。" + "total_tokens": { + "type": "integer" }, - "partial_member_list": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - }, - "description": "`permission` が `partial_members` の場合にアクセスを許可されたメンバーのアカウント ID です。更新レスポンスでは常に含まれ、詳細レスポンスでは `permission` が `partial_members` の場合にのみ含まれます。" + "workflow_id": { + "format": "uuid", + "type": "string" } - } + }, + "required": [ + "created_at", + "elapsed_time", + "error", + "finished_at", + "id", + "outputs", + "status", + "total_steps", + "total_tokens", + "workflow_id" + ], + "type": "object" }, - "Document": { - "type": "object", + "WorkflowFinishedBlockingResponse": { + "additionalProperties": true, "properties": { - "id": { - "type": "string", - "description": "ドキュメントの一意識別子です。" - }, - "position": { - "type": "integer", - "description": "リスト内のドキュメントの表示位置です。" - }, - "data_source_type": { - "type": "string", - "description": "ドキュメントの作成方法です。ファイルアップロードの場合は `upload_file`、Notion インポートの場合は `notion_import` です。" + "data": { + "$ref": "#/components/schemas/WorkflowFinishedBlockingDataResponse" }, - "data_source_info": { - "type": "object", - "description": "生のデータソース情報です。`data_source_type` によって異なります。" + "task_id": { + "format": "uuid", + "type": "string" }, - "data_source_detail_dict": { - "type": "object", - "description": "ファイル詳細を含む詳細なデータソース情報です。" + "workflow_run_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "data", + "task_id", + "workflow_run_id" + ], + "type": "object" + }, + "WorkflowLogQuery": { + "properties": { + "created_at__after": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "この ISO 8601 タイムスタンプ以降に作成されたログをフィルタリングします。", + "format": "date-time" }, - "dataset_process_rule_id": { - "type": "string", - "description": "このドキュメントに適用された処理ルールの ID です。" + "created_at__before": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "この ISO 8601 タイムスタンプ以前に作成されたログをフィルタリングします。", + "format": "date-time" }, - "name": { - "type": "string", - "description": "ドキュメント名です。" + "created_by_account": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "created_from": { - "type": "string", - "description": "ドキュメントの作成元です。API で作成した場合は `api`、UI で作成した場合は `web` です。" + "created_by_end_user_session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "エンドユーザーセッション ID でフィルタリングします。" }, - "created_by": { - "type": "string", - "description": "ドキュメントを作成したユーザーの ID です。" + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ログ内を検索するキーワードです。" }, - "created_at": { - "type": "number", - "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" + "limit": { + "default": 20, + "description": "1 ページあたりの件数です。", + "maximum": 100, + "minimum": 1, + "type": "integer" }, - "tokens": { - "type": "integer", - "description": "ドキュメント内の合計トークン数です。" + "page": { + "default": 1, + "maximum": 99999, + "minimum": 1, + "type": "integer" }, - "indexing_status": { - "type": "string", - "description": "現在のインデックスステータスです。`waiting` はキュー待ち、`parsing` はコンテンツ抽出中、`cleaning` はノイズ除去中、`splitting` はチャンキング中、`indexing` はベクトル構築中、`completed` は準備完了、`error` は失敗、`paused` は手動一時停止を示します。" + "status": { + "anyOf": [ + { + "enum": [ + "failed", + "stopped", + "succeeded" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "実行ステータスでフィルタリングします。" + } + }, + "type": "object" + }, + "WorkflowPauseReasonResponse": { + "additionalProperties": true, + "properties": { + "TYPE": { + "type": "string" }, - "error": { - "type": "string", - "nullable": true, - "description": "インデックス作成が失敗した場合のエラーメッセージです。エラーなしの場合は `null` です。" + "actions": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "type": "array" }, - "enabled": { - "type": "boolean", - "description": "このドキュメントが検索に対して有効かどうかです。" + "approval_channels": { + "items": { + "type": "string" + }, + "type": "array" }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "ドキュメントが無効化されたタイムスタンプです。有効な場合は `null` です。" + "display_in_ui": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "ドキュメントを無効化したユーザーの ID です。有効な場合は `null` です。" + "expiration_time": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "archived": { - "type": "boolean", - "description": "ドキュメントがアーカイブ済みかどうかです。" + "form_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "display_status": { - "type": "string", - "description": "`indexing_status` と `enabled` 状態から導出されたユーザー向け表示ステータスです。" + "form_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "word_count": { - "type": "integer", - "description": "ドキュメントの合計単語数です。" + "form_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "hit_count": { - "type": "integer", - "description": "ドキュメントが検索クエリでマッチした回数です。" + "inputs": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "type": "array" }, - "doc_form": { - "type": "string", - "description": "ドキュメントのチャンキングモードです。`text_model` は標準テキストチャンキング、`hierarchical_model` は親子構造、`qa_model` は QA ペア抽出を示します。" + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "doc_metadata": { - "type": "array", - "description": "このドキュメントに割り当てられたメタデータ値です。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "メタデータフィールドの識別子です。" - }, - "name": { - "type": "string", - "description": "メタデータフィールド名です。" - }, - "type": { - "type": "string", - "description": "メタデータフィールドの値の種類です。" - }, - "value": { - "type": "string", - "description": "このドキュメントのメタデータ値。" - } + "node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "summary_index_status": { - "type": "string", - "nullable": true, - "description": "このドキュメントの要約インデックスのステータスです。要約インデックスが設定されていない場合は `null` です。" + "node_title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "need_summary": { - "type": "boolean", - "description": "このドキュメントに要約を生成する必要があるかどうかです。" + "resolved_default_values": { + "additionalProperties": true, + "type": "object" } - } + }, + "required": [ + "TYPE" + ], + "type": "object" }, - "Segment": { - "type": "object", + "WorkflowPausedBlockingDataResponse": { + "additionalProperties": true, "properties": { - "id": { - "type": "string", - "description": "チャンクの一意識別子です。" - }, - "position": { - "type": "integer", - "description": "ドキュメント内のチャンクの位置。" - }, - "document_id": { - "type": "string", - "description": "このチャンクが属するドキュメントの ID です。" + "created_at": { + "format": "int64", + "type": "integer" }, - "content": { - "type": "string", - "description": "チャンクのテキスト内容です。" + "elapsed_time": { + "format": "float", + "type": "number" }, - "sign_content": { - "type": "string", - "description": "整合性検証用の署名付きコンテンツハッシュです。" + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "answer": { - "type": "string", - "description": "回答コンテンツです。Q&A モードのドキュメントで使用されます。" + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ] }, - "word_count": { - "type": "integer", - "description": "チャンク内容の単語数です。" + "id": { + "format": "uuid", + "type": "string" }, - "tokens": { - "type": "integer", - "description": "チャンク内容のトークン数です。" + "outputs": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] }, - "keywords": { - "type": "array", - "description": "キーワードベースの検索のためにこのチャンクに関連付けられたキーワードです。", + "paused_nodes": { "items": { "type": "string" - } + }, + "type": "array" }, - "index_node_id": { - "type": "string", - "description": "ベクトルストア内のインデックスノードの ID です。" + "reasons": { + "items": { + "$ref": "#/components/schemas/WorkflowPauseReasonResponse" + }, + "type": "array" }, - "index_node_hash": { - "type": "string", - "description": "インデックスされたコンテンツのハッシュです。変更の検出に使用されます。" + "status": { + "const": "paused", + "type": "string" }, - "hit_count": { - "type": "integer", - "description": "このチャンクが検索クエリでマッチした回数です。" + "total_steps": { + "type": "integer" }, - "enabled": { - "type": "boolean", - "description": "このチャンクが検索に対して有効かどうかです。" + "total_tokens": { + "type": "integer" }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "チャンクが無効化されたタイムスタンプです。有効な場合は `null` です。" + "workflow_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "created_at", + "elapsed_time", + "error", + "finished_at", + "id", + "outputs", + "paused_nodes", + "reasons", + "status", + "total_steps", + "total_tokens", + "workflow_id" + ], + "type": "object" + }, + "WorkflowPausedBlockingResponse": { + "additionalProperties": true, + "properties": { + "data": { + "$ref": "#/components/schemas/WorkflowPausedBlockingDataResponse" }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "チャンクを無効化したユーザーの ID です。有効な場合は `null` です。" + "task_id": { + "format": "uuid", + "type": "string" }, - "status": { - "type": "string", - "description": "チャンクの現在のインデックスステータスです(例:`completed`、`indexing`、`error`)。" + "workflow_run_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "data", + "task_id", + "workflow_run_id" + ], + "type": "object" + }, + "WorkflowRunForLogResponse": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "created_by": { - "type": "string", - "description": "チャンクを作成したユーザーの ID です。" + "elapsed_time": { + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "created_at": { - "type": "number", - "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "updated_at": { - "type": "number", - "description": "最終更新タイムスタンプ(Unix エポック、秒単位)です。" + "exceptions_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "updated_by": { - "type": "string", - "description": "このチャンクを最後に更新したユーザーの ID です。" + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "indexing_at": { - "type": "number", - "nullable": true, - "description": "インデックス作成が開始されたタイムスタンプです。まだ開始されていない場合は `null` です。" + "id": { + "format": "uuid", + "type": "string" }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "インデックス作成が完了したタイムスタンプです。まだ完了していない場合は `null` です。" + "status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "error": { - "type": "string", - "nullable": true, - "description": "インデックス作成が失敗した場合のエラーメッセージです。エラーなしの場合は `null` です。" + "total_steps": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "stopped_at": { - "type": "number", - "nullable": true, - "description": "インデックス作成が停止されたタイムスタンプです。停止されていない場合は `null` です。" + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "child_chunks": { - "type": "array", - "description": "このチャンクに属する子チャンクです。階層モードのドキュメントにのみ存在します。", - "items": { - "$ref": "#/components/schemas/ChildChunk" - } + "triggered_from": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "attachments": { - "type": "array", - "description": "このチャンクに添付されたファイルです。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "添付ファイルの識別子です。" - }, - "name": { - "type": "string", - "description": "元のファイル名です。" - }, - "size": { - "type": "integer", - "description": "ファイルサイズ(バイト)。" - }, - "extension": { - "type": "string", - "description": "ファイル拡張子。" - }, - "mime_type": { - "type": "string", - "description": "ファイルの MIME タイプ。" + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "WorkflowRunPayload": { + "properties": { + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" }, - "source_url": { - "type": "string", - "description": "添付ファイルにアクセスする URL です。" - } + "type": "array" + }, + { + "type": "null" } - } + ], + "default": null }, - "summary": { - "type": "string", - "nullable": true, - "description": "AI が生成したチャンクコンテンツの要約です。要約インデックスが有効でない場合は `null` です。" + "inputs": { + "additionalProperties": true, + "type": "object" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "inputs" + ], + "type": "object" }, - "ChildChunk": { - "type": "object", + "WorkflowRunPayloadWithUser": { "properties": { - "id": { - "type": "string", - "description": "子チャンクの一意識別子です。" - }, - "segment_id": { - "type": "string", - "description": "この子チャンクが属する親チャンクの ID です。" - }, - "content": { - "type": "string", - "description": "子チャンクのテキスト内容です。" - }, - "position": { - "type": "integer", - "description": "親チャンク内の子チャンクの位置です。" - }, - "word_count": { - "type": "integer", - "description": "子チャンク内容の単語数です。" + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "ファイルタイプ。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null }, - "type": { - "type": "string", - "description": "子チャンクの作成方法です。API から作成または更新された子チャンクは常に `customized` です。システム生成の子チャンクは `automatic` です。" + "inputs": { + "additionalProperties": true, + "type": "object" }, - "created_at": { - "type": "number", - "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "updated_at": { - "type": "number", - "description": "最終更新タイムスタンプ(Unix エポック、秒単位)です。" + "user": { + "type": "string" } - } - }, - "RetrievalModel": { - "type": "object", + }, "required": [ - "search_method", - "reranking_enable", - "top_k", - "score_threshold_enabled" + "inputs", + "user" ], + "type": "object" + }, + "WorkflowRunResponse": { "properties": { - "search_method": { - "type": "string", - "description": "検索に使用される検索メソッドです。", - "enum": [ - "keyword_search", - "semantic_search", - "full_text_search", - "hybrid_search" - ] + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "reranking_enable": { - "type": "boolean", - "description": "リランキングが有効かどうかです。" + "elapsed_time": { + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "reranking_model": { - "type": "object", - "description": "リランキングモデルの設定です。", - "properties": { - "reranking_provider_name": { - "type": "string", - "description": "リランクモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/cohere/cohere`)。`cohere` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=rerank` を指定した際の `provider` フィールドから取得します。" + "error": { + "anyOf": [ + { + "type": "string" }, - "reranking_model_name": { - "type": "string", - "description": "リランキングモデル名です。" + { + "type": "null" } - } + ], + "default": null }, - "reranking_mode": { - "type": "string", - "enum": [ - "reranking_model", - "weighted_score" + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } ], - "nullable": true, - "description": "リランキングモードです。`reranking_enable` が `true` の場合は必須です。" + "default": null }, - "top_k": { - "type": "integer", - "description": "返す結果の最大数です。" + "id": { + "format": "uuid", + "type": "string" }, - "score_threshold_enabled": { - "type": "boolean", - "description": "スコア閾値フィルタリングが有効かどうかです。" + "inputs": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "items": {}, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null }, - "score_threshold": { - "type": "number", - "nullable": true, - "description": "結果の最小関連性スコアです。`score_threshold_enabled` が `true` の場合にのみ有効です。" + "outputs": { + "additionalProperties": true, + "type": "object" }, - "weights": { - "type": "object", - "nullable": true, - "description": "ハイブリッド検索の重み設定です。", - "properties": { - "weight_type": { - "type": "string", - "description": "セマンティック検索とキーワード検索の重みを調整するための戦略です。", - "enum": [ - "semantic_first", - "keyword_first", - "customized" - ] - }, - "vector_setting": { - "type": "object", - "description": "セマンティック検索の重み設定です。", - "properties": { - "vector_weight": { - "type": "number", - "description": "セマンティック(ベクトル)検索結果に割り当てられた重みです。" - }, - "embedding_provider_name": { - "type": "string", - "description": "ベクトル検索に使用される埋め込みモデルのプロバイダーです。" - }, - "embedding_model_name": { - "type": "string", - "description": "ベクトル検索に使用される埋め込みモデルの名前です。" - } - } + "status": { + "type": "string" + }, + "total_steps": { + "anyOf": [ + { + "type": "integer" }, - "keyword_setting": { - "type": "object", - "description": "キーワード検索の重み設定です。", - "properties": { - "keyword_weight": { - "type": "number", - "description": "キーワード検索結果に割り当てられた重みです。" - } - } + { + "type": "null" } - } + ], + "default": null }, - "metadata_filtering_conditions": { - "type": "object", - "nullable": true, - "description": "ドキュメントのメタデータが指定した条件に一致するチャンクのみを取得対象に絞り込みます。条件はサーバーサイドで評価されます。", - "properties": { - "logical_operator": { - "type": "string", - "enum": [ - "and", - "or" - ], - "default": "and", - "nullable": true, - "description": "複数の条件を組み合わせる方法です。" - }, - "conditions": { - "type": "array", - "nullable": true, - "description": "評価するメタデータ条件のリストです。", - "items": { - "type": "object", - "required": [ - "name", - "comparison_operator" - ], - "properties": { - "name": { - "type": "string", - "description": "比較対象とするメタデータフィールド名です。" - }, - "comparison_operator": { - "type": "string", - "description": "適用する比較方法です。メタデータのタイプ別:\n\n- 文字列または配列のメタデータ:`contains`、`not contains`、`start with`、`end with`、`is`、`is not`、`empty`、`not empty`、`in`、`not in`\n- 数値メタデータ:`=`、`≠`、`>`、`<`、`≥`、`≤`\n- 時刻メタデータ:`before`、`after`", - "enum": [ - "contains", - "not contains", - "start with", - "end with", - "is", - "is not", - "empty", - "not empty", - "in", - "not in", - "=", - "≠", - ">", - "<", - "≥", - "≤", - "before", - "after" - ] - }, - "value": { - "nullable": true, - "description": "比較対象の値です。型は `comparison_operator` によって異なります。ほとんどの文字列演算子では文字列、`in` および `not in` では文字列配列、数値演算子では数値、`empty` および `not empty` では省略します。", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "number" - } - ] - } - } - } + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" } - } + ], + "default": null + }, + "workflow_id": { + "format": "uuid", + "type": "string" } - } + }, + "required": [ + "id", + "status", + "workflow_id" + ], + "type": "object" } } } diff --git a/tools/api-pipeline/README.md b/tools/api-pipeline/README.md index 6d16585eac..6b5ea96857 100644 --- a/tools/api-pipeline/README.md +++ b/tools/api-pipeline/README.md @@ -1,6 +1,6 @@ # API Pipeline -Tooling for the Service API reference. `{lang}/api-reference/openapi_service.json` is the hand-maintained spec of record per language: edit it directly. The Phase-1 merge machinery (`build`/`relink` modes, `resolutions.json`, `overrides/`) that consolidated the five legacy per-app-type specs is retired; recover it from git history when Phase 2 rebuilds the spec from R&D's generated spec plus docs-owned overlays. +Tooling for the Service API reference. During the generated-contract migration, Dify's generated `service-openapi.json` owns the wire contract in `{lang}/api-reference/openapi_service.json`; the locale files continue to own presentation fields. Overlay extraction follows after the generated and documented contracts are aligned. ## Layout @@ -11,6 +11,8 @@ Tooling for the Service API reference. `{lang}/api-reference/openapi_service.jso | `memberships.json` | App type → supported operations; drives the app-type overview pages and the coverage check | | `lint_specs.py` | Example/schema, enum, link, and x-codeSamples lint | | `parity_check.py` | en/zh/ja structural parity (ops, params, responses, samples) | +| `align_service_api.py` | Migration-stage alignment from Dify's generated contract while preserving locale presentation | +| `service_api_source.json` | Reviewed Dify commit and generated Service API digest | | `coverage_matrix.py`, `swagger_diff.py` | Code-vs-spec audit tooling, for runtime verification (read `openapi_service.json`) | ## Usage @@ -25,6 +27,17 @@ python3 "$DOCS/tools/api-pipeline/parity_check.py" parity_check.py and check-coverage exit nonzero on failure; lint_specs.py exits nonzero only on missing files — gate on its printed `TOTAL ISSUES` count. +## Align with Dify + +Generate `service-openapi.json` from the exact Dify commit recorded in `service_api_source.json`. Then align all three locale specs: + +```bash +python3 "$DOCS/tools/api-pipeline/align_service_api.py" /path/to/service-openapi.json --write +python3 "$DOCS/tools/api-pipeline/align_service_api.py" /path/to/service-openapi.json +``` + +The aligner takes paths, methods, parameters, schemas, status codes, authentication, deprecation flags, and operation IDs from Dify. It preserves localized prose, examples, operation tags and ordering, `x-mint`, `x-codeSamples`, top-level navigation tags, and the absolute server template used by the Mintlify playground. Existing JSON object keys retain their reviewed order, with generated-only keys appended, to keep contract updates diff-friendly. + ## Editing the spec - Edit all three languages; `parity_check` enforces structural parity with en. diff --git a/tools/api-pipeline/align_service_api.py b/tools/api-pipeline/align_service_api.py new file mode 100644 index 0000000000..ecf0cc48be --- /dev/null +++ b/tools/api-pipeline/align_service_api.py @@ -0,0 +1,631 @@ +#!/usr/bin/env python3 +"""Align localized Service API specs with Dify's generated wire contract. + +This is the migration-stage aligner. It starts from Dify's generated +``service-openapi.json`` and carries over documentation presentation fields +from the existing English, Chinese, and Japanese specs. Routes, methods, +parameters, request and response schemas, status codes, authentication, +deprecation flags, and operation IDs always come from Dify. + +The later overlay stage will replace this migration workflow. Until then, +running the command without ``--write`` checks that committed specs are the +deterministic result of the alignment. +""" + +from __future__ import annotations + +import argparse +import copy +import json +import re +import sys +from collections import defaultdict +from pathlib import Path +from typing import Any + +LANGUAGES = ("en", "zh", "ja") +HTTP_METHODS = {"delete", "get", "head", "options", "patch", "post", "put", "trace"} +PRESENTATION_KEYS = { + "description", + "example", + "examples", + "externalDocs", + "summary", + "title", + "x-codeSamples", + "x-mint", +} + +ROOT_PRESENTATION = { + "en": { + "summary": "Get API Information", + "description": "Returns the public Service API version and server version without requiring an API key.", + "tag": "Applications", + "example_summary": "Response Example", + }, + "zh": { + "summary": "获取 API 信息", + "description": "无需 API 密钥即可获取服务 API 版本和服务器版本。", + "tag": "应用配置", + "example_summary": "响应示例", + }, + "ja": { + "summary": "API 情報の取得", + "description": "API キーを使用せずに、サービス API とサーバーのバージョンを取得します。", + "tag": "アプリケーション設定", + "example_summary": "レスポンス例", + }, +} + +DEPRECATED_ALIAS_PRESENTATION = { + "en": { + "summary": "Deprecated Compatibility Endpoint", + "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + }, + "zh": { + "summary": "已弃用的兼容端点", + "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + }, + "ja": { + "summary": "非推奨の互換エンドポイント", + "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + }, +} + +RESPONSE_DESCRIPTION_FALLBACKS = { + "zh": { + "2": "请求成功。", + "400": "请求参数无效。", + "401": "身份验证失败:API 令牌无效。", + "403": "没有访问此资源的权限。", + "404": "找不到请求的资源。", + "409": "请求与资源当前状态冲突。", + "429": "请求过于频繁。", + "5": "服务器无法完成请求。", + "default": "请求失败。", + }, + "ja": { + "2": "リクエストが成功しました。", + "400": "リクエストパラメーターが無効です。", + "401": "認証に失敗しました。API トークンが無効です。", + "403": "このリソースにアクセスする権限がありません。", + "404": "リクエストされたリソースが見つかりません。", + "409": "リクエストがリソースの現在の状態と競合しています。", + "429": "リクエストが多すぎます。", + "5": "サーバーはリクエストを完了できませんでした。", + "default": "リクエストに失敗しました。", + }, +} +FALLBACK_TRANSLATIONS = { + translation + for language_fallbacks in RESPONSE_DESCRIPTION_FALLBACKS.values() + for translation in language_fallbacks.values() +} + +API_LINK_RE = re.compile(r"(? dict[str, Any]: + with path.open(encoding="utf-8") as handle: + value = json.load(handle) + if not isinstance(value, dict): + raise TypeError(f"{path} must contain a JSON object") + return value + + +def render_json(value: dict[str, Any]) -> str: + return json.dumps(value, ensure_ascii=False, indent=2) + "\n" + + +def item_identity(value: Any) -> tuple[Any, ...] | None: + if not isinstance(value, dict): + return None + if isinstance(value.get("$ref"), str): + return ("ref", value["$ref"]) + if isinstance(value.get("name"), str) and isinstance(value.get("in"), str): + return ("parameter", value["in"], value["name"]) + if isinstance(value.get("type"), str) and isinstance(value.get("format"), str): + return ("schema", value["type"], value["format"]) + if isinstance(value.get("type"), str): + return ("schema", value["type"]) + return None + + +def merge_presentation(generated: Any, current: Any) -> Any: + """Copy documentation-only fields while retaining generated structure.""" + + if isinstance(generated, dict) and isinstance(current, dict): + result = {} + for key, current_value in current.items(): + if key in PRESENTATION_KEYS or key == "tags": + result[key] = copy.deepcopy(current_value) + elif key in generated: + result[key] = merge_presentation(generated[key], current_value) + for key, generated_value in generated.items(): + if key not in result: + result[key] = copy.deepcopy(generated_value) + return result + + if isinstance(generated, list) and isinstance(current, list): + current_by_identity: dict[tuple[Any, ...], list[Any]] = defaultdict(list) + for item in current: + identity = item_identity(item) + if identity is not None: + current_by_identity[identity].append(item) + + result = [] + for index, generated_item in enumerate(generated): + identity = item_identity(generated_item) + matches = current_by_identity.get(identity, []) if identity is not None else [] + if len(matches) == 1: + current_item = matches[0] + elif len(generated) == len(current): + current_item = current[index] + else: + current_item = None + result.append( + merge_presentation(generated_item, current_item) + if current_item is not None + else copy.deepcopy(generated_item) + ) + return result + + return copy.deepcopy(generated) + + +def iter_operations(spec: dict[str, Any]): + paths = spec.get("paths") + if not isinstance(paths, dict): + raise TypeError("OpenAPI paths must be an object") + for path, path_item in paths.items(): + if not isinstance(path_item, dict): + continue + for method, operation in path_item.items(): + if method in HTTP_METHODS and isinstance(operation, dict): + yield path, method, operation + + +def build_translation_memory( + english: Any, + localized: Any, + *, + key: str | None = None, + result: dict[str, set[str]] | None = None, +) -> dict[str, set[str]]: + """Collect existing prose translations at structurally matching locations.""" + + result = defaultdict(set) if result is None else result + if isinstance(english, dict) and isinstance(localized, dict): + for child_key in set(english) & set(localized): + build_translation_memory( + english[child_key], + localized[child_key], + key=child_key, + result=result, + ) + elif isinstance(english, list) and isinstance(localized, list): + for english_item, localized_item in zip(english, localized): + build_translation_memory(english_item, localized_item, key=key, result=result) + elif ( + key in {"description", "summary", "title"} + and isinstance(english, str) + and isinstance(localized, str) + and english != localized + and localized not in FALLBACK_TRANSLATIONS + ): + result[english].add(localized) + return result + + +def apply_translation_memory(english: Any, localized: Any, memory: dict[str, set[str]], *, key: str | None = None) -> Any: + """Fill newly generated prose from unambiguous existing translations.""" + + if isinstance(english, dict) and isinstance(localized, dict): + result = copy.deepcopy(localized) + for child_key in set(english) & set(localized): + result[child_key] = apply_translation_memory( + english[child_key], + localized[child_key], + memory, + key=child_key, + ) + return result + if isinstance(english, list) and isinstance(localized, list) and len(english) == len(localized): + return [ + apply_translation_memory(english_item, localized_item, memory, key=key) + for english_item, localized_item in zip(english, localized) + ] + if ( + key in {"description", "summary", "title"} + and isinstance(english, str) + and localized == english + and len(memory.get(english, set())) == 1 + ): + return next(iter(memory[english])) + return copy.deepcopy(localized) + + +def prefer_aligned_memory( + initial: dict[str, set[str]], + aligned: dict[str, set[str]], +) -> dict[str, set[str]]: + """Prefer a unique translation visible in the generated document shape.""" + + result = {english: set(translations) for english, translations in initial.items()} + for english, translations in aligned.items(): + if len(translations) == 1: + result[english] = set(translations) + elif english not in result: + result[english] = set(translations) + return result + + +def collect_equal_presentation(english: Any, localized: Any, *, key: str | None = None) -> set[str]: + """Return presentation strings already intentionally shared by a locale.""" + + result: set[str] = set() + if isinstance(english, dict) and isinstance(localized, dict): + for child_key in set(english) & set(localized): + result.update(collect_equal_presentation(english[child_key], localized[child_key], key=child_key)) + elif isinstance(english, list) and isinstance(localized, list): + for english_item, localized_item in zip(english, localized): + result.update(collect_equal_presentation(english_item, localized_item, key=key)) + elif ( + key in {"description", "summary", "title"} + and isinstance(english, str) + and canonical_presentation(english) == canonical_presentation(localized) + ): + result.add(canonical_presentation(english)) + return result + + +def canonical_presentation(value: str) -> str: + """Ignore locale prefixes when comparing otherwise identical prose.""" + + return LOCALIZED_API_LINK_RE.sub("/api-reference/", value) + + +def response_description_fallback(language: str, status: str) -> str: + fallbacks = RESPONSE_DESCRIPTION_FALLBACKS[language] + if status in fallbacks: + return fallbacks[status] + if status.startswith("2"): + return fallbacks["2"] + if status.startswith("5"): + return fallbacks["5"] + return fallbacks["default"] + + +def remove_new_untranslated_presentation( + english: Any, + localized: Any, + allowed_equal: set[str], + language: str, + *, + path: tuple[Any, ...] = (), +) -> Any: + """Avoid introducing raw English prose into zh/ja during migration. + + Existing shared technical labels remain intact. Newly generated optional + presentation fields are omitted until the overlay owns them. OpenAPI + response descriptions are required, so new ones receive a localized + status-level fallback instead. + """ + + if isinstance(english, dict) and isinstance(localized, dict): + result = copy.deepcopy(localized) + for key in list(result): + if key not in english: + continue + english_value = english[key] + localized_value = result[key] + if ( + key in {"description", "summary", "title"} + and isinstance(english_value, str) + and isinstance(localized_value, str) + and canonical_presentation(localized_value) == canonical_presentation(english_value) + and canonical_presentation(english_value) not in allowed_equal + ): + is_response_description = ( + key == "description" + and len(path) >= 2 + and path[-2] == "responses" + and isinstance(path[-1], str) + ) + if is_response_description: + result[key] = response_description_fallback(language, path[-1]) + else: + del result[key] + continue + result[key] = remove_new_untranslated_presentation( + english_value, + localized_value, + allowed_equal, + language, + path=path + (key,), + ) + return result + if isinstance(english, list) and isinstance(localized, list): + return [ + remove_new_untranslated_presentation( + english_item, + localized_item, + allowed_equal, + language, + path=path + (index,), + ) + for index, (english_item, localized_item) in enumerate(zip(english, localized)) + ] + return copy.deepcopy(localized) + + +def prefix_internal_api_links(value: Any, language: str, *, key: str | None = None) -> Any: + """Add the locale prefix to bare internal API reference links.""" + + if isinstance(value, dict): + return { + child_key: prefix_internal_api_links(child, language, key=child_key) + for child_key, child in value.items() + } + if isinstance(value, list): + return [prefix_internal_api_links(child, language, key=key) for child in value] + if key in PRESENTATION_KEYS and isinstance(value, str): + return API_LINK_RE.sub(f"/{language}/api-reference/", value) + return copy.deepcopy(value) + + +def localize_unmatched_tags( + aligned: dict[str, Any], + english_current: dict[str, Any], + localized_current: dict[str, Any], +) -> None: + english_tags = [tag.get("name") for tag in english_current.get("tags", []) if isinstance(tag, dict)] + localized_tags = [tag.get("name") for tag in localized_current.get("tags", []) if isinstance(tag, dict)] + tag_map = { + english: localized + for english, localized in zip(english_tags, localized_tags) + if isinstance(english, str) and isinstance(localized, str) + } + for _, _, operation in iter_operations(aligned): + tags = operation.get("tags") + if isinstance(tags, list): + operation["tags"] = [tag_map.get(tag, tag) for tag in tags] + + +def apply_root_presentation(spec: dict[str, Any], language: str) -> None: + operation = spec["paths"]["/"]["get"] + presentation = ROOT_PRESENTATION[language] + operation["summary"] = presentation["summary"] + operation["description"] = presentation["description"] + operation["tags"] = [presentation["tag"]] + operation["x-mint"] = { + "href": f"/{language}/api-reference/applications/get-api-information", + "metadata": { + "title": presentation["summary"], + "sidebarTitle": presentation["summary"], + }, + } + media = operation["responses"]["200"]["content"]["application/json"] + media["examples"] = { + "response": { + "summary": presentation["example_summary"], + "value": { + "welcome": "Dify OpenAPI", + "api_version": "v1", + "server_version": "1.17.0", + }, + } + } + + +def apply_deprecated_alias_presentation(spec: dict[str, Any], language: str) -> None: + presentation = DEPRECATED_ALIAS_PRESENTATION[language] + for path, _, operation in iter_operations(spec): + if operation.get("deprecated") is not True: + continue + if path in DEPRECATED_ALIAS_PATHS: + operation.pop("x-mint", None) + operation["summary"] = presentation["summary"] + operation["description"] = presentation["description"] + elif path == CANONICAL_DEPRECATED_PATH: + operation["x-mint"] = { + "href": f"/{language}/api-reference/documents/update-document-by-file", + "metadata": { + "title": operation["summary"], + "sidebarTitle": operation["summary"], + }, + } + + +def align_language( + generated: dict[str, Any], + current: dict[str, Any], + language: str, +) -> dict[str, Any]: + aligned = merge_presentation(generated, current) + + # JSON object order is not part of the wire contract, but it controls the + # generated sidebar order. Keep the reviewed docs order, prepend the new + # public API-information endpoint, and append other generated-only paths. + generated_paths = aligned.get("paths", {}) + current_paths = current.get("paths", {}) + if isinstance(generated_paths, dict) and isinstance(current_paths, dict): + path_order = ( + (["/"] if "/" in generated_paths and "/" not in current_paths else []) + + [path for path in current_paths if path in generated_paths] + + [ + path + for path in generated_paths + if path not in current_paths and path != "/" + ] + ) + ordered_paths = {} + for path in path_order: + path_item = generated_paths[path] + current_path_item = current_paths.get(path) + if isinstance(path_item, dict) and isinstance(current_path_item, dict): + item_order = ( + [key for key in current_path_item if key in path_item] + + [key for key in path_item if key not in current_path_item] + ) + path_item = {key: path_item[key] for key in item_order} + ordered_paths[path] = path_item + aligned["paths"] = ordered_paths + + # These top-level values control the published docs experience rather than + # the request/response wire contract. + for key in ("info", "servers", "tags"): + if key in current: + aligned[key] = copy.deepcopy(current[key]) + + generated_schemes = aligned.get("components", {}).get("securitySchemes", {}) + current_schemes = current.get("components", {}).get("securitySchemes", {}) + if isinstance(generated_schemes, dict) and isinstance(current_schemes, dict): + current_descriptions = [ + scheme.get("description") + for scheme in current_schemes.values() + if isinstance(scheme, dict) and isinstance(scheme.get("description"), str) + ] + if len(current_descriptions) == 1: + for scheme in generated_schemes.values(): + if isinstance(scheme, dict): + scheme["description"] = current_descriptions[0] + + apply_root_presentation(aligned, language) + apply_deprecated_alias_presentation(aligned, language) + return aligned + + +def wire_shape(value: Any, *, path: tuple[Any, ...] = ()) -> Any: + """Remove presentation fields before comparing generated ownership.""" + + if isinstance(value, dict): + return { + key: wire_shape(child, path=path + (key,)) + for key, child in value.items() + if key not in PRESENTATION_KEYS + and not ( + key == "tags" + and len(path) == 3 + and path[0] == "paths" + and path[2] in HTTP_METHODS + ) + } + if isinstance(value, list): + return [wire_shape(child, path=path + (index,)) for index, child in enumerate(value)] + return value + + +def validate_alignment(generated: dict[str, Any], aligned: dict[str, Any]) -> list[str]: + failures: list[str] = [] + generated_ops = {(path, method): operation for path, method, operation in iter_operations(generated)} + aligned_ops = {(path, method): operation for path, method, operation in iter_operations(aligned)} + if set(generated_ops) != set(aligned_ops): + failures.append("operation inventory differs from generated contract") + + for key in sorted(set(generated_ops) & set(aligned_ops)): + generated_operation = generated_ops[key] + aligned_operation = aligned_ops[key] + for field in ("deprecated", "operationId", "parameters", "requestBody", "security"): + if wire_shape(generated_operation.get(field)) != wire_shape(aligned_operation.get(field)): + failures.append(f"{key[1].upper()} {key[0]}: generated {field} changed") + generated_responses = generated_operation.get("responses") or {} + aligned_responses = aligned_operation.get("responses") or {} + if set(generated_responses) != set(aligned_responses): + failures.append(f"{key[1].upper()} {key[0]}: response statuses changed") + elif wire_shape(generated_responses) != wire_shape(aligned_responses): + failures.append(f"{key[1].upper()} {key[0]}: response contract changed") + + if generated.get("openapi") != aligned.get("openapi"): + failures.append("OpenAPI version differs from generated contract") + if generated.get("security") != aligned.get("security"): + failures.append("top-level security differs from generated contract") + if wire_shape(generated.get("paths"), path=("paths",)) != wire_shape( + aligned.get("paths"), path=("paths",) + ): + failures.append("generated path contract changed") + if wire_shape(generated.get("components")) != wire_shape(aligned.get("components")): + failures.append("generated component contract changed") + return failures + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("generated", type=Path, help="Dify-generated service-openapi.json") + parser.add_argument("--docs-root", type=Path, default=Path(__file__).resolve().parents[2]) + parser.add_argument("--write", action="store_true", help="write aligned locale specs") + args = parser.parse_args() + + generated = load_json(args.generated) + current = { + language: load_json(args.docs_root / language / "api-reference" / "openapi_service.json") + for language in LANGUAGES + } + memories = { + language: build_translation_memory(current["en"], current[language]) + for language in ("zh", "ja") + } + allowed_equal = { + language: collect_equal_presentation(current["en"], current[language]) + for language in ("zh", "ja") + } + + aligned = { + language: align_language(generated, current[language], language) + for language in LANGUAGES + } + for language in ("zh", "ja"): + for _ in range(5): + aligned_memory = build_translation_memory(aligned["en"], aligned[language]) + memory = prefer_aligned_memory(memories[language], aligned_memory) + translated = apply_translation_memory(aligned["en"], aligned[language], memory) + if translated == aligned[language]: + break + aligned[language] = translated + localize_unmatched_tags(aligned[language], current["en"], current[language]) + aligned[language] = remove_new_untranslated_presentation( + aligned["en"], + aligned[language], + allowed_equal[language], + language, + ) + + aligned = { + language: prefix_internal_api_links(spec, language) + for language, spec in aligned.items() + } + + failed = False + for language in LANGUAGES: + failures = validate_alignment(generated, aligned[language]) + if failures: + failed = True + print(f"{language}: alignment failures ({len(failures)})") + for failure in failures: + print(f" - {failure}") + continue + + output = args.docs_root / language / "api-reference" / "openapi_service.json" + rendered = render_json(aligned[language]) + if args.write: + output.write_text(rendered, encoding="utf-8") + print(f"{language}: wrote {output}") + elif output.read_text(encoding="utf-8") != rendered: + failed = True + print(f"{language}: aligned output differs from {output}") + else: + print(f"{language}: aligned output is current") + return 1 if failed else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tools/api-pipeline/merge_specs.py b/tools/api-pipeline/merge_specs.py index eeec11bfc2..8ebe0df3bb 100644 --- a/tools/api-pipeline/merge_specs.py +++ b/tools/api-pipeline/merge_specs.py @@ -40,7 +40,7 @@ def iter_ops(spec: dict): """Yield (path, method, op) for every operation in a spec.""" for path, item in spec.get("paths", {}).items(): for method, op in item.items(): - if method in HTTP_METHODS: + if method in HTTP_METHODS and op.get("deprecated") is not True: yield path, method, op diff --git a/tools/api-pipeline/service_api_source.json b/tools/api-pipeline/service_api_source.json new file mode 100644 index 0000000000..4bee4410bb --- /dev/null +++ b/tools/api-pipeline/service_api_source.json @@ -0,0 +1,5 @@ +{ + "repository": "langgenius/dify", + "commit": "c7520d7c71031dfa5764d966a523c5766abdc2d6", + "generated_service_openapi_sha256": "a225c8d13e83232f216d22780ad2e74c747a92dd9797ff07dd8bf5294636fb23" +} diff --git a/tools/api-pipeline/test_align_service_api.py b/tools/api-pipeline/test_align_service_api.py new file mode 100644 index 0000000000..9a5572fcae --- /dev/null +++ b/tools/api-pipeline/test_align_service_api.py @@ -0,0 +1,166 @@ +import copy +import unittest + +from align_service_api import ( + apply_deprecated_alias_presentation, + align_language, + merge_presentation, + prefix_internal_api_links, + remove_new_untranslated_presentation, + validate_alignment, +) + + +class AlignServiceApiTest(unittest.TestCase): + def setUp(self) -> None: + self.generated = { + "openapi": "3.1.0", + "info": {"title": "Generated", "version": "1"}, + "servers": [{"url": "/v1"}], + "security": [{"Bearer": []}], + "tags": [{"name": "service_api"}], + "paths": { + "/": { + "get": { + "operationId": "get_index_api", + "responses": { + "200": { + "description": "Success", + "content": {"application/json": {"schema": {"type": "object"}}}, + } + }, + "security": [], + "summary": "Generated root", + "tags": ["service_api"], + } + }, + "/items": { + "get": { + "operationId": "get_items", + "responses": {"200": {"description": "Success"}, "401": {"description": "Unauthorized"}}, + "summary": "Generated summary", + "tags": ["service_api"], + } + }, + }, + "components": { + "securitySchemes": { + "Bearer": {"type": "http", "scheme": "bearer", "description": "Generated auth"} + } + }, + } + self.current = { + "openapi": "3.0.1", + "info": {"title": "Dify Service API", "version": "1.0.0"}, + "servers": [{"url": "https://{api_base_url}"}], + "security": [{"ApiKeyAuth": []}], + "tags": [{"name": "Applications"}], + "paths": { + "/items": { + "get": { + "operationId": "listItems", + "description": "Curated description.", + "responses": {"200": {"description": "Curated success"}}, + "summary": "List Items", + "tags": ["Applications"], + "x-mint": {"href": "/en/api-reference/applications/list-items"}, + } + } + }, + "components": { + "securitySchemes": { + "ApiKeyAuth": {"type": "http", "scheme": "bearer", "description": "Curated auth"} + } + }, + } + + def test_generated_wire_fields_and_operation_ids_win(self) -> None: + aligned = align_language(copy.deepcopy(self.generated), self.current, "en") + operation = aligned["paths"]["/items"]["get"] + self.assertEqual(operation["operationId"], "get_items") + self.assertEqual(set(operation["responses"]), {"200", "401"}) + self.assertEqual(aligned["security"], [{"Bearer": []}]) + self.assertEqual(validate_alignment(self.generated, aligned), []) + + def test_documentation_presentation_and_server_are_preserved(self) -> None: + aligned = align_language(copy.deepcopy(self.generated), self.current, "en") + operation = aligned["paths"]["/items"]["get"] + self.assertEqual(operation["summary"], "List Items") + self.assertEqual(operation["description"], "Curated description.") + self.assertEqual(operation["tags"], ["Applications"]) + self.assertEqual(operation["x-mint"]["href"], "/en/api-reference/applications/list-items") + self.assertEqual(aligned["servers"], self.current["servers"]) + self.assertEqual(aligned["components"]["securitySchemes"]["Bearer"]["description"], "Curated auth") + + def test_existing_key_order_is_stable_and_new_keys_are_appended(self) -> None: + generated = {"type": "object", "new": True, "description": "Generated"} + current = {"description": "Curated", "type": "object"} + aligned = merge_presentation(generated, current) + self.assertEqual(list(aligned), ["description", "type", "new"]) + + def test_root_operation_receives_docs_metadata(self) -> None: + aligned = align_language(copy.deepcopy(self.generated), self.current, "en") + operation = aligned["paths"]["/"]["get"] + self.assertEqual(operation["summary"], "Get API Information") + self.assertEqual(operation["tags"], ["Applications"]) + self.assertEqual(operation["x-mint"]["href"], "/en/api-reference/applications/get-api-information") + example = operation["responses"]["200"]["content"]["application/json"]["examples"]["response"]["value"] + self.assertEqual(example["api_version"], "v1") + self.assertEqual(example["server_version"], "1.17.0") + + def test_new_untranslated_prose_is_removed_but_response_description_is_localized(self) -> None: + english = { + "description": "New schema prose.", + "responses": {"401": {"description": "Unauthorized - invalid API token"}}, + } + localized = copy.deepcopy(english) + cleaned = remove_new_untranslated_presentation(english, localized, set(), "zh") + self.assertNotIn("description", cleaned) + self.assertEqual(cleaned["responses"]["401"]["description"], "身份验证失败:API 令牌无效。") + + def test_internal_api_links_receive_locale_prefix(self) -> None: + value = { + "description": "See [Upload File](/api-reference/files/upload-file).", + "x-mint": {"href": "/en/api-reference/files/upload-file"}, + } + localized = prefix_internal_api_links(value, "en") + self.assertIn("](/en/api-reference/files/upload-file)", localized["description"]) + self.assertEqual(localized["x-mint"]["href"], "/en/api-reference/files/upload-file") + + def test_deprecated_aliases_are_hidden_but_canonical_page_remains_linkable(self) -> None: + spec = { + "paths": { + "/datasets/{dataset_id}/document/create_by_file": { + "post": {"deprecated": True, "summary": "Alias", "x-mint": {"href": "/alias"}} + }, + "/datasets/{dataset_id}/documents/{document_id}/update-by-file": { + "post": {"deprecated": True, "summary": "Update Document by File"} + }, + } + } + apply_deprecated_alias_presentation(spec, "en") + alias = spec["paths"]["/datasets/{dataset_id}/document/create_by_file"]["post"] + canonical = spec["paths"]["/datasets/{dataset_id}/documents/{document_id}/update-by-file"]["post"] + self.assertNotIn("x-mint", alias) + self.assertEqual( + canonical["x-mint"]["href"], + "/en/api-reference/documents/update-document-by-file", + ) + + def test_component_wire_changes_fail_validation(self) -> None: + aligned = align_language(copy.deepcopy(self.generated), self.current, "en") + aligned["components"]["securitySchemes"]["Bearer"]["scheme"] = "basic" + self.assertIn("generated component contract changed", validate_alignment(self.generated, aligned)) + + def test_schema_property_named_tags_is_wire_owned(self) -> None: + generated = copy.deepcopy(self.generated) + generated["components"]["schemas"] = { + "Item": {"type": "object", "properties": {"tags": {"type": "array"}}} + } + aligned = align_language(copy.deepcopy(generated), self.current, "en") + aligned["components"]["schemas"]["Item"]["properties"]["tags"]["type"] = "string" + self.assertIn("generated component contract changed", validate_alignment(generated, aligned)) + + +if __name__ == "__main__": + unittest.main() diff --git a/zh/api-reference/openapi_service.json b/zh/api-reference/openapi_service.json index 1a9031dac2..2b7e184ebe 100644 --- a/zh/api-reference/openapi_service.json +++ b/zh/api-reference/openapi_service.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.1.0", "info": { "title": "Dify 服务 API", "description": "用于 Dify 应用与知识库的 REST API。应用类接口使用应用 API 密钥认证,知识库类接口使用知识库 API 密钥认证。", @@ -19,7 +19,7 @@ ], "security": [ { - "ApiKeyAuth": [] + "Bearer": [] } ], "tags": [ @@ -97,11 +97,51 @@ } ], "paths": { + "/": { + "get": { + "operationId": "get_index_api", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndexInfoResponse" + }, + "examples": { + "response": { + "summary": "响应示例", + "value": { + "welcome": "Dify OpenAPI", + "api_version": "v1", + "server_version": "1.17.0" + } + } + } + } + }, + "description": "请求成功。" + } + }, + "security": [], + "summary": "获取 API 信息", + "tags": [ + "应用配置" + ], + "description": "无需 API 密钥即可获取服务 API 版本和服务器版本。", + "x-mint": { + "href": "/zh/api-reference/applications/get-api-information", + "metadata": { + "title": "获取 API 信息", + "sidebarTitle": "获取 API 信息" + } + } + } + }, "/chat-messages": { "post": { "summary": "发送对话消息", "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n向对话型应用发送一条消息并返回助手的回复。流式响应中的事件因应用类型而异。", - "operationId": "sendBasicChatMessageCn", + "operationId": "create_chat_message", "tags": [ "对话消息" ], @@ -111,7 +151,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChatRequest" + "$ref": "#/components/schemas/ChatRequestPayloadWithUser" }, "examples": { "streaming_example": { @@ -153,7 +193,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChatCompletionResponse" + "$ref": "#/components/schemas/ChatBlockingResponse" }, "examples": { "blockingResponse": { @@ -413,6 +453,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -435,7 +481,7 @@ "post": { "summary": "停止响应", "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n停止聊天消息生成任务。仅在 `streaming` 模式下支持。", - "operationId": "stopBasicChatMessageGenerationCn", + "operationId": "stop_chat_message", "tags": [ "对话消息" ], @@ -455,16 +501,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。必须与发送原始消息时的 `user` 一致;不一致时停止不会生效,但仍返回成功。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" - } - } + "$ref": "#/components/schemas/RequiredServiceApiUserPayload" }, "examples": { "example": { @@ -479,7 +516,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleResultResponse" + } + } + }, + "description": "请求成功。" }, "400": { "description": "- `not_chat_app` : 应用模式与 API 路由不匹配。\n- `invalid_param` : 缺少必填的 `user` 字段。", @@ -505,6 +549,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" } }, "x-mint": { @@ -520,7 +582,7 @@ "get": { "summary": "获取下一轮建议问题列表", "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n返回为某条消息推荐的追问问题。", - "operationId": "getBasicChatSuggestedQuestionsCn", + "operationId": "get_suggested_questions", "tags": [ "对话消息" ], @@ -551,7 +613,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuggestedQuestionsResponse" + "$ref": "#/components/schemas/SimpleResultStringListResponse" }, "examples": { "suggestedQuestions": { @@ -627,6 +689,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-codeSamples": [ @@ -649,7 +723,7 @@ "post": { "summary": "上传文件", "description": "**适用于**:Chatflow、Workflow、新 Agent、聊天助手、Agent、文本生成应用。\n\n上传文件并返回其 `id`,供后续请求引用。文件归上传它的终端用户所有:只有携带相同 `user` 的请求才能引用该文件。\n\n应用实际能使用哪些文件类型,取决于它的文件上传设置;可通过 [获取应用参数](/zh/api-reference/applications/get-app-parameters) 读取。", - "operationId": "uploadBasicChatFileCn", + "operationId": "upload_file", "tags": [ "文件操作" ], @@ -684,7 +758,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileUploadResponse" + "$ref": "#/components/schemas/FileResponse" }, "examples": { "uploadSuccess": { @@ -785,6 +859,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -807,7 +893,7 @@ "get": { "summary": "下载文件", "description": "**适用于**:Chatflow、聊天助手、Agent、文本生成应用。\n\n返回此前由 [上传文件](/zh/api-reference/files/upload-file) 返回的文件的原始字节。文件仅可通过引用它的消息所属的应用访问。", - "operationId": "previewBasicChatFileCn", + "operationId": "preview_file", "tags": [ "文件操作" ], @@ -846,10 +932,10 @@ "200": { "description": "返回原始文件内容。`Content-Type` 头设置为文件的 MIME 类型。如果 `as_attachment` 为 `true`,文件将以 `Content-Disposition: attachment` 方式作为下载返回。", "content": { - "application/octet-stream": { + "*/*": { "schema": { - "type": "string", - "format": "binary" + "format": "binary", + "type": "string" } } } @@ -887,6 +973,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -902,7 +994,7 @@ "get": { "summary": "获取终端用户信息", "description": "**适用于**:Chatflow、Workflow、新 Agent、聊天助手、Agent、文本生成应用。\n\n根据 ID 返回终端用户的详细信息。当需要解析其他接口返回的终端用户 ID(例如 [上传文件](/zh/api-reference/files/upload-file) 响应中的 `created_by`)时很有用。", - "operationId": "getEndUserChatCn", + "operationId": "get_end_user", "tags": [ "终端用户" ], @@ -962,6 +1054,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -977,7 +1081,7 @@ "post": { "summary": "提交消息反馈", "description": "**适用于**:Chatflow、聊天助手、Agent、文本生成应用。\n\n为消息记录 `like` 或 `dislike` 评价,并可附带可选评论。将 `rating` 设为 `null` 可撤销该消息的已有反馈。", - "operationId": "postBasicChatMessageFeedbackCn", + "operationId": "create_message_feedback", "tags": [ "消息反馈" ], @@ -989,7 +1093,8 @@ "description": "要反馈的消息 ID。消息 ID 从 [获取会话历史消息](/zh/api-reference/conversations/list-conversation-messages) 获取。", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "消息 ID。" } } ], @@ -998,7 +1103,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageFeedbackRequest" + "$ref": "#/components/schemas/MessageFeedbackPayloadWithUser" }, "examples": { "likeFeedback": { @@ -1015,7 +1120,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultResponse" + } + } + }, + "description": "请求成功。" }, "400": { "description": "`invalid_param` : 缺少必填的 `user` 字段,或 `rating` 为 `null` 但没有可撤销的已有反馈。", @@ -1050,6 +1162,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -1065,32 +1189,32 @@ "get": { "summary": "获取应用的消息反馈", "description": "**适用于**:Chatflow、聊天助手、Agent、文本生成应用。\n\n返回此应用所有消息反馈的分页列表,包括终端用户和管理员提交的反馈。", - "operationId": "getBasicChatAppFeedbacksCn", + "operationId": "get_app_feedbacks", "tags": [ "消息反馈" ], "parameters": [ { - "name": "page", + "name": "limit", "in": "query", - "description": "页码。", + "description": "每页反馈条数。", "required": false, "schema": { "type": "integer", - "default": 1, - "minimum": 1 + "default": 20, + "minimum": 1, + "maximum": 101 } }, { - "name": "limit", + "name": "page", "in": "query", - "description": "每页反馈条数。", + "description": "页码。", "required": false, "schema": { "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 101 + "default": 1, + "minimum": 1 } } ], @@ -1100,7 +1224,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AppFeedbacksResponse" + "$ref": "#/components/schemas/AppFeedbackListResponse" }, "examples": { "feedbacksList": { @@ -1139,6 +1263,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -1154,20 +1290,11 @@ "get": { "summary": "获取会话列表", "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n列出某个终端用户的会话,按最近活跃时间排序。", - "operationId": "getBasicChatConversationsListCn", + "operationId": "list_conversations", "tags": [ "会话管理" ], "parameters": [ - { - "name": "user", - "in": "query", - "required": false, - "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。", - "schema": { - "type": "string" - } - }, { "name": "last_id", "in": "query", @@ -1186,7 +1313,8 @@ "type": "integer", "default": 20, "minimum": 1, - "maximum": 100 + "maximum": 100, + "description": "返回的记录数。" } }, { @@ -1197,13 +1325,22 @@ "schema": { "type": "string", "enum": [ - "created_at", "-created_at", - "updated_at", - "-updated_at" + "-updated_at", + "created_at", + "updated_at" ], "default": "-updated_at" } + }, + { + "name": "user", + "in": "query", + "required": false, + "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。", + "schema": { + "type": "string" + } } ], "responses": { @@ -1212,7 +1349,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationsListResponse" + "$ref": "#/components/schemas/ConversationInfiniteScrollPagination" }, "examples": { "conversationsList": { @@ -1272,6 +1409,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -1287,7 +1436,7 @@ "get": { "summary": "获取会话历史消息", "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n返回会话的消息历史,按时间倒序(最新在前)。传入 `first_id` 可向前翻页获取更早的消息。", - "operationId": "getBasicChatConversationHistoryCn", + "operationId": "list_messages", "tags": [ "会话管理" ], @@ -1298,16 +1447,8 @@ "required": true, "description": "要读取的会话 ID。会话 ID 从 [获取会话列表](/zh/api-reference/conversations/list-conversations) 获取。", "schema": { - "type": "string" - } - }, - { - "name": "user", - "in": "query", - "required": false, - "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。", - "schema": { - "type": "string" + "type": "string", + "description": "会话 ID。" } }, { @@ -1328,7 +1469,17 @@ "type": "integer", "default": 20, "minimum": 1, - "maximum": 100 + "maximum": 100, + "description": "每次请求返回的聊天历史消息数量。" + } + }, + { + "name": "user", + "in": "query", + "required": false, + "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。", + "schema": { + "type": "string" } } ], @@ -1338,7 +1489,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationHistoryResponse" + "$ref": "#/components/schemas/MessageInfiniteScrollPagination" }, "examples": { "conversationHistory": { @@ -1421,6 +1572,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-codeSamples": [ @@ -1443,7 +1606,7 @@ "get": { "summary": "获取对话变量", "description": "**适用于**:Chatflow、聊天助手、Agent。\n\n列出会话中存储的变量。", - "operationId": "getBasicChatConversationVariablesCn", + "operationId": "list_conversation_variables", "tags": [ "会话管理" ], @@ -1454,16 +1617,9 @@ "required": true, "description": "要列出变量的会话 ID。会话 ID 从 [获取会话列表](/zh/api-reference/conversations/list-conversations) 获取。", "schema": { - "type": "string" - } - }, - { - "name": "user", - "in": "query", - "required": false, - "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。", - "schema": { - "type": "string" + "type": "string", + "description": "会话 ID。", + "format": "uuid" } }, { @@ -1484,7 +1640,17 @@ "type": "integer", "default": 20, "minimum": 1, - "maximum": 100 + "maximum": 100, + "description": "返回的记录数。" + } + }, + { + "name": "user", + "in": "query", + "required": false, + "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。", + "schema": { + "type": "string" } }, { @@ -1495,7 +1661,8 @@ "schema": { "type": "string", "minLength": 1, - "maxLength": 255 + "maxLength": 255, + "description": "按指定名称筛选变量。" } } ], @@ -1505,7 +1672,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationVariablesResponse" + "$ref": "#/components/schemas/ConversationVariableInfiniteScrollPaginationResponse" }, "examples": { "conversationVariables": { @@ -1571,6 +1738,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -1586,7 +1765,7 @@ "post": { "summary": "重命名会话", "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n重命名会话;当 `auto_generate` 为 `true` 时,根据会话消息自动生成名称。该名称用于客户端的多会话列表显示。", - "operationId": "renameBasicChatConversationCn", + "operationId": "rename_conversation", "tags": [ "会话管理" ], @@ -1597,7 +1776,9 @@ "required": true, "description": "要重命名的会话 ID。会话 ID 从 [获取会话列表](/zh/api-reference/conversations/list-conversations) 获取。", "schema": { - "type": "string" + "type": "string", + "description": "会话 ID。", + "format": "uuid" } } ], @@ -1606,7 +1787,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationRenameRequest" + "$ref": "#/components/schemas/ConversationRenamePayloadWithUser" }, "examples": { "renameExample": { @@ -1626,7 +1807,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationListItem" + "$ref": "#/components/schemas/SimpleConversation" }, "examples": { "renamedConversation": { @@ -1688,6 +1869,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -1703,7 +1896,7 @@ "put": { "summary": "更新对话变量", "description": "**适用于**:Chatflow、聊天助手、Agent。\n\n更新会话变量的值。新值必须与该变量的现有类型匹配。", - "operationId": "updateChatConversationVariableZh", + "operationId": "update_conversation_variable", "tags": [ "会话管理" ], @@ -1715,7 +1908,8 @@ "description": "变量所属的会话 ID。会话 ID 从 [获取会话列表](/zh/api-reference/conversations/list-conversations) 获取。", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "会话 ID。" } }, { @@ -1725,7 +1919,8 @@ "description": "要更新的变量 ID。变量 ID 从 [获取对话变量](/zh/api-reference/conversations/list-conversation-variables) 获取。", "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "Variable ID." } } ], @@ -1734,7 +1929,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationVariableUpdateRequest" + "$ref": "#/components/schemas/ConversationVariableUpdatePayloadWithUser" }, "examples": { "updateStringVariable": { @@ -1754,7 +1949,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConversationVariableItem" + "$ref": "#/components/schemas/ConversationVariableResponse" }, "examples": { "updatedVariable": { @@ -1822,6 +2017,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -1837,7 +2044,7 @@ "delete": { "summary": "删除会话", "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n删除会话。", - "operationId": "deleteBasicChatConversationCn", + "operationId": "delete_conversation", "tags": [ "会话管理" ], @@ -1848,7 +2055,9 @@ "required": true, "description": "要删除的会话 ID。会话 ID 从 [获取会话列表](/zh/api-reference/conversations/list-conversations) 获取。", "schema": { - "type": "string" + "type": "string", + "description": "会话 ID。", + "format": "uuid" } } ], @@ -1858,13 +2067,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" - } - } + "$ref": "#/components/schemas/OptionalServiceApiUserPayload" }, "examples": { "deleteExample": { @@ -1914,6 +2117,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -1929,7 +2144,7 @@ "post": { "summary": "语音转文字", "description": "**适用于**:Chatflow、Workflow、新 Agent、聊天助手、Agent、文本生成应用。\n\n使用工作空间的默认语音转文字模型,将上传的音频文件转写为文字。", - "operationId": "basicChatAudioToTextCn", + "operationId": "audio_to_text", "tags": [ "语音与文字转换" ], @@ -1938,7 +2153,19 @@ "content": { "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/AudioToTextRequest" + "properties": { + "file": { + "format": "binary", + "type": "string" + }, + "user": { + "type": "string" + } + }, + "required": [ + "file" + ], + "type": "object" } } } @@ -1949,7 +2176,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AudioToTextResponse" + "$ref": "#/components/schemas/AudioTranscriptResponse" }, "examples": { "audioToTextSuccess": { @@ -2061,12 +2288,24 @@ } } } - } - }, - "x-mint": { - "href": "/zh/api-reference/audio/convert-audio-to-text", - "metadata": { - "title": "语音转文字", + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + } + }, + "x-mint": { + "href": "/zh/api-reference/audio/convert-audio-to-text", + "metadata": { + "title": "语音转文字", "sidebarTitle": "语音转文字" } }, @@ -2083,7 +2322,7 @@ "post": { "summary": "文字转语音", "description": "**适用于**:Chatflow、Workflow、新 Agent、聊天助手、Agent、文本生成应用。\n\n将文本转换为语音音频。传入 `text` 可合成任意文本,或传入 `message_id` 为已有消息的答案配音。", - "operationId": "basicChatTextToAudioCn", + "operationId": "text_to_audio", "tags": [ "语音与文字转换" ], @@ -2092,7 +2331,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TextToAudioRequest" + "$ref": "#/components/schemas/TextToAudioPayloadWithUser" }, "examples": { "textToAudioExample": { @@ -2229,6 +2468,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -2244,7 +2495,7 @@ "get": { "summary": "获取应用基本信息", "description": "**适用于**:Chatflow、Workflow、新 Agent、聊天助手、Agent、文本生成应用。\n\n返回应用的基本信息:名称、描述、标签、模式和作者。", - "operationId": "getBasicChatAppInfoCn", + "operationId": "get_app_info", "tags": [ "应用配置" ], @@ -2273,6 +2524,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" } }, "x-mint": { @@ -2288,7 +2557,7 @@ "get": { "summary": "获取应用参数", "description": "**适用于**:Chatflow、Workflow、新 Agent、聊天助手、Agent、文本生成应用。\n\n返回应用的前端配置:开场白和建议问题、功能开关、用户输入表单,以及文件上传限制。用它来渲染应用的输入项并应用正确的上传限制。", - "operationId": "getBasicChatAppParametersCn", + "operationId": "get_app_parameters", "tags": [ "应用配置" ], @@ -2298,7 +2567,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AppParametersResponse" + "$ref": "#/components/schemas/Parameters" }, "examples": { "appParameters": { @@ -2391,6 +2660,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" } }, "x-mint": { @@ -2406,7 +2693,7 @@ "get": { "summary": "获取应用元数据", "description": "**适用于**:Chatflow、Workflow、新 Agent、聊天助手、Agent、文本生成应用。\n\n返回此应用所用工具的展示图标,以工具名为键。", - "operationId": "getBasicChatAppMetaCn", + "operationId": "get_app_meta", "tags": [ "应用配置" ], @@ -2434,6 +2721,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" } }, "x-mint": { @@ -2449,7 +2754,7 @@ "get": { "summary": "获取应用 WebApp 设置", "description": "**适用于**:Chatflow、Workflow、新 Agent、聊天助手、Agent、文本生成应用。\n\n返回应用托管 Web 应用的品牌与展示设置,如标题、图标、主题色和默认语言。", - "operationId": "getBasicChatWebAppSettingsCn", + "operationId": "get_app_site", "tags": [ "应用配置" ], @@ -2459,7 +2764,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebAppSettingsResponse" + "$ref": "#/components/schemas/Site" }, "examples": { "webAppSettings": { @@ -2502,6 +2807,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -2517,7 +2828,7 @@ "post": { "summary": "创建标注", "description": "**适用于**:Chatflow、聊天助手、Agent。\n\n创建标注。标注是预定义的问答对,命中时应用直接返回,而不再生成新回复。", - "operationId": "createChatAnnotationZh", + "operationId": "create_annotation", "tags": [ "标注管理" ], @@ -2526,7 +2837,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAnnotationRequest" + "$ref": "#/components/schemas/AnnotationCreatePayload" }, "examples": { "createAnnotation": { @@ -2546,7 +2857,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AnnotationItem" + "$ref": "#/components/schemas/Annotation" }, "examples": { "createdAnnotation": { @@ -2562,6 +2873,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -2575,20 +2898,20 @@ "get": { "summary": "获取标注列表", "description": "**适用于**:Chatflow、聊天助手、Agent。\n\n列出应用的标注,可按关键词筛选。", - "operationId": "listChatAnnotationsZh", + "operationId": "list_annotations", "tags": [ "标注管理" ], "parameters": [ { - "name": "page", + "name": "keyword", "in": "query", - "description": "页码。", + "description": "按问题或回答内容筛选标注的关键词。", "required": false, "schema": { - "type": "integer", - "default": 1, - "minimum": 1 + "type": "string", + "default": "", + "description": "按问题或回答内容筛选标注的关键词。" } }, { @@ -2599,16 +2922,19 @@ "schema": { "type": "integer", "default": 20, - "minimum": 1 + "minimum": 1, + "description": "每页条目数。" } }, { - "name": "keyword", + "name": "page", "in": "query", - "description": "按问题或回答内容筛选标注的关键词。", + "description": "页码。", "required": false, "schema": { - "type": "string" + "type": "integer", + "default": 1, + "minimum": 1 } } ], @@ -2618,7 +2944,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AnnotationListResponse" + "$ref": "#/components/schemas/AnnotationList" }, "examples": { "annotationList": { @@ -2642,6 +2968,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -2657,7 +2995,7 @@ "put": { "summary": "更新标注", "description": "**适用于**:Chatflow、聊天助手、Agent。\n\n更新标注的问题和答案。", - "operationId": "updateChatAnnotationZh", + "operationId": "update_annotation", "tags": [ "标注管理" ], @@ -2678,7 +3016,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateAnnotationRequest" + "$ref": "#/components/schemas/AnnotationCreatePayload" }, "examples": { "updateAnnotation": { @@ -2698,7 +3036,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AnnotationItem" + "$ref": "#/components/schemas/Annotation" }, "examples": { "updatedAnnotation": { @@ -2731,6 +3069,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -2744,7 +3094,7 @@ "delete": { "summary": "删除标注", "description": "**适用于**:Chatflow、聊天助手、Agent。\n\n删除标注及其关联的命中历史。", - "operationId": "deleteChatAnnotationZh", + "operationId": "delete_annotation", "tags": [ "标注管理" ], @@ -2780,6 +3130,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -2795,7 +3157,7 @@ "post": { "summary": "配置标注回复", "description": "**适用于**:Chatflow、聊天助手、Agent。\n\n为应用启用或禁用标注回复。异步执行;使用 [查询标注回复配置任务状态](/zh/api-reference/annotations/get-annotation-reply-job-status) 跟踪进度。\n\n请求体在执行操作前校验,因此即使是 `disable` 也必须提供 `score_threshold`、`embedding_provider_name` 和 `embedding_model_name`。", - "operationId": "setChatAnnotationReplyZh", + "operationId": "annotation_reply_action", "tags": [ "标注管理" ], @@ -2808,8 +3170,8 @@ "schema": { "type": "string", "enum": [ - "enable", - "disable" + "disable", + "enable" ] } } @@ -2819,7 +3181,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitialAnnotationReplySettingsRequest" + "$ref": "#/components/schemas/AnnotationReplyActionPayload" }, "examples": { "enableAnnotationReply": { @@ -2840,7 +3202,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitialAnnotationReplySettingsResponse" + "$ref": "#/components/schemas/AnnotationJobStatusResponse" }, "examples": { "annotationReplyResponse": { @@ -2853,6 +3215,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -2868,7 +3242,7 @@ "get": { "summary": "查询标注回复配置任务状态", "description": "**适用于**:Chatflow、聊天助手、Agent。\n\n返回由 [配置标注回复](/zh/api-reference/annotations/configure-annotation-reply) 发起的标注回复配置任务的状态。", - "operationId": "getChatAnnotationReplyStatusZh", + "operationId": "get_annotation_reply_action_status", "tags": [ "标注管理" ], @@ -2881,8 +3255,8 @@ "schema": { "type": "string", "enum": [ - "enable", - "disable" + "disable", + "enable" ] } }, @@ -2903,7 +3277,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitialAnnotationReplySettingsStatusResponse" + "$ref": "#/components/schemas/AnnotationJobStatusDetailResponse" }, "examples": { "jobStatus": { @@ -2934,6 +3308,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" } }, "x-mint": { @@ -2949,7 +3341,7 @@ "get": { "summary": "获取工作流执行情况", "description": "**适用于**:Chatflow、Workflow。\n\n获取单次工作流运行的状态、输入、输出和执行指标。", - "operationId": "getWorkflowRunDetailCn", + "operationId": "get_workflow_run_detail", "tags": [ "工作流运行" ], @@ -2970,7 +3362,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowRunDetailResponse" + "$ref": "#/components/schemas/WorkflowRunResponse" }, "examples": { "workflowRunDetail": { @@ -3028,6 +3420,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -3043,87 +3447,101 @@ "get": { "summary": "获取工作流日志", "description": "**适用于**:Chatflow、Workflow。\n\n列出过往的工作流运行,支持可选筛选。每条记录是运行级摘要(状态、Token 用量、步数和耗时),而非逐节点的执行日志。\n\n如需跟踪某次运行的节点级事件,请改用流式方式:\n\n- **自行发起的运行**:以流式模式调用 [执行工作流](/zh/api-reference/workflow-runs/run-workflow),运行执行时会发送 `node_started` 和 `node_finished` 事件。\n- **已在进行中的运行**:调用 [流式获取工作流事件](/zh/api-reference/workflow-runs/stream-workflow-events) 并附带 `include_state_snapshot=true`,先重放各已执行节点的状态,再流式发送其余事件。\n\n已结束运行的节点级日志无法通过服务 API 获取。", - "operationId": "getWorkflowLogsCn", + "operationId": "get_workflow_logs", "tags": [ "工作流运行" ], "parameters": [ { - "name": "keyword", + "name": "created_at__after", "in": "query", - "description": "在日志中搜索的关键词。", + "description": "筛选在此 ISO 8601 时间戳之后创建的日志。", "schema": { - "type": "string" - } + "type": "string", + "format": "date-time", + "description": "筛选在此 ISO 8601 时间戳之后创建的日志。" + }, + "required": false }, { - "name": "status", + "name": "created_at__before", "in": "query", - "description": "按执行状态筛选。", + "description": "筛选在此 ISO 8601 时间戳之前创建的日志。", "schema": { "type": "string", - "enum": [ - "succeeded", - "failed", - "stopped" - ] - } + "format": "date-time", + "description": "筛选在此 ISO 8601 时间戳之前创建的日志。" + }, + "required": false }, { - "name": "page", + "name": "created_by_account", "in": "query", - "description": "页码。", + "description": "按创建者的账户邮箱筛选(例如 `name@example.com`)。", "schema": { - "type": "integer", - "default": 1, - "minimum": 1, - "maximum": 99999 - } + "type": "string" + }, + "required": false }, { - "name": "limit", + "name": "created_by_end_user_session_id", "in": "query", - "description": "每页条目数。", + "description": "按终端用户会话 ID 筛选。", "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100 - } + "type": "string", + "description": "按终端用户会话 ID 筛选。" + }, + "required": false }, { - "name": "created_at__before", + "name": "keyword", "in": "query", - "description": "筛选在此 ISO 8601 时间戳之前创建的日志。", + "description": "在日志中搜索的关键词。", "schema": { "type": "string", - "format": "date-time" - } + "description": "在日志中搜索的关键词。" + }, + "required": false }, { - "name": "created_at__after", + "name": "limit", "in": "query", - "description": "筛选在此 ISO 8601 时间戳之后创建的日志。", + "description": "每页条目数。", "schema": { - "type": "string", - "format": "date-time" - } + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 100, + "description": "每页条目数。" + }, + "required": false }, { - "name": "created_by_end_user_session_id", + "name": "page", "in": "query", - "description": "按终端用户会话 ID 筛选。", + "description": "页码。", "schema": { - "type": "string" - } + "type": "integer", + "default": 1, + "minimum": 1, + "maximum": 99999 + }, + "required": false }, { - "name": "created_by_account", + "name": "status", "in": "query", - "description": "按创建者的账户邮箱筛选(例如 `name@example.com`)。", + "description": "按执行状态筛选。", "schema": { - "type": "string" - } + "type": "string", + "enum": [ + "failed", + "stopped", + "succeeded" + ], + "description": "按执行状态筛选。" + }, + "required": false } ], "responses": { @@ -3132,7 +3550,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowLogsResponse" + "$ref": "#/components/schemas/WorkflowAppLogPaginationResponse" }, "examples": { "workflowLogs": { @@ -3192,6 +3610,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -3210,7 +3640,7 @@ ], "summary": "获取人工介入表单", "description": "**适用于**:Chatflow、Workflow。\n\n返回暂停中的人工介入表单内容。需要 Web 应用提交方式。\n\n人工介入调用的完整流程,参见 [人工介入流程](/zh/api-reference/guides/human-input-flow)。", - "operationId": "getChatflowHumanInputForm", + "operationId": "get_human_input_form", "parameters": [ { "name": "form_token", @@ -3228,153 +3658,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "form_content": { - "type": "string", - "description": "已替换工作流变量的预渲染表单正文。" - }, - "inputs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "表单输入控件类型。可用值:`paragraph`(多行文本输入)、`select`(从列表中单选)、`file`(单个文件上传)和 `file-list`(多个文件上传)。" - }, - "output_variable_name": { - "type": "string", - "description": "引用该输入提交值在工作流中使用的变量名。对应提交 `inputs` 对象中的键。" - }, - "default": { - "type": "object", - "nullable": true, - "description": "`paragraph` 输入的原始默认值配置。客户端不应直接解析此字段,请使用 `resolved_default_values` 来展示默认值。其他输入类型或未配置默认值时,不包含该键。", - "properties": { - "type": { - "type": "string", - "description": "默认值来源。`constant` 表示将 `value` 作为字面字符串;`variable` 表示 `selector` 指向工作流变量。" - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "当 `type` 为 `variable` 时的变量引用路径(例如 `[\"node_id\", \"var_name\"]`)。至少包含两个元素。" - }, - "value": { - "type": "string", - "description": "当 `type` 为 `constant` 时的字面默认值。始终为字符串。" - } - } - }, - "option_source": { - "type": "object", - "description": "`select` 输入的选项来源。仅当 `type` 为 `select` 时出现。", - "properties": { - "type": { - "type": "string", - "enum": [ - "variable", - "constant" - ], - "description": "选项来源。`constant` 表示 `value` 直接列出选项;`variable` 表示 `selector` 指向提供选项的 `array[string]` 工作流变量。" - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "当 `type` 为 `variable` 时的变量引用路径。" - }, - "value": { - "type": "array", - "items": { - "type": "string" - }, - "description": "当 `type` 为 `constant` 时的字面选项列表。" - } - } - }, - "allowed_file_types": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "image", - "document", - "audio", - "video", - "custom" - ] - }, - "description": "接收人可上传的文件类别。`file` 和 `file-list` 输入会包含此字段。可用值:`image`、`document`、`audio`、`video`、`custom`。" - }, - "allowed_file_extensions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "当 `allowed_file_types` 包含 `custom` 时允许的文件扩展名。每个扩展名都需要包含前导 `.`,例如 `.md`。`file` 和 `file-list` 输入会包含此字段。" - }, - "allowed_file_upload_methods": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "local_file", - "remote_url" - ] - }, - "description": "接收人可使用的上传方式。可用值:`local_file`、`remote_url`。`file` 和 `file-list` 输入会包含此字段。" - }, - "number_limits": { - "type": "integer", - "description": "接收人可上传的最大文件数。仅 `file-list` 输入会包含此字段。" - } - } - }, - "description": "表单输入字段定义。" - }, - "resolved_default_values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "用于在表单中展示的预渲染默认值,按输入的 `output_variable_name` 分组。仅当 `paragraph` 输入的默认值可由工作流变量解析时填充;无可解析默认值的输入为空。客户端请直接展示这些值,无需在前端再次解析 `default`。所有值均为字符串。" - }, - "user_actions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "maxLength": 20, - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "操作按钮的标识。当接收人选择该按钮时,作为 `action` 传入 [提交人工介入表单](/zh/api-reference/human-input/submit-human-input-form)。" - }, - "title": { - "type": "string", - "maxLength": 100, - "description": "显示给接收人的按钮文本。" - }, - "button_style": { - "type": "string", - "description": "按钮的视觉样式。可用值:`primary`、`default`、`accent`、`ghost`。" - } - } - }, - "description": "可用的提交操作。" - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix 时间戳(秒),超过该时间后表单将不可提交。", - "nullable": true - } - } + "$ref": "#/components/schemas/HumanInputFormDefinitionResponse" }, "examples": { "success": { @@ -3495,6 +3779,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -3511,7 +3807,7 @@ ], "summary": "提交人工介入表单", "description": "**适用于**:Chatflow、Workflow。\n\n向暂停中的人工介入表单提交接收人的响应。接受后工作流将恢复;可通过 [流式获取工作流事件](/zh/api-reference/workflow-runs/stream-workflow-events) 跟踪恢复后的运行。需要 Web 应用提交方式。", - "operationId": "submitChatflowHumanInputForm", + "operationId": "submit_human_input_form", "parameters": [ { "name": "form_token", @@ -3528,27 +3824,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "inputs", - "action", - "user" - ], - "properties": { - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "按各输入的 `output_variable_name` 作为键提交的值。段落和下拉选项输入为字符串;`file` 输入为单个文件映射;`file-list` 输入为文件映射数组。\n\n文件映射为 `{transfer_method: local_file, upload_file_id, type}` 或 `{transfer_method: remote_url, url, type}`,其中 `type` 为该字段 `allowed_file_types` 中的一种。对于 `local_file`,`upload_file_id` 为 [上传文件](/zh/api-reference/files/upload-file) 返回的 `id`。\n\n在执行、上传和提交各次调用中使用一致的 `user`。" - }, - "action": { - "type": "string", - "description": "接收人选择的操作按钮 ID。必须与表单的 `user_actions` 列表(由 [获取人工介入表单](/zh/api-reference/human-input/get-human-input-form) 接口返回)中的某个 `id` 值匹配。" - }, - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。Service API 与 Web 应用的用户 ID 相互独立,即使取值相同也不指向同一用户。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" - } - } + "$ref": "#/components/schemas/HumanInputFormSubmitPayloadWithUser" }, "examples": { "approve": { @@ -3589,7 +3865,7 @@ "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/HumanInputFormSubmitResponse" }, "examples": { "success": { @@ -3666,6 +3942,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -3684,26 +3972,26 @@ ], "summary": "流式获取工作流事件", "description": "**适用于**:Chatflow、Workflow。\n\n在工作流运行暂停或原始 SSE 连接断开后恢复 Server-Sent Events 流。对于已结束的运行,流仅发送单个 `workflow_finished` 事件后关闭。\n\n如需查看进行中运行的节点级状态与进度,可在调用时附带 `include_state_snapshot=true`:流会先重放各已执行节点的状态,再流式发送新事件。", - "operationId": "streamWorkflowEvents", + "operationId": "get_workflow_events", "parameters": [ { "name": "workflow_run_id", "in": "path", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" }, "description": "要恢复事件流的工作流运行 ID,来自 [执行工作流](/zh/api-reference/workflow-runs/run-workflow) 的响应或流式事件。" }, { - "name": "user", + "name": "continue_on_pause", "in": "query", - "required": true, + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false }, - "description": "终端用户标识,由你的应用定义,需在应用内唯一。必须与发起该运行的 `user` 一致。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" + "description": "设为 `true` 时,流会在多次 `workflow_paused` 事件之间保持打开(适用于工作流包含多个连续人工介入节点的场景)。默认在首次暂停时关闭流。" }, { "name": "include_state_snapshot", @@ -3711,19 +3999,19 @@ "required": false, "schema": { "type": "boolean", - "default": false + "default": false, + "description": "为 `true` 时,从持久化状态快照重放,在流式发送新事件前附带已执行节点的状态摘要。" }, "description": "为 `true` 时,从持久化状态快照重放,在流式发送新事件前附带已执行节点的状态摘要。" }, { - "name": "continue_on_pause", + "name": "user", "in": "query", - "required": false, + "required": true, "schema": { - "type": "boolean", - "default": false + "type": "string" }, - "description": "设为 `true` 时,流会在多次 `workflow_paused` 事件之间保持打开(适用于工作流包含多个连续人工介入节点的场景)。默认在首次暂停时关闭流。" + "description": "终端用户标识,由你的应用定义,需在应用内唯一。必须与发起该运行的 `user` 一致。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" } ], "responses": { @@ -3766,7 +4054,7 @@ } }, "404": { - "description": "`not_found` : Workflow run not found.", + "description": "`not_found` : 未找到工作流运行记录。", "content": { "application/json": { "examples": { @@ -3781,6 +4069,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-codeSamples": [ @@ -3808,7 +4108,7 @@ "post": { "summary": "执行工作流", "description": "**适用于**:Workflow。\n\n运行应用已发布的工作流并返回其输出,可以是单次 `blocking` 响应,也可以是 `streaming` 的 Server-Sent Events 流。需要已发布的工作流。", - "operationId": "executeWorkflowCn", + "operationId": "run_workflow", "tags": [ "工作流运行" ], @@ -3817,7 +4117,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowExecutionRequest" + "$ref": "#/components/schemas/WorkflowRunPayloadWithUser" }, "examples": { "streaming_example": { @@ -4013,6 +4313,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" } }, "x-mint": { @@ -4035,7 +4353,7 @@ "post": { "summary": "按 ID 执行工作流", "description": "**适用于**:Workflow。\n\n运行指定的已发布工作流版本,由路径中的 `workflow_id` 指定。请求体、响应和流式行为与 [执行工作流](/zh/api-reference/workflow-runs/run-workflow) 相同,仅执行的版本不同。", - "operationId": "runWorkflowByIdZh", + "operationId": "run_workflow_by_id", "tags": [ "工作流运行" ], @@ -4055,7 +4373,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WorkflowExecutionRequest" + "$ref": "#/components/schemas/WorkflowRunPayloadWithUser" }, "examples": { "example": { @@ -4262,6 +4580,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -4277,7 +4601,7 @@ "post": { "summary": "停止工作流任务", "description": "**适用于**:Workflow。\n\n停止正在运行的工作流任务。仅在 `streaming` 模式下支持。", - "operationId": "stopWorkflowTaskGenerationCn", + "operationId": "stop_workflow_task", "tags": [ "工作流运行" ], @@ -4297,16 +4621,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。无需与发起该运行的 `user` 一致;停止对该任务始终生效。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" - } - } + "$ref": "#/components/schemas/RequiredServiceApiUserPayload" }, "examples": { "example": { @@ -4321,7 +4636,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleResultResponse" + } + } + }, + "description": "请求成功。" }, "400": { "description": "- `not_workflow_app` : 应用模式与 API 路由不匹配。\n- `invalid_param` : 请求参数缺失或无效,例如缺少 `user`。", @@ -4347,6 +4669,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" } }, "x-mint": { @@ -4362,7 +4702,7 @@ "post": { "summary": "发送消息", "description": "**适用于**:文本生成应用。\n\n向文本生成型应用发送请求并返回生成的文本。", - "operationId": "createCompletionMessage", + "operationId": "create_completion", "tags": [ "文本生成消息" ], @@ -4372,7 +4712,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CompletionRequest" + "$ref": "#/components/schemas/CompletionRequestPayloadWithUser" }, "examples": { "streaming_example": { @@ -4414,7 +4754,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CompletionResponse" + "$ref": "#/components/schemas/CompletionBlockingResponse" }, "examples": { "blockingResponse": { @@ -4551,6 +4891,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" } }, "x-mint": { @@ -4573,7 +4931,7 @@ "post": { "summary": "停止响应", "description": "**适用于**:文本生成应用。\n\n停止文本生成消息生成任务。仅在 `streaming` 模式下支持。", - "operationId": "stopCompletionGeneration", + "operationId": "stop_completion", "tags": [ "文本生成消息" ], @@ -4593,16 +4951,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。必须与发送原始消息时的 `user` 一致;不一致时停止不会生效,但仍返回成功。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" - } - } + "$ref": "#/components/schemas/RequiredServiceApiUserPayload" }, "examples": { "example": { @@ -4617,7 +4966,14 @@ }, "responses": { "200": { - "$ref": "#/components/responses/SuccessResult" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleResultResponse" + } + } + }, + "description": "请求成功。" }, "400": { "description": "- `app_unavailable` : 应用不可用或配置错误。\n- `invalid_param` : 缺少必填的 `user` 字段。", @@ -4643,6 +4999,24 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" } }, "x-mint": { @@ -4661,101 +5035,13 @@ ], "summary": "创建空知识库", "description": "创建一个空知识库。之后用 [从文本创建文档](/zh/api-reference/documents/create-document-by-text) 或 [从文件创建文档](/zh/api-reference/documents/create-document-by-file) 向其中添加文档。", - "operationId": "createDataset", + "operationId": "create_dataset", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 40, - "description": "知识库名称。" - }, - "description": { - "type": "string", - "maxLength": 400, - "default": "", - "description": "知识库描述。" - }, - "indexing_technique": { - "type": "string", - "enum": [ - "high_quality", - "economy" - ], - "nullable": true, - "description": "`high_quality` 使用嵌入模型进行精确搜索;`economy` 使用基于关键词的索引。" - }, - "permission": { - "type": "string", - "enum": [ - "only_me", - "all_team_members", - "partial_members" - ], - "default": "only_me", - "description": "控制谁可以访问此知识库。`only_me` 仅限创建者,`all_team_members` 授权整个工作区访问,`partial_members` 授权指定成员访问。" - }, - "provider": { - "type": "string", - "enum": [ - "vendor", - "external" - ], - "default": "vendor", - "description": "`vendor` 为内部知识库,`external` 为外部知识库。" - }, - "embedding_model": { - "type": "string", - "description": "嵌入模型名称。使用 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `model` 字段值。" - }, - "embedding_model_provider": { - "type": "string", - "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。`openai` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `provider` 字段获取。" - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "检索模型配置。控制查询此知识库时如何搜索和排序分段。" - }, - "external_knowledge_api_id": { - "type": "string", - "description": "外部知识库 API 连接的 ID。" - }, - "external_knowledge_id": { - "type": "string", - "description": "外部知识库的 ID。" - }, - "summary_index_setting": { - "type": "object", - "nullable": true, - "description": "摘要索引配置。", - "properties": { - "enable": { - "type": "boolean", - "description": "是否启用摘要索引。" - }, - "model_name": { - "type": "string", - "description": "用于生成摘要的模型名称。" - }, - "model_provider_name": { - "type": "string", - "description": "摘要生成模型的供应商。" - }, - "summary_prompt": { - "type": "string", - "description": "用于摘要生成的自定义提示词模板。" - } - } - } - } + "$ref": "#/components/schemas/DatasetCreatePayload" } } } @@ -4766,7 +5052,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/DatasetDetailResponse" }, "examples": { "success": { @@ -4876,6 +5162,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -4892,42 +5184,49 @@ ], "summary": "获取知识库列表", "description": "返回知识库的分页列表,可按关键词或标签筛选。", - "operationId": "listDatasets", + "operationId": "list_datasets", "parameters": [ { - "name": "page", + "name": "include_all", "in": "query", "schema": { - "type": "integer", - "default": 1 + "type": "boolean", + "default": false, + "description": "是否包含所有知识库,无论权限如何。" }, - "description": "页码。" + "description": "是否包含所有知识库,无论权限如何。", + "required": false }, { - "name": "limit", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 20 + "type": "string", + "description": "按名称筛选的搜索关键词。" }, - "description": "每页条目数。" + "description": "按名称筛选的搜索关键词。", + "required": false }, { - "name": "keyword", + "name": "limit", "in": "query", "schema": { - "type": "string" + "type": "integer", + "default": 20, + "description": "每页的项目数量。服务器上限为 `100`。" }, - "description": "按名称筛选的搜索关键词。" + "description": "每页条目数。", + "required": false }, { - "name": "include_all", + "name": "page", "in": "query", "schema": { - "type": "boolean", - "default": false + "type": "integer", + "default": 1 }, - "description": "是否包含所有知识库,无论权限如何。" + "description": "页码。", + "required": false }, { "name": "tag_ids", @@ -4938,9 +5237,8 @@ "type": "string" } }, - "style": "form", - "explode": true, - "description": "用于筛选的标签 ID。标签 ID 从 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags) 获取。" + "description": "用于筛选的标签 ID。标签 ID 从 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags) 获取。", + "required": false } ], "responses": { @@ -4949,32 +5247,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "知识库对象数组。", - "items": { - "$ref": "#/components/schemas/Dataset" - } - }, - "has_more": { - "type": "boolean", - "description": "下一页是否还有更多项目。" - }, - "limit": { - "type": "integer", - "description": "每页条目数。" - }, - "total": { - "type": "integer", - "description": "匹配条目的总数。" - }, - "page": { - "type": "integer", - "description": "当前页码。" - } - } + "$ref": "#/components/schemas/DatasetListResponse" }, "examples": { "success": { @@ -5041,6 +5314,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -5059,7 +5344,7 @@ ], "summary": "获取知识库详情", "description": "返回知识库的详细信息,包括嵌入模型、检索配置和文档统计信息。", - "operationId": "getDatasetDetail", + "operationId": "get_dataset", "parameters": [ { "name": "dataset_id", @@ -5078,7 +5363,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/DatasetDetailWithPartialMembersResponse" }, "examples": { "success": { @@ -5171,6 +5456,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -5187,7 +5478,7 @@ ], "summary": "更新知识库", "description": "更新知识库。仅更改请求体中包含的字段。", - "operationId": "updateDataset", + "operationId": "update_dataset", "parameters": [ { "name": "dataset_id", @@ -5205,89 +5496,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 40, - "description": "知识库名称。" - }, - "description": { - "type": "string", - "maxLength": 400, - "description": "知识库描述。" - }, - "indexing_technique": { - "type": "string", - "enum": [ - "high_quality", - "economy" - ], - "nullable": true, - "description": "`high_quality` 使用嵌入模型进行精确搜索;`economy` 使用基于关键词的索引。" - }, - "permission": { - "type": "string", - "enum": [ - "only_me", - "all_team_members", - "partial_members" - ], - "description": "控制谁可以访问此知识库。`only_me` 仅限创建者,`all_team_members` 授权整个工作区访问,`partial_members` 授权指定成员访问。" - }, - "embedding_model": { - "type": "string", - "description": "嵌入模型名称。使用 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `model` 字段值。" - }, - "embedding_model_provider": { - "type": "string", - "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。`openai` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `provider` 字段获取。" - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "检索模型配置。控制查询此知识库时如何搜索和排序分段。" - }, - "partial_member_list": { - "type": "array", - "description": "当 `permission` 为 `partial_members` 时有访问权限的团队成员列表。", - "items": { - "type": "object", - "properties": { - "user_id": { - "type": "string", - "description": "要授予访问权限的团队成员 ID。" - } - } - } - }, - "external_retrieval_model": { - "type": "object", - "description": "外部知识库的检索设置。", - "properties": { - "top_k": { - "type": "integer", - "description": "返回的最大结果数。" - }, - "score_threshold": { - "type": "number", - "description": "用于过滤结果的最低相关性分数阈值。" - }, - "score_threshold_enabled": { - "type": "boolean", - "description": "是否启用分数阈值过滤。" - } - } - }, - "external_knowledge_id": { - "type": "string", - "description": "外部知识库的 ID。" - }, - "external_knowledge_api_id": { - "type": "string", - "description": "外部知识库 API 连接的 ID。" - } - } + "$ref": "#/components/schemas/DatasetUpdatePayload" } } } @@ -5298,7 +5507,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "$ref": "#/components/schemas/DatasetDetailWithPartialMembersResponse" }, "examples": { "success": { @@ -5417,6 +5626,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -5433,7 +5648,7 @@ ], "summary": "删除知识库", "description": "永久删除知识库及其所有文档。", - "operationId": "deleteDataset", + "operationId": "delete_dataset", "parameters": [ { "name": "dataset_id", @@ -5491,6 +5706,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "409": { + "content": { + "application/json": {} + }, + "description": "请求与资源当前状态冲突。" } }, "x-mint": { @@ -5509,7 +5736,7 @@ ], "summary": "从文本创建文档", "description": "在知识库中通过纯文本创建文档。索引异步进行;使用返回的 `batch` ID 通过 [获取文档嵌入状态(进度)](/zh/api-reference/documents/get-document-indexing-status) 跟踪。", - "operationId": "createDocumentFromText", + "operationId": "create_document_by_text", "parameters": [ { "name": "dataset_id", @@ -5527,123 +5754,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name", - "text" - ], - "properties": { - "name": { - "type": "string", - "description": "文档名称。" - }, - "text": { - "type": "string", - "description": "文档文本内容。" - }, - "indexing_technique": { - "type": "string", - "enum": [ - "high_quality", - "economy" - ], - "description": "向知识库添加首个文档时必填。后续文档如果省略此字段,将继承知识库的索引方式。`high_quality` 使用嵌入模型进行精确搜索;`economy` 使用基于关键词的索引。" - }, - "doc_form": { - "type": "string", - "enum": [ - "text_model", - "hierarchical_model", - "qa_model" - ], - "default": "text_model", - "description": "`text_model` 为标准文本分段,`hierarchical_model` 为父子分段结构,`qa_model` 为问答对提取。" - }, - "doc_language": { - "type": "string", - "default": "English", - "description": "用于处理优化的文档语言。" - }, - "process_rule": { - "type": "object", - "description": "分块处理规则。", - "required": [ - "mode" - ], - "properties": { - "mode": { - "type": "string", - "enum": [ - "automatic", - "custom", - "hierarchical" - ], - "description": "`automatic` 使用内置规则,`custom` 允许手动配置,`hierarchical` 启用父子分段结构(配合 `doc_form: hierarchical_model` 使用)。" - }, - "rules": { - "type": "object", - "properties": { - "pre_processing_rules": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "remove_stopwords", - "remove_extra_spaces", - "remove_urls_emails" - ], - "description": "规则标识符。" - }, - "enabled": { - "type": "boolean", - "description": "该预处理规则是否启用。" - } - } - } - }, - "segmentation": { - "type": "object", - "properties": { - "separator": { - "type": "string", - "default": "\n", - "description": "用于拆分文本的自定义分隔符。" - }, - "max_tokens": { - "type": "integer", - "description": "每个分段的最大令牌数。" - }, - "chunk_overlap": { - "type": "integer", - "default": 0, - "description": "分段之间的令牌重叠数。" - } - } - } - } - } - } - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "控制查询此知识库时如何搜索和排序分段。" - }, - "embedding_model": { - "type": "string", - "description": "嵌入模型名称。使用 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `model` 字段值。" - }, - "embedding_model_provider": { - "type": "string", - "description": "嵌入模型供应商。使用 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `provider` 字段值。" - }, - "original_document_id": { - "type": "string", - "description": "用于版本控制的原始文档 ID。从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" - } - } + "$ref": "#/components/schemas/DocumentTextCreatePayload" } } } @@ -5654,16 +5765,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "用于跟踪索引进度的批次 ID。" - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -5780,39 +5882,11 @@ } } }, - "404": { - "description": "`not_found` : 未找到知识库。", - "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } - }, - "503": { - "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -5831,7 +5905,7 @@ ], "summary": "从文件创建文档", "description": "在知识库中通过上传文件创建文档。支持 PDF、TXT、DOCX 等常见格式。索引异步进行;使用返回的 `batch` ID 通过 [获取文档嵌入状态(进度)](/zh/api-reference/documents/get-document-indexing-status) 跟踪。", - "operationId": "createDocumentFromFile", + "operationId": "create_document_by_file", "parameters": [ { "name": "dataset_id", @@ -5875,16 +5949,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "用于跟踪索引进度的批次 ID。" - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -6025,23 +6090,6 @@ } } }, - "404": { - "description": "`not_found` : 未找到知识库。", - "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } - }, "413": { "description": "`file_too_large` : 上传的文件超出最大大小限制。", "content": { @@ -6059,22 +6107,11 @@ } } }, - "503": { - "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -6100,7 +6137,7 @@ ], "summary": "获取知识库的文档列表", "description": "返回知识库中文档的分页列表。", - "operationId": "listDocuments", + "operationId": "list_documents", "parameters": [ { "name": "dataset_id", @@ -6113,30 +6150,35 @@ "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" }, { - "name": "page", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 1 + "type": "string", + "description": "按文档名称筛选的搜索关键词。" }, - "description": "页码。" + "description": "按文档名称筛选的搜索关键词。", + "required": false }, { "name": "limit", "in": "query", "schema": { "type": "integer", - "default": 20 + "default": 20, + "description": "每页的项目数量。服务器上限为 `100`。" }, - "description": "每页的项目数量。服务器上限为 `100`。" + "description": "每页的项目数量。服务器上限为 `100`。", + "required": false }, { - "name": "keyword", + "name": "page", "in": "query", "schema": { - "type": "string" + "type": "integer", + "default": 1 }, - "description": "按文档名称筛选的搜索关键词。" + "description": "页码。", + "required": false }, { "name": "status", @@ -6144,16 +6186,18 @@ "schema": { "type": "string", "enum": [ - "queuing", - "indexing", - "paused", - "error", + "archived", "available", "disabled", - "archived" - ] + "error", + "indexing", + "paused", + "queuing" + ], + "description": "按显示状态筛选。" }, - "description": "按显示状态筛选。" + "description": "按显示状态筛选。", + "required": false } ], "responses": { @@ -6162,32 +6206,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "文档对象数组。", - "items": { - "$ref": "#/components/schemas/Document" - } - }, - "has_more": { - "type": "boolean", - "description": "下一页是否还有更多项目。" - }, - "limit": { - "type": "integer", - "description": "每页条目数。" - }, - "total": { - "type": "integer", - "description": "匹配条目的总数。" - }, - "page": { - "type": "integer", - "description": "当前页码。" - } - } + "$ref": "#/components/schemas/DocumentListResponse" }, "examples": { "success": { @@ -6276,6 +6295,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -6294,7 +6319,7 @@ ], "summary": "获取文档详情", "description": "返回单个文档的详细信息。", - "operationId": "getDocumentDetail", + "operationId": "get_document", "parameters": [ { "name": "dataset_id", @@ -6326,9 +6351,11 @@ "only", "without" ], - "default": "all" + "default": "all", + "description": "`all` 返回所有字段(包括元数据)。`only` 仅返回 `id`、`doc_type` 和 `doc_metadata`。`without` 返回除 `doc_metadata` 外的所有字段。" }, - "description": "`all` 返回所有字段(包括元数据)。`only` 仅返回 `id`、`doc_type` 和 `doc_metadata`。`without` 返回除 `doc_metadata` 外的所有字段。" + "description": "`all` 返回所有字段(包括元数据)。`only` 仅返回 `id`、`doc_type` 和 `doc_metadata`。`without` 返回除 `doc_metadata` 外的所有字段。", + "required": false } ], "responses": { @@ -6337,198 +6364,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "文档标识符。" - }, - "position": { - "type": "integer", - "description": "在知识库中的位置索引。" - }, - "data_source_type": { - "type": "string", - "description": "文档的上传方式。文件上传为 `upload_file`,Notion 导入为 `notion_import`。" - }, - "data_source_info": { - "type": "object", - "description": "数据源详情。文件上传时,此详情接口在 `upload_file` 下返回完整的文件对象,而列表接口仅返回 `upload_file_id`。", - "properties": { - "upload_file": { - "type": "object", - "description": "上传文件的详情。当 `data_source_type` 为 `upload_file` 时返回。", - "properties": { - "id": { - "type": "string", - "description": "文件标识符。" - }, - "name": { - "type": "string", - "description": "原始文件名。" - }, - "size": { - "type": "integer", - "description": "文件大小(字节)。" - }, - "extension": { - "type": "string", - "description": "文件扩展名。" - }, - "mime_type": { - "type": "string", - "description": "文件的 MIME 类型。" - }, - "created_by": { - "type": "string", - "description": "上传该文件的用户 ID。" - }, - "created_at": { - "type": "integer", - "description": "文件上传的 Unix 时间戳。" - } - } - } - } - }, - "dataset_process_rule_id": { - "type": "string", - "description": "应用于该文档的处理规则 ID。" - }, - "dataset_process_rule": { - "type": "object", - "description": "知识库级别的处理规则配置。" - }, - "document_process_rule": { - "type": "object", - "description": "文档级别的处理规则配置。" - }, - "name": { - "type": "string", - "description": "文档名称。" - }, - "created_from": { - "type": "string", - "description": "文档来源。通过 API 创建时为 `api`,通过 UI 创建时为 `web`。" - }, - "created_by": { - "type": "string", - "description": "创建该文档的用户 ID。" - }, - "created_at": { - "type": "number", - "description": "文档创建的 Unix 时间戳。" - }, - "tokens": { - "type": "integer", - "description": "文档中的令牌数。" - }, - "indexing_status": { - "type": "string", - "description": "当前索引状态,例如 `waiting`、`parsing`、`cleaning`、`splitting`、`indexing`、`completed`、`error`、`paused`。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "索引失败时的错误消息,否则为 `null`。" - }, - "enabled": { - "type": "boolean", - "description": "该文档是否启用检索。" - }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "文档被禁用的 Unix 时间戳,启用时为 `null`。" - }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "禁用该文档的用户 ID,启用时为 `null`。" - }, - "archived": { - "type": "boolean", - "description": "文档是否已归档。" - }, - "display_status": { - "type": "string", - "description": "适合 UI 显示的索引状态。" - }, - "hit_count": { - "type": "integer", - "description": "该文档被检索的次数。" - }, - "doc_form": { - "type": "string", - "description": "文档分块模式。`text_model` 表示标准文本,`hierarchical_model` 表示父子结构,`qa_model` 表示问答对。" - }, - "doc_language": { - "type": "string", - "description": "文档内容的语言。" - }, - "doc_type": { - "type": "string", - "nullable": true, - "description": "文档类型分类,未设置时为 `null`。" - }, - "doc_metadata": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "元数据字段标识符。" - }, - "name": { - "type": "string", - "description": "元数据字段名称。" - }, - "type": { - "type": "string", - "description": "元数据字段类型。" - }, - "value": { - "type": "string", - "description": "此文档的元数据字段值。" - } - } - }, - "description": "此文档的自定义元数据键值对。" - }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "处理完成的 Unix 时间戳,尚未完成时为 `null`。" - }, - "updated_at": { - "type": "number", - "nullable": true, - "description": "最后更新的 Unix 时间戳,从未更新时为 `null`。" - }, - "indexing_latency": { - "type": "number", - "nullable": true, - "description": "索引耗时(秒),未完成时为 `null`。" - }, - "segment_count": { - "type": "integer", - "description": "文档中的分段数。" - }, - "average_segment_length": { - "type": "number", - "description": "分段的平均字符长度。" - }, - "summary_index_status": { - "type": "string", - "nullable": true, - "description": "摘要索引的状态,未启用摘要索引时为 `null`。" - }, - "need_summary": { - "type": "boolean", - "description": "该文档是否需要生成摘要。" - } - } + "$ref": "#/components/schemas/DocumentDetailResponse" }, "examples": { "success": { @@ -6652,6 +6488,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -6668,7 +6510,7 @@ ], "summary": "删除文档", "description": "从知识库中永久删除文档及其所有分段。", - "operationId": "deleteDocument", + "operationId": "delete_document", "parameters": [ { "name": "dataset_id", @@ -6752,6 +6594,18 @@ } } } + }, + "400": { + "content": { + "application/json": {} + }, + "description": "请求参数无效。" + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -6768,7 +6622,7 @@ ], "summary": "更新文档", "description": "通过上传新文件更新文档,然后重新索引。这是基于文件更新文档的规范端点。使用返回的 `batch` ID 通过 [获取文档嵌入状态(进度)](/zh/api-reference/documents/get-document-indexing-status) 跟踪进度。", - "operationId": "updateDocument", + "operationId": "update_document_by_file", "parameters": [ { "name": "dataset_id", @@ -6792,7 +6646,7 @@ } ], "requestBody": { - "required": true, + "required": false, "content": { "multipart/form-data": { "schema": { @@ -6819,16 +6673,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "用于跟踪索引进度的批次 ID。" - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -7012,22 +6857,11 @@ } } }, - "503": { - "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -7053,7 +6887,7 @@ ], "summary": "下载文档", "description": "返回用于下载文档原始上传文件的签名 URL。", - "operationId": "downloadDocumentZh", + "operationId": "get_document_download_url", "parameters": [ { "name": "dataset_id", @@ -7082,13 +6916,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "用于下载原始上传文件的签名 URL。" - } - } + "$ref": "#/components/schemas/UrlResponse" }, "examples": { "success": { @@ -7166,6 +6994,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -7184,26 +7018,26 @@ ], "summary": "获取文档嵌入状态(进度)", "description": "返回批次中每个文档的索引进度:当前阶段和分段完成计数。轮询直到每个 `indexing_status` 变为 `completed` 或 `error`。状态按 `waiting` → `parsing` → `cleaning` → `splitting` → `indexing` → `completed` 推进。", - "operationId": "getDocumentIndexingStatus", + "operationId": "get_document_indexing_status", "parameters": [ { - "name": "dataset_id", + "name": "batch", "in": "path", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" }, - "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" + "description": "创建或更新文档时返回的批次 ID。" }, { - "name": "batch", + "name": "dataset_id", "in": "path", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" }, - "description": "创建或更新文档时返回的批次 ID。" + "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" } ], "responses": { @@ -7212,74 +7046,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "文档标识符。" - }, - "indexing_status": { - "type": "string", - "description": "当前索引状态:`waiting`、`parsing`、`cleaning`、`splitting`、`indexing`、`completed` 或 `error`。" - }, - "processing_started_at": { - "type": "number", - "nullable": true, - "description": "处理开始的 Unix 时间戳。" - }, - "parsing_completed_at": { - "type": "number", - "nullable": true, - "description": "解析完成的 Unix 时间戳。" - }, - "cleaning_completed_at": { - "type": "number", - "nullable": true, - "description": "清洗完成的 Unix 时间戳。" - }, - "splitting_completed_at": { - "type": "number", - "nullable": true, - "description": "拆分完成的 Unix 时间戳。" - }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "索引完成的 Unix 时间戳。" - }, - "paused_at": { - "type": "number", - "nullable": true, - "description": "索引暂停的时间戳。未暂停时为 `null`。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "索引失败时的错误信息。无错误时为 `null`。" - }, - "stopped_at": { - "type": "number", - "nullable": true, - "description": "索引停止的时间戳。未停止时为 `null`。" - }, - "completed_segments": { - "type": "integer", - "description": "已索引的分段数。" - }, - "total_segments": { - "type": "integer", - "description": "待索引的分段总数。" - } - } - }, - "description": "索引状态条目列表。" - } - } + "$ref": "#/components/schemas/DocumentStatusListResponse" }, "examples": { "success": { @@ -7348,6 +7115,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -7366,7 +7139,7 @@ ], "summary": "用文本更新文档", "description": "更新文档的文本内容、名称或处理配置。文本变更时会重新索引文档。", - "operationId": "updateDocumentByText", + "operationId": "update_document_by_text", "parameters": [ { "name": "dataset_id", @@ -7394,99 +7167,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "文档名称。当提供 `text` 时必填。" - }, - "text": { - "type": "string", - "description": "文档文本内容。" - }, - "process_rule": { - "type": "object", - "description": "分块处理规则。", - "required": [ - "mode" - ], - "properties": { - "mode": { - "type": "string", - "enum": [ - "automatic", - "custom", - "hierarchical" - ], - "description": "`automatic` 使用内置规则,`custom` 允许手动配置,`hierarchical` 启用父子分段结构(配合 `doc_form: hierarchical_model` 使用)。" - }, - "rules": { - "type": "object", - "properties": { - "pre_processing_rules": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "remove_stopwords", - "remove_extra_spaces", - "remove_urls_emails" - ], - "description": "规则标识符。" - }, - "enabled": { - "type": "boolean", - "description": "该预处理规则是否启用。" - } - } - } - }, - "segmentation": { - "type": "object", - "properties": { - "separator": { - "type": "string", - "default": "\n", - "description": "用于拆分文本的自定义分隔符。" - }, - "max_tokens": { - "type": "integer", - "description": "每个分段的最大令牌数。" - }, - "chunk_overlap": { - "type": "integer", - "default": 0, - "description": "分段之间的令牌重叠数。" - } - } - } - } - } - } - }, - "doc_form": { - "type": "string", - "enum": [ - "text_model", - "hierarchical_model", - "qa_model" - ], - "default": "text_model", - "description": "`text_model` 为标准文本分段,`hierarchical_model` 为父子分段结构,`qa_model` 为问答对提取。" - }, - "doc_language": { - "type": "string", - "default": "English", - "description": "用于处理优化的文档语言。" - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "控制查询此知识库时如何搜索和排序分段。" - } - } + "$ref": "#/components/schemas/DocumentTextUpdate" } } } @@ -7497,16 +7178,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "用于跟踪索引进度的批次 ID。" - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -7648,22 +7320,11 @@ } } }, - "503": { - "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -7682,7 +7343,7 @@ ], "summary": "用文件更新文档", "description": "已弃用。改用 [更新文档](/zh/api-reference/documents/update-document)。通过上传新文件更新文档,然后重新索引。", - "operationId": "updateDocumentByFile", + "operationId": "update_document_by_file_deprecated", "parameters": [ { "name": "dataset_id", @@ -7706,7 +7367,7 @@ } ], "requestBody": { - "required": true, + "required": false, "content": { "multipart/form-data": { "schema": { @@ -7733,16 +7394,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "document": { - "$ref": "#/components/schemas/Document" - }, - "batch": { - "type": "string", - "description": "用于跟踪索引进度的批次 ID。" - } - } + "$ref": "#/components/schemas/DocumentAndBatchResponse" }, "examples": { "success": { @@ -7926,22 +7578,11 @@ } } }, - "503": { - "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "deprecated": true, @@ -7961,7 +7602,7 @@ ], "summary": "批量下载文档(ZIP)", "description": "将一个或多个文档下载为单个 ZIP 压缩包。仅可包含以文件形式上传的文档。", - "operationId": "downloadDocumentsZipZh", + "operationId": "download_documents_as_zip", "parameters": [ { "name": "dataset_id", @@ -7979,22 +7620,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "document_ids" - ], - "properties": { - "document_ids": { - "type": "array", - "minItems": 1, - "maxItems": 100, - "items": { - "type": "string", - "format": "uuid" - }, - "description": "要包含在压缩包中的文档 ID。从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" - } - } + "$ref": "#/components/schemas/DocumentBatchDownloadZipPayload" } } } @@ -8085,6 +7711,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -8103,32 +7735,32 @@ ], "summary": "批量更新文档状态", "description": "在一次请求中批量启用、禁用、归档或取消归档多个文档。", - "operationId": "batchUpdateDocumentStatus", + "operationId": "update_document_status", "parameters": [ { - "name": "dataset_id", + "name": "action", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "archive", + "disable", + "enable", + "un_archive" + ] }, - "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" + "description": "`enable` 启用文档以供检索,`disable` 停用,`archive` 移入归档,`un_archive` 从归档中恢复。" }, { - "name": "action", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", - "enum": [ - "enable", - "disable", - "archive", - "un_archive" - ] + "format": "uuid" }, - "description": "`enable` 启用文档以供检索,`disable` 停用,`archive` 移入归档,`un_archive` 从归档中恢复。" + "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" } ], "requestBody": { @@ -8136,19 +7768,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "document_ids" - ], - "properties": { - "document_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "要更新的文档 ID。文档 ID 从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" - } - } + "$ref": "#/components/schemas/DocumentStatusPayload" } } } @@ -8159,13 +7779,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "操作结果。" - } - } + "$ref": "#/components/schemas/SimpleResultResponse" }, "examples": { "success": { @@ -8228,6 +7842,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -8246,7 +7866,7 @@ ], "summary": "向文档添加分段", "description": "在文档中创建一个或多个分段。", - "operationId": "createSegments", + "operationId": "create_segments", "parameters": [ { "name": "dataset_id", @@ -8274,48 +7894,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "segments" - ], - "properties": { - "segments": { - "type": "array", - "items": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "分段文本内容。", - "minLength": 1 - }, - "answer": { - "type": "string", - "description": "答案文本。问答模式(`qa_model`)文档必填。" - }, - "keywords": { - "type": "array", - "items": { - "type": "string" - }, - "description": "分段的关键词。" - }, - "attachment_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "附件文件 ID。" - } - }, - "required": [ - "content" - ] - }, - "description": "要创建的分段对象数组。", - "minItems": 1 - } - } + "$ref": "#/components/schemas/SegmentCreatePayload" } } } @@ -8326,20 +7905,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Segment" - }, - "description": "已创建的分段列表。" - }, - "doc_form": { - "type": "string", - "description": "该文档使用的分块模式。" - } - } + "$ref": "#/components/schemas/SegmentCreateListResponse" }, "examples": { "success": { @@ -8500,22 +8066,11 @@ } } }, - "503": { - "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -8532,7 +8087,7 @@ ], "summary": "从文档获取分段", "description": "返回文档内分段的分页列表,可按关键词或索引状态筛选。", - "operationId": "listSegments", + "operationId": "list_segments", "parameters": [ { "name": "dataset_id", @@ -8555,14 +8110,14 @@ "description": "文档 ID。从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" }, { - "name": "page", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 1, - "minimum": 1 + "type": "string", + "description": "搜索关键词。" }, - "description": "页码。" + "description": "搜索关键词。", + "required": false }, { "name": "limit", @@ -8570,9 +8125,22 @@ "schema": { "type": "integer", "default": 20, + "minimum": 1, + "description": "每页的项目数量。服务器上限为 `100`。" + }, + "description": "每页的项目数量。服务器上限为 `100`。", + "required": false + }, + { + "name": "page", + "in": "query", + "schema": { + "type": "integer", + "default": 1, "minimum": 1 }, - "description": "每页的项目数量。服务器上限为 `100`。" + "description": "页码。", + "required": false }, { "name": "status", @@ -8583,17 +8151,8 @@ "type": "string" } }, - "style": "form", - "explode": true, - "description": "按索引状态筛选分段,例如 `completed`、`indexing`、`error`。" - }, - { - "name": "keyword", - "in": "query", - "schema": { - "type": "string" - }, - "description": "搜索关键词。" + "description": "按索引状态筛选分段,例如 `completed`、`indexing`、`error`。", + "required": false } ], "responses": { @@ -8602,36 +8161,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Segment" - }, - "description": "分段列表。" - }, - "doc_form": { - "type": "string", - "description": "该文档使用的分块模式。" - }, - "total": { - "type": "integer", - "description": "匹配的分段总数。" - }, - "has_more": { - "type": "boolean", - "description": "下一页是否还有更多项目。" - }, - "limit": { - "type": "integer", - "description": "每页条目数。" - }, - "page": { - "type": "integer", - "description": "当前页码。" - } - } + "$ref": "#/components/schemas/SegmentListResponse" }, "examples": { "success": { @@ -8741,6 +8271,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -8759,7 +8295,7 @@ ], "summary": "获取文档中的分段详情", "description": "获取单个分段的完整详情。", - "operationId": "getSegmentDetail", + "operationId": "get_segment", "parameters": [ { "name": "dataset_id", @@ -8798,16 +8334,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Segment" - }, - "doc_form": { - "type": "string", - "description": "该文档使用的分块模式。" - } - } + "$ref": "#/components/schemas/SegmentDetailResponse" }, "examples": { "success": { @@ -8919,6 +8446,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -8935,7 +8468,7 @@ ], "summary": "更新文档中的分段", "description": "更新分段的字段。更新会为该分段重新触发索引。", - "operationId": "updateSegment", + "operationId": "update_segment", "parameters": [ { "name": "dataset_id", @@ -8973,54 +8506,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "segment" - ], - "properties": { - "segment": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "分段文本内容。" - }, - "answer": { - "type": "string", - "description": "问答模式(`qa_model`)文档的答案文本。" - }, - "keywords": { - "type": "array", - "items": { - "type": "string" - }, - "description": "分段的关键词。" - }, - "enabled": { - "type": "boolean", - "description": "分段是否已启用。" - }, - "regenerate_child_chunks": { - "type": "boolean", - "default": false, - "description": "是否重新生成子分段。" - }, - "attachment_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "附件文件 ID。" - }, - "summary": { - "type": "string", - "nullable": true, - "description": "摘要索引的摘要内容。" - } - }, - "description": "要更新的分段数据。" - } - } + "$ref": "#/components/schemas/SegmentUpdatePayload" } } } @@ -9031,16 +8517,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Segment" - }, - "doc_form": { - "type": "string", - "description": "该文档使用的分块模式。" - } - } + "$ref": "#/components/schemas/SegmentDetailResponse" }, "examples": { "success": { @@ -9177,22 +8654,11 @@ } } }, - "503": { - "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -9209,7 +8675,7 @@ ], "summary": "删除文档中的分段", "description": "从文档中永久删除一个分段。", - "operationId": "deleteSegment", + "operationId": "delete_segment", "parameters": [ { "name": "dataset_id", @@ -9328,6 +8794,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -9346,7 +8818,7 @@ ], "summary": "创建子分段", "description": "在父分段下创建子分段。适用于使用父子(`hierarchical_model`)分块模式的文档。", - "operationId": "createChildChunk", + "operationId": "create_child_chunk", "parameters": [ { "name": "dataset_id", @@ -9384,16 +8856,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "description": "子分段文本内容。" - } - } + "$ref": "#/components/schemas/ChildChunkCreatePayload" } } } @@ -9404,12 +8867,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/ChildChunk" - } - } + "$ref": "#/components/schemas/ChildChunkDetailResponse" }, "examples": { "success": { @@ -9530,22 +8988,11 @@ } } }, - "503": { - "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -9562,7 +9009,7 @@ ], "summary": "获取子分段", "description": "返回特定父分段下子分段的分页列表。", - "operationId": "getChildChunks", + "operationId": "list_child_chunks", "parameters": [ { "name": "dataset_id", @@ -9595,14 +9042,14 @@ "description": "父分段 ID。来自 [从文档获取分段](/zh/api-reference/chunks/list-chunks)。" }, { - "name": "page", + "name": "keyword", "in": "query", "schema": { - "type": "integer", - "default": 1, - "minimum": 1 + "type": "string", + "description": "搜索关键词。" }, - "description": "页码。" + "description": "搜索关键词。", + "required": false }, { "name": "limit", @@ -9610,17 +9057,22 @@ "schema": { "type": "integer", "default": 20, - "minimum": 1 + "minimum": 1, + "description": "每页的项目数量。服务器上限为 `100`。" }, - "description": "每页的项目数量。服务器上限为 `100`。" + "description": "每页的项目数量。服务器上限为 `100`。", + "required": false }, { - "name": "keyword", + "name": "page", "in": "query", "schema": { - "type": "string" + "type": "integer", + "default": 1, + "minimum": 1 }, - "description": "搜索关键词。" + "description": "页码。", + "required": false } ], "responses": { @@ -9629,32 +9081,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ChildChunk" - }, - "description": "子分段列表。" - }, - "total": { - "type": "integer", - "description": "子分段总数。" - }, - "total_pages": { - "type": "integer", - "description": "总页数。" - }, - "page": { - "type": "integer", - "description": "当前页码。" - }, - "limit": { - "type": "integer", - "description": "每页条目数。" - } - } + "$ref": "#/components/schemas/ChildChunkListResponse" }, "examples": { "success": { @@ -9731,6 +9158,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -9749,47 +9182,48 @@ ], "summary": "更新子分段", "description": "更新现有子分段的内容。", - "operationId": "updateChildChunk", + "operationId": "update_child_chunk", "parameters": [ { - "name": "dataset_id", + "name": "child_chunk_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "子分段 ID。" }, - "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" + "description": "子分段 ID。" }, { - "name": "document_id", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, - "description": "文档 ID。从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" + "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" }, { - "name": "segment_id", + "name": "document_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, - "description": "父分段 ID。来自 [从文档获取分段](/zh/api-reference/chunks/list-chunks)。" + "description": "文档 ID。从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" }, { - "name": "child_chunk_id", + "name": "segment_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, - "description": "子分段 ID。" + "description": "父分段 ID。来自 [从文档获取分段](/zh/api-reference/chunks/list-chunks)。" } ], "requestBody": { @@ -9797,16 +9231,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "description": "子分段文本内容。" - } - } + "$ref": "#/components/schemas/ChildChunkUpdatePayload" } } } @@ -9817,12 +9242,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/ChildChunk" - } - } + "$ref": "#/components/schemas/ChildChunkDetailResponse" }, "examples": { "success": { @@ -9943,22 +9363,11 @@ } } }, - "503": { - "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "401": { "content": { - "application/json": { - "examples": { - "service_unavailable": { - "summary": "service_unavailable", - "value": { - "status": 503, - "code": "service_unavailable", - "message": "Unable to verify vector space usage right now. Please try again later." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -9975,47 +9384,48 @@ ], "summary": "删除子分段", "description": "从父分段中永久删除一个子分段。", - "operationId": "deleteChildChunk", + "operationId": "delete_child_chunk", "parameters": [ { - "name": "dataset_id", + "name": "child_chunk_id", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "format": "uuid", + "description": "子分段 ID。" }, - "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" + "description": "子分段 ID。" }, { - "name": "document_id", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, - "description": "文档 ID。从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" + "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" }, { - "name": "segment_id", + "name": "document_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, - "description": "父分段 ID。来自 [从文档获取分段](/zh/api-reference/chunks/list-chunks)。" + "description": "文档 ID。从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" }, { - "name": "child_chunk_id", + "name": "segment_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, - "description": "子分段 ID。" + "description": "父分段 ID。来自 [从文档获取分段](/zh/api-reference/chunks/list-chunks)。" } ], "responses": { @@ -10112,6 +9522,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -10130,7 +9546,7 @@ ], "summary": "从知识库检索分段 / 测试检索", "description": "搜索知识库,返回与查询最相关的分段,可用于生产环境检索和测试检索。", - "operationId": "retrieveSegments", + "operationId": "dataset_hit_testing", "parameters": [ { "name": "dataset_id", @@ -10148,47 +9564,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "query" - ], - "properties": { - "query": { - "type": "string", - "maxLength": 250, - "description": "搜索查询文本。" - }, - "retrieval_model": { - "$ref": "#/components/schemas/RetrievalModel", - "description": "检索模型配置。控制查询此知识库时如何搜索和排序分段。" - }, - "attachment_ids": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true, - "description": "要包含在检索上下文中的附件 ID 列表。" - }, - "external_retrieval_model": { - "type": "object", - "description": "外部知识库的检索设置。", - "properties": { - "top_k": { - "type": "integer", - "description": "返回结果的最大数量。" - }, - "score_threshold": { - "type": "number", - "description": "用于过滤结果的最小相似度分数阈值。" - }, - "score_threshold_enabled": { - "type": "boolean", - "description": "是否启用分数阈值过滤。" - } - } - } - } + "$ref": "#/components/schemas/HitTestingPayload" } } } @@ -10199,231 +9575,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "query": { - "type": "object", - "description": "原始查询对象。", - "properties": { - "content": { - "type": "string", - "description": "查询文本。" - } - } - }, - "records": { - "type": "array", - "items": { - "type": "object", - "properties": { - "segment": { - "type": "object", - "description": "从知识库中匹配的分段。", - "properties": { - "id": { - "type": "string", - "description": "分段的唯一标识符。" - }, - "position": { - "type": "integer", - "description": "分段在文档中的位置。" - }, - "document_id": { - "type": "string", - "description": "该分段所属文档的 ID。" - }, - "content": { - "type": "string", - "description": "分段的文本内容。" - }, - "sign_content": { - "type": "string", - "description": "用于完整性验证的签名内容哈希。" - }, - "answer": { - "type": "string", - "description": "回答内容,用于问答模式文档。" - }, - "word_count": { - "type": "integer", - "description": "分段内容的字数。" - }, - "tokens": { - "type": "integer", - "description": "分段内容的令牌数。" - }, - "keywords": { - "type": "array", - "description": "与该分段关联的关键词,用于基于关键词的检索。", - "items": { - "type": "string" - } - }, - "index_node_id": { - "type": "string", - "description": "向量存储中索引节点的 ID。" - }, - "index_node_hash": { - "type": "string", - "description": "索引内容的哈希值,用于检测变更。" - }, - "hit_count": { - "type": "integer", - "description": "该分段在检索查询中被匹配的次数。" - }, - "enabled": { - "type": "boolean", - "description": "该分段是否启用检索。" - }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "分段被禁用的时间戳。启用时为 `null`。" - }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "禁用该分段的用户 ID。启用时为 `null`。" - }, - "status": { - "type": "string", - "description": "分段的索引状态。" - }, - "created_by": { - "type": "string", - "description": "创建该分段的用户 ID。" - }, - "created_at": { - "type": "number", - "description": "创建时间戳(Unix 纪元,单位为秒)。" - }, - "indexing_at": { - "type": "number", - "nullable": true, - "description": "索引开始的时间戳。尚未开始时为 `null`。" - }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "索引完成的时间戳。尚未完成时为 `null`。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "索引失败时的错误消息。无错误时为 `null`。" - }, - "stopped_at": { - "type": "number", - "nullable": true, - "description": "索引停止的时间戳。未停止时为 `null`。" - }, - "document": { - "type": "object", - "description": "匹配分段的父文档信息。", - "properties": { - "id": { - "type": "string", - "description": "文档的唯一标识符。" - }, - "data_source_type": { - "type": "string", - "description": "文档的创建方式。" - }, - "name": { - "type": "string", - "description": "文档名称。" - }, - "doc_type": { - "type": "string", - "nullable": true, - "description": "文档类型分类。未设置时为 `null`。" - }, - "doc_metadata": { - "type": "object", - "nullable": true, - "description": "文档的元数据值。未配置元数据时为 `null`。" - } - } - } - } - }, - "child_chunks": { - "type": "array", - "description": "使用分层索引时,分段内匹配的子分段。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "子分段的唯一标识符。" - }, - "content": { - "type": "string", - "description": "子分段的文本内容。" - }, - "position": { - "type": "integer", - "description": "子分段在父分段中的位置。" - }, - "score": { - "type": "number", - "description": "子分段的相关性得分。" - } - } - } - }, - "score": { - "type": "number", - "description": "相关性得分。" - }, - "tsne_position": { - "type": "object", - "nullable": true, - "description": "t-SNE 可视化位置。" - }, - "files": { - "type": "array", - "description": "附加到该分段的文件。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "附件文件标识符。" - }, - "name": { - "type": "string", - "description": "原始文件名。" - }, - "size": { - "type": "integer", - "description": "文件大小(字节)。" - }, - "extension": { - "type": "string", - "description": "文件扩展名。" - }, - "mime_type": { - "type": "string", - "description": "文件的 MIME 类型。" - }, - "source_url": { - "type": "string", - "description": "访问附件的 URL。" - } - } - } - }, - "summary": { - "type": "string", - "nullable": true, - "description": "通过摘要索引检索到的摘要内容。" - } - } - }, - "description": "匹配的检索记录列表。" - } - } + "$ref": "#/components/schemas/HitTestingResponse" }, "examples": { "success": { @@ -10597,6 +9749,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -10615,24 +9773,13 @@ ], "summary": "创建知识库标签", "description": "创建用于组织知识库的标签。", - "operationId": "createKnowledgeTag", + "operationId": "create_dataset_tag", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 50, - "description": "标签名称。在工作空间内必须唯一。" - } - } + "$ref": "#/components/schemas/TagCreatePayload" } } } @@ -10643,26 +9790,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "标签标识符。" - }, - "name": { - "type": "string", - "description": "标签显示名称。" - }, - "type": { - "type": "string", - "description": "标签类型。知识库标签始终为 `knowledge`。" - }, - "binding_count": { - "type": "string", - "nullable": true, - "description": "绑定到该标签的知识库数量。" - } - } + "$ref": "#/components/schemas/KnowledgeTagResponse" }, "examples": { "success": { @@ -10694,6 +9822,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -10710,36 +9850,14 @@ ], "summary": "获取知识库标签列表", "description": "返回工作空间中所有的知识库标签。", - "operationId": "getKnowledgeTags", + "operationId": "list_dataset_tags", "responses": { "200": { "description": "标签列表。", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "标签标识符。" - }, - "name": { - "type": "string", - "description": "标签显示名称。" - }, - "type": { - "type": "string", - "description": "标签类型。知识库标签始终为 `knowledge`。" - }, - "binding_count": { - "type": "string", - "nullable": true, - "description": "绑定到该标签的知识库数量。" - } - } - } + "$ref": "#/components/schemas/KnowledgeTagListResponse" }, "examples": { "success": { @@ -10756,6 +9874,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -10772,29 +9902,13 @@ ], "summary": "修改知识库标签", "description": "重命名知识库标签。", - "operationId": "updateKnowledgeTag", + "operationId": "update_dataset_tag", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "tag_id", - "name" - ], - "properties": { - "tag_id": { - "type": "string", - "description": "要重命名的标签 ID。参见 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags)。" - }, - "name": { - "type": "string", - "minLength": 1, - "maxLength": 50, - "description": "标签的新名称。在工作空间内必须唯一。" - } - } + "$ref": "#/components/schemas/TagUpdatePayload" } } } @@ -10805,26 +9919,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "标签标识符。" - }, - "name": { - "type": "string", - "description": "标签显示名称。" - }, - "type": { - "type": "string", - "description": "标签类型。知识库标签始终为 `knowledge`。" - }, - "binding_count": { - "type": "string", - "nullable": true, - "description": "绑定到该标签的知识库数量。" - } - } + "$ref": "#/components/schemas/KnowledgeTagResponse" }, "examples": { "success": { @@ -10873,6 +9968,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -10889,22 +9996,13 @@ ], "summary": "删除知识库标签", "description": "永久删除知识库标签。不会删除已被标记的知识库。", - "operationId": "deleteKnowledgeTag", + "operationId": "delete_dataset_tag", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "tag_id" - ], - "properties": { - "tag_id": { - "type": "string", - "description": "要删除的标签 ID。参见 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags)。" - } - } + "$ref": "#/components/schemas/TagDeletePayload" } } } @@ -10929,6 +10027,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -10947,31 +10057,13 @@ ], "summary": "绑定标签到知识库", "description": "将一个或多个标签绑定到知识库。一个知识库可以有多个标签。", - "operationId": "bindTagsToDataset", + "operationId": "bind_dataset_tags", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "tag_ids", - "target_id" - ], - "properties": { - "tag_ids": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "description": "要绑定的标签 ID。参见 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags)。 未知的标签 ID 会被忽略,不会报错。" - }, - "target_id": { - "type": "string", - "description": "要绑定标签的知识库。参见 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases)。" - } - } + "$ref": "#/components/schemas/TagBindingPayload" } } } @@ -10996,6 +10088,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -11014,35 +10118,13 @@ ], "summary": "解除标签与知识库的绑定", "description": "从知识库中移除一个或多个标签。", - "operationId": "unbindTagFromDataset", + "operationId": "unbind_dataset_tags", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "target_id" - ], - "properties": { - "tag_ids": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "description": "要解绑的标签 ID 列表。未提供旧版 `tag_id` 时必填。参见 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags)。" - }, - "tag_id": { - "type": "string", - "deprecated": true, - "description": "旧版单标签字段。服务端将其归一化为 `tag_ids`。新接入应使用 `tag_ids`。" - }, - "target_id": { - "type": "string", - "description": "要解绑标签的知识库。参见 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases)。" - } - } + "$ref": "#/components/schemas/TagUnbindingPayload" } } } @@ -11067,6 +10149,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -11085,7 +10179,7 @@ ], "summary": "获取知识库绑定的标签", "description": "返回绑定到知识库的标签。", - "operationId": "queryDatasetTags", + "operationId": "get_dataset_tags_binding_status", "parameters": [ { "name": "dataset_id", @@ -11104,30 +10198,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "标签标识符。" - }, - "name": { - "type": "string", - "description": "标签显示名称。" - } - } - }, - "description": "绑定到此知识库的标签列表。" - }, - "total": { - "type": "integer", - "description": "绑定到该知识库的标签总数。" - } - } + "$ref": "#/components/schemas/DatasetBoundTagListResponse" }, "examples": { "success": { @@ -11163,22 +10234,11 @@ } } }, - "404": { - "description": "`not_found` : 未找到知识库。", + "401": { "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -11197,7 +10257,7 @@ ], "summary": "创建元数据字段", "description": "为知识库创建自定义元数据字段,用于给文档标注结构化信息。", - "operationId": "createMetadataFieldZh", + "operationId": "create_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11215,26 +10275,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "type", - "name" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "number", - "time" - ], - "description": "`string` 为文本值,`number` 为数值,`time` 为日期/时间值。" - }, - "name": { - "type": "string", - "description": "元数据字段的名称。在知识库的字段中必须唯一,且不超过 255 个字符。" - } - } + "$ref": "#/components/schemas/MetadataArgs" } } } @@ -11245,21 +10286,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "元数据字段标识符。" - }, - "name": { - "type": "string", - "description": "元数据字段名称。" - }, - "type": { - "type": "string", - "description": "元数据字段类型。" - } - } + "$ref": "#/components/schemas/DatasetMetadataResponse" }, "examples": { "success": { @@ -11332,6 +10359,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -11348,7 +10381,7 @@ ], "summary": "获取元数据字段列表", "description": "返回知识库的所有元数据字段(包括自定义和内置字段),以及使用每个字段的文档数量。", - "operationId": "listMetadataFieldsZh", + "operationId": "get_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11367,38 +10400,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "doc_metadata": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "元数据字段标识符。" - }, - "name": { - "type": "string", - "description": "元数据字段名称。" - }, - "type": { - "type": "string", - "description": "元数据字段类型。" - }, - "count": { - "type": "integer", - "description": "使用该元数据字段的文档数量。" - } - } - }, - "description": "元数据字段定义列表。" - }, - "built_in_field_enabled": { - "type": "boolean", - "description": "该知识库是否启用了内置元数据字段。" - } - } + "$ref": "#/components/schemas/DatasetMetadataListResponse" }, "examples": { "success": { @@ -11452,6 +10454,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -11470,7 +10478,7 @@ ], "summary": "更新元数据字段", "description": "重命名自定义元数据字段。", - "operationId": "updateMetadataFieldZh", + "operationId": "update_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11498,16 +10506,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "字段的新名称。在知识库的字段中必须唯一,且不超过 255 个字符。" - } - } + "$ref": "#/components/schemas/MetadataUpdatePayload" } } } @@ -11518,21 +10517,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "元数据字段标识符。" - }, - "name": { - "type": "string", - "description": "元数据字段名称。" - }, - "type": { - "type": "string", - "description": "元数据字段类型。" - } - } + "$ref": "#/components/schemas/DatasetMetadataResponse" }, "examples": { "success": { @@ -11605,6 +10590,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -11621,7 +10612,7 @@ ], "summary": "删除元数据字段", "description": "永久删除自定义元数据字段。使用过该字段的文档将丢失其对应的值。", - "operationId": "deleteMetadataFieldZh", + "operationId": "delete_dataset_metadata", "parameters": [ { "name": "dataset_id", @@ -11689,6 +10680,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -11707,7 +10704,7 @@ ], "summary": "获取内置元数据字段", "description": "返回系统提供的内置元数据字段。", - "operationId": "getBuiltInMetadataFieldsZh", + "operationId": "get_built_in_fields", "parameters": [ { "name": "dataset_id", @@ -11726,26 +10723,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "fields": { - "type": "array", - "description": "系统提供的元数据字段列表。", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "内置字段标识符。`document_name` 表示文档标题,`uploader` 表示创建者,`upload_date` 表示创建时间,`last_update_date` 表示最后修改时间,`source` 表示文档来源。" - }, - "type": { - "type": "string", - "description": "字段数据类型。文本值为 `string`,日期/时间值为 `time`。" - } - } - } - } - } + "$ref": "#/components/schemas/DatasetMetadataBuiltInFieldsResponse" }, "examples": { "success": { @@ -11796,22 +10774,11 @@ } } }, - "404": { - "description": "`not_found` : 未找到知识库。", + "401": { "content": { - "application/json": { - "examples": { - "not_found": { - "summary": "not_found", - "value": { - "status": 404, - "code": "not_found", - "message": "Dataset not found." - } - } - } - } - } + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -11830,30 +10797,31 @@ ], "summary": "更新内置元数据字段", "description": "启用或禁用知识库的内置元数据字段。", - "operationId": "toggleBuiltInMetadataFieldZh", + "operationId": "toggle_built_in_field", "parameters": [ { - "name": "dataset_id", + "name": "action", "in": "path", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "disable", + "enable" + ], + "description": "`enable` 启用内置元数据字段,`disable` 停用内置元数据字段。" }, - "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" + "description": "`enable` 启用内置元数据字段,`disable` 停用内置元数据字段。" }, { - "name": "action", + "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", - "enum": [ - "enable", - "disable" - ] + "format": "uuid" }, - "description": "`enable` 启用内置元数据字段,`disable` 停用内置元数据字段。" + "description": "知识库 ID。从 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases) 获取。" } ], "responses": { @@ -11862,13 +10830,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "操作结果。" - } - } + "$ref": "#/components/schemas/DatasetMetadataActionResponse" }, "examples": { "success": { @@ -11922,6 +10884,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -11940,7 +10908,7 @@ ], "summary": "批量更新文档元数据", "description": "在一次请求中批量更新多个文档的元数据值。", - "operationId": "batchUpdateDocumentMetadataZh", + "operationId": "update_documents_metadata", "parameters": [ { "name": "dataset_id", @@ -11958,58 +10926,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "operation_data" - ], - "properties": { - "operation_data": { - "type": "array", - "items": { - "type": "object", - "required": [ - "document_id", - "metadata_list" - ], - "properties": { - "document_id": { - "type": "string", - "description": "要更新的文档 ID。参见 [获取知识库的文档列表](/zh/api-reference/documents/list-documents)。" - }, - "metadata_list": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string", - "description": "元数据字段 ID。参见 [获取元数据字段列表](/zh/api-reference/metadata/list-metadata-fields)。" - }, - "name": { - "type": "string", - "description": "元数据字段名称。" - }, - "value": { - "description": "元数据值。可以是字符串、数字或 `null`。" - } - } - }, - "description": "要设置到文档的元数据字段。" - }, - "partial_update": { - "type": "boolean", - "default": false, - "description": "是否部分更新元数据,保留未指定字段的现有值。" - } - } - }, - "description": "文档元数据更新操作,每个文档一个条目。" - } - } + "$ref": "#/components/schemas/MetadataOperationData" } } } @@ -12020,13 +10937,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "操作结果。" - } - } + "$ref": "#/components/schemas/DatasetMetadataActionResponse" }, "examples": { "success": { @@ -12113,6 +11024,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -12131,7 +11048,7 @@ ], "summary": "获取可用模型", "description": "返回指定类型的可用模型。用它查找可配置到知识库的 `text-embedding` 和 `rerank` 模型。", - "operationId": "getAvailableModelsZh", + "operationId": "get_available_models", "parameters": [ { "name": "model_type", @@ -12140,12 +11057,12 @@ "schema": { "type": "string", "enum": [ - "text-embedding", - "rerank", "llm", - "tts", + "moderation", + "rerank", "speech2text", - "moderation" + "text-embedding", + "tts" ] }, "description": "要获取的模型类型。对于知识库配置,使用 `text-embedding` 获取嵌入模型,使用 `rerank` 获取重排序模型。" @@ -12157,133 +11074,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "description": "模型供应商及其可用模型的列表。", - "items": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "description": "模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。旧版供应商可能返回简写形式(例如 `openai`)。" - }, - "label": { - "type": "object", - "description": "供应商的本地化显示名称。", - "properties": { - "en_US": { - "type": "string", - "description": "英文显示名称。" - }, - "zh_Hans": { - "type": "string", - "description": "中文显示名称。" - } - } - }, - "icon_small": { - "type": "object", - "description": "供应商小图标的 URL。", - "properties": { - "en_US": { - "type": "string", - "description": "小图标 URL。" - }, - "zh_Hans": { - "type": "string", - "description": "中文图标 URL。" - } - } - }, - "status": { - "type": "string", - "description": "供应商状态。凭证已配置且有效时为 `active`。" - }, - "models": { - "type": "array", - "description": "该供应商的可用模型列表。", - "items": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "模型标识符。创建或更新知识库时,将此值作为 `embedding_model` 参数使用。" - }, - "label": { - "type": "object", - "description": "模型的本地化显示名称。", - "properties": { - "en_US": { - "type": "string", - "description": "英文模型名称。" - }, - "zh_Hans": { - "type": "string", - "description": "中文模型名称。" - } - } - }, - "model_type": { - "type": "string", - "description": "模型类型,与 `model_type` 路径参数匹配。" - }, - "features": { - "type": "array", - "nullable": true, - "description": "模型支持的功能,无功能时为 `null`。", - "items": { - "type": "string" - } - }, - "fetch_from": { - "type": "string", - "description": "模型定义的来源。`predefined-model` 表示内置模型,`customizable-model` 表示用户自配置的模型。" - }, - "model_properties": { - "type": "object", - "description": "模型特定的属性,例如 `context_size`。" - }, - "status": { - "type": "string", - "description": "模型可用状态。就绪时为 `active`。" - }, - "deprecated": { - "type": "boolean", - "description": "模型是否已弃用。" - }, - "load_balancing_enabled": { - "type": "boolean", - "description": "模型是否启用负载均衡。" - }, - "has_invalid_load_balancing_configs": { - "type": "boolean", - "description": "模型是否存在无效的负载均衡配置。" - } - } - } - }, - "tenant_id": { - "type": "string", - "description": "该供应商配置所属的工作空间 ID。" - }, - "icon_small_dark": { - "type": "object", - "description": "深色模式图标 URL;供应商没有时为 `null`。", - "properties": { - "en_US": { - "type": "string" - }, - "zh_Hans": { - "type": "string" - } - } - } - } - } - } - } + "$ref": "#/components/schemas/ProviderWithModelsListResponse" }, "examples": { "success": { @@ -12329,6 +11120,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -12347,7 +11144,7 @@ ], "summary": "上传流水线文件", "description": "上传文件以在知识流水线中使用。将返回的 `id` 用作 [运行流水线](/zh/api-reference/knowledge-pipeline/run-pipeline) 中 `local_file` 项的 `reference`。", - "operationId": "uploadPipelineFileZh", + "operationId": "knowledgebase_pipeline_file_upload", "requestBody": { "required": true, "content": { @@ -12374,39 +11171,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "已上传文件的唯一标识符。" - }, - "name": { - "type": "string", - "description": "原始文件名。" - }, - "size": { - "type": "integer", - "description": "文件大小(字节)。" - }, - "extension": { - "type": "string", - "description": "文件扩展名。" - }, - "mime_type": { - "type": "string", - "nullable": true, - "description": "文件的 MIME 类型。若上传未包含 MIME 类型则可能为 `null`。" - }, - "created_by": { - "type": "string", - "description": "上传文件的用户 ID。" - }, - "created_at": { - "type": "string", - "nullable": true, - "description": "上传时间戳(ISO 8601 格式)。在记录创建过程中可能为 `null`。" - } - } + "$ref": "#/components/schemas/PipelineUploadFileResponse" }, "examples": { "success": { @@ -12491,6 +11256,18 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } }, "x-mint": { @@ -12516,7 +11293,7 @@ ], "summary": "获取数据源插件列表", "description": "返回知识流水线中已配置的数据源节点,每个节点包含其使用的插件,以及运行该节点所需的元数据。", - "operationId": "listDatasourcePluginsZh", + "operationId": "list_rag_pipeline_datasource_plugins", "parameters": [ { "name": "dataset_id", @@ -12535,7 +11312,8 @@ "type": "boolean", "default": true }, - "description": "是否读取已发布流水线版本的节点,而非草稿版本。" + "description": "是否读取已发布流水线版本的节点,而非草稿版本。", + "required": false } ], "responses": { @@ -12544,65 +11322,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "流水线工作流中数据源节点的 ID。调用 [执行数据源节点](/zh/api-reference/knowledge-pipeline/run-datasource-node) 时作为 `node_id` 传入,或调用 [运行流水线](/zh/api-reference/knowledge-pipeline/run-pipeline) 时作为 `start_node_id` 传入。" - }, - "plugin_id": { - "type": "string", - "description": "提供该节点的数据源插件的 ID。" - }, - "provider_name": { - "type": "string", - "description": "数据源插件注册的提供商名称。" - }, - "datasource_type": { - "type": "string", - "description": "数据源类型。取值为 `local_file`、`online_document`、`online_drive`、`website_crawl` 之一。" - }, - "title": { - "type": "string", - "description": "为该节点配置的显示标题。" - }, - "user_input_variables": { - "type": "array", - "description": "调用方需要为该数据源提供的流水线输入变量,来自节点数据源参数中 `{{#...#}}` 引用的变量。每一项遵循工作流使用的流水线变量结构。", - "items": { - "type": "object", - "additionalProperties": true - } - }, - "credentials": { - "type": "array", - "description": "可用于对该数据源进行认证的凭证列表。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "凭证 ID。调用 [执行数据源节点](/zh/api-reference/knowledge-pipeline/run-datasource-node) 时作为 `credential_id` 传入,或作为 [运行流水线](/zh/api-reference/knowledge-pipeline/run-pipeline) 各数据源项中的 `credential_id` 字段。" - }, - "name": { - "type": "string", - "description": "凭证的显示名称。" - }, - "type": { - "type": "string", - "description": "数据源插件定义的凭证类型。" - }, - "is_default": { - "type": "boolean", - "description": "该凭证是否为提供商的默认凭证。" - } - } - } - } - } - } + "$ref": "#/components/schemas/DatasourcePluginListResponse" }, "examples": { "success": { @@ -12680,6 +11400,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -12698,7 +11424,7 @@ ], "summary": "执行数据源节点", "description": "运行知识流水线中的单个数据源节点,并流式返回其执行事件。", - "operationId": "runDatasourceNodeZh", + "operationId": "run_datasource_node", "parameters": [ { "name": "dataset_id", @@ -12725,38 +11451,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "inputs", - "datasource_type", - "is_published" - ], - "properties": { - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "数据源节点的输入变量。" - }, - "datasource_type": { - "type": "string", - "enum": [ - "online_document", - "local_file", - "website_crawl", - "online_drive" - ], - "description": "数据源类型。" - }, - "credential_id": { - "type": "string", - "nullable": true, - "description": "用于向数据源认证的凭证 ID,来自 [获取数据源插件列表](/zh/api-reference/knowledge-pipeline/list-datasource-plugins) 的 `credentials` 数组。" - }, - "is_published": { - "type": "boolean", - "description": "是否运行节点的已发布版本,而非草稿版本。" - } - } + "$ref": "#/components/schemas/DatasourceNodeRunPayload" } } } @@ -12823,6 +11518,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -12841,7 +11542,7 @@ ], "summary": "运行流水线", "description": "对一个或多个数据源运行完整的知识流水线。`response_mode` 选择流式或阻塞响应。", - "operationId": "runPipelineZh", + "operationId": "run_pipeline", "parameters": [ { "name": "dataset_id", @@ -12859,160 +11560,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "required": [ - "inputs", - "datasource_type", - "datasource_info_list", - "start_node_id", - "is_published", - "response_mode" - ], - "properties": { - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "流水线输入变量的键值对,对应工作流中定义的流水线变量。如果流水线没有输入变量,传 `{}`。" - }, - "datasource_type": { - "type": "string", - "enum": [ - "local_file", - "online_document", - "website_crawl", - "online_drive" - ], - "description": "数据源类型。决定 `datasource_info_list` 中条目所需的字段。" - }, - "datasource_info_list": { - "type": "array", - "description": "待处理的数据源对象列表。条目结构取决于 `datasource_type`。", - "items": { - "oneOf": [ - { - "title": "Local File", - "type": "object", - "required": [ - "reference" - ], - "properties": { - "reference": { - "type": "string", - "description": "使用 [上传流水线文件](/zh/api-reference/knowledge-pipeline/upload-pipeline-file) 端点返回的 `id`。`related_id` 可作为别名使用。" - }, - "name": { - "type": "string", - "description": "文档标题。默认为 `\"untitled\"`。" - } - } - }, - { - "title": "Online Document", - "type": "object", - "required": [ - "workspace_id", - "page" - ], - "properties": { - "workspace_id": { - "type": "string", - "description": "外部平台中的工作空间或数据库 ID(例如 Notion 工作空间 ID)。" - }, - "page": { - "type": "object", - "description": "页面详情。", - "required": [ - "page_id", - "type" - ], - "properties": { - "page_id": { - "type": "string", - "description": "页面标识符。" - }, - "type": { - "type": "string", - "description": "由数据源插件定义的页面类型(例如 `\"page\"`、`\"database\"`)。" - }, - "page_name": { - "type": "string", - "description": "显示名称。默认为 `\"untitled\"`。" - } - } - }, - "credential_id": { - "type": "string", - "description": "用于与外部平台认证的凭证。通过 Dify 控制台管理。如省略,则使用该供应商的默认凭证。" - } - } - }, - { - "title": "Website Crawl", - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "type": "string", - "description": "待爬取的 URL。" - }, - "title": { - "type": "string", - "description": "用作文档名称。默认为 `\"untitled\"`。" - } - } - }, - { - "title": "Online Drive", - "type": "object", - "required": [ - "id", - "type" - ], - "properties": { - "id": { - "type": "string", - "description": "文件或文件夹 ID。" - }, - "type": { - "type": "string", - "enum": [ - "file", - "folder" - ], - "description": "该条目是单个文件还是待展开的文件夹。" - }, - "bucket": { - "type": "string", - "description": "存储桶名称。部分存储供应商需要此字段(例如 S3 兼容存储);如果供应商不使用存储桶,可省略。" - }, - "name": { - "type": "string", - "description": "文件名称。默认为 `\"untitled\"`。" - } - } - } - ] - } - }, - "start_node_id": { - "type": "string", - "description": "开始执行的节点 ID,来自 [获取数据源插件列表](/zh/api-reference/knowledge-pipeline/list-datasource-plugins)。" - }, - "is_published": { - "type": "boolean", - "description": "是否运行流水线的已发布版本,而非当前草稿。运行草稿可测试未发布的更改。" - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" - ], - "description": "流水线执行的响应模式。`streaming` 返回服务器发送事件流,`blocking` 等待并返回完整结果。" - } - } + "$ref": "#/components/schemas/PipelineRunApiEntity" }, "examples": { "local_file": { @@ -13102,9 +11650,8 @@ }, "application/json": { "schema": { - "type": "object", "description": "完整的流水线执行结果。当 `response_mode` 为 `blocking` 时返回。", - "additionalProperties": true + "$ref": "#/components/schemas/PipelineRunJsonResponse" }, "examples": { "success": { @@ -13192,6 +11739,12 @@ } } } + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" } }, "x-mint": { @@ -13202,679 +11755,591 @@ } } } - } - }, - "components": { - "securitySchemes": { - "ApiKeyAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "API_KEY", - "description": "每个请求都通过 API Key 认证:`Authorization: Bearer {API_KEY}`。应用接口使用应用 API Key,知识库接口使用知识库 API Key([快速开始](/zh/api-reference/guides/get-started))。\n\nAPI Key 应保存在服务端,切勿嵌入客户端代码。缺失或无效的 Key 会返回 HTTP `401`(`unauthorized`)。" - } }, - "responses": { - "SuccessResult": { - "description": "操作成功。", - "content": { - "application/json": { + "/datasets/{dataset_id}/document/create_by_file": { + "post": { + "deprecated": true, + "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + "operationId": "create_document_by_file_75a87285", + "parameters": [ + { + "in": "path", + "name": "dataset_id", + "required": true, "schema": { - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "操作结果,固定为 `success`。" - } - } - }, - "examples": { - "success": { - "summary": "响应示例", - "value": { - "result": "success" - } - } + "format": "uuid", + "type": "string" } } - } - } - }, - "schemas": { - "ChatRequest": { - "type": "object", - "required": [ - "inputs", - "query", - "user" ], - "properties": { - "query": { - "type": "string", - "description": "用户发送的消息。" - }, - "inputs": { - "type": "object", - "description": "应用输入变量的值,以变量名为键。变量名称和类型可从 [获取应用参数](/zh/api-reference/applications/get-app-parameters) 响应中的 `user_input_form` 字段获取。", - "additionalProperties": true - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" - ], - "description": "响应返回模式。省略时默认为阻塞模式。\n\n- `streaming`(推荐):回复以 Server-Sent Events 形式返回。\n- `blocking`:生成完成后一次性返回。生成时间较长时有中断风险:在 Dify Cloud 上,如果边缘代理在超时时间内未收到响应,就可能中断连接。\n- Agent 和新 Agent 应用仅支持 `streaming`;使用 `blocking` 会返回 400。" - }, - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。会话、消息和文件仅对携带相同 `user` 的请求可见。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" - }, - "conversation_id": { - "type": "string", - "description": "要继续的会话 ID。省略此字段或传入空字符串可开始新会话;响应会返回一个 `conversation_id`,在下一条消息中带上它即可。要恢复较早的会话,可从 [获取会话列表](/zh/api-reference/conversations/list-conversations) 获取其 ID。" - }, - "files": { - "type": "array", - "description": "要附加到消息的文件。本地文件需先通过 [上传文件](/zh/api-reference/files/upload-file) 上传,再将返回的 `id` 作为 `upload_file_id` 引用,并设置 `transfer_method: local_file`。新 Agent 应用接受文件引用,但不会处理其内容。", - "items": { - "type": "object", - "required": [ - "type", - "transfer_method" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "document", - "audio", - "video", - "custom" - ], - "description": "文件类型。" - }, - "transfer_method": { - "type": "string", - "enum": [ - "remote_url", - "local_file" - ], - "description": "传输方式:文件 URL 使用 `remote_url`,上传文件使用 `local_file`。" - }, - "url": { - "type": "string", - "format": "url", - "description": "文件 URL(当 `transfer_method` 为 `remote_url` 时必填)。" + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "data": { + "type": "string" + }, + "file": { + "format": "binary", + "type": "string" + } }, - "upload_file_id": { - "type": "string", - "description": "通过 [上传文件](/zh/api-reference/files/upload-file) API 获取的已上传文件 ID(当 `transfer_method` 为 `local_file` 时必填)。" - } + "required": [ + "file" + ], + "type": "object" } } }, - "auto_generate_name": { - "type": "boolean", - "description": "自动生成会话标题。如果为 `false`,请使用 [重命名会话](/zh/api-reference/conversations/rename-conversation) API 并设置 `auto_generate: true` 来异步生成标题。", - "default": true - }, - "workflow_id": { - "type": "string", - "description": "仅适用于 Chatflow 应用。 指定要执行的已发布工作流版本 ID。如果未提供,将使用最新发布的版本。在 Dify Cloud 上,指定版本需要付费套餐。" - } - } - }, - "ChatCompletionResponse": { - "type": "object", - "properties": { - "event": { - "type": "string", - "description": "事件类型,固定为 `message`。" - }, - "task_id": { - "type": "string", - "format": "uuid", - "description": "用于请求追踪和停止响应 API 的任务 ID。" - }, - "id": { - "type": "string", - "format": "uuid", - "description": "该响应事件的唯一 ID。" - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "唯一的消息 ID。调用反馈或推荐问题接口时,将此值作为 `message_id` 参数使用。" + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" + } + } + }, + "description": "文档创建成功。" }, - "conversation_id": { - "type": "string", - "format": "uuid", - "description": "会话 ID。" + "400": { + "content": { + "application/json": {} + }, + "description": "请求参数无效。" }, - "mode": { - "type": "string", - "description": "应用模式。`chat` 表示聊天助手应用,`agent-chat` 表示 Agent 应用,`advanced-chat` 表示 Chatflow 应用。" + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" }, - "answer": { - "type": "string", - "description": "完整的响应内容。" + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" }, - "metadata": { - "type": "object", - "description": "包含用量和检索资源的元数据。", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" - }, - "retriever_resources": { - "type": "array", - "description": "使用的检索资源列表。", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } + "413": { + "content": { + "application/json": {} + }, + "description": "请求失败。" + } + }, + "summary": "已弃用的兼容端点", + "tags": [ + "文档" + ] + } + }, + "/datasets/{dataset_id}/document/create_by_text": { + "post": { + "deprecated": true, + "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + "operationId": "create_document_by_text_deprecated", + "parameters": [ + { + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentTextCreatePayload" } } }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "消息创建时间戳(Unix 纪元秒)。" - } - } - }, - "ChunkChatEvent": { - "type": "object", - "description": "流式模式下 Server-Sent Event 块的基础 schema。", - "properties": { - "event": { - "type": "string", - "description": "事件类型。", - "enum": [ - "message", - "agent_message", - "agent_thought", - "tts_message", - "tts_message_end", - "message_file", - "message_end", - "message_replace", - "reasoning_chunk", - "workflow_started", - "workflow_finished", - "node_started", - "node_finished", - "node_retry", - "iteration_started", - "iteration_next", - "iteration_completed", - "loop_started", - "loop_next", - "loop_completed", - "workflow_paused", - "human_input_required", - "human_input_form_filled", - "human_input_form_timeout", - "agent_log", - "text_chunk", - "error", - "ping" - ] - } + "required": true }, - "discriminator": { - "propertyName": "event", - "mapping": { - "message": "#/components/schemas/StreamEventChatMessage", - "agent_message": "#/components/schemas/StreamEventChatAgentMessage", - "tts_message": "#/components/schemas/StreamEventChatTtsMessage", - "tts_message_end": "#/components/schemas/StreamEventChatTtsMessageEnd", - "agent_thought": "#/components/schemas/StreamEventChatAgentThought", - "message_file": "#/components/schemas/StreamEventChatMessageFile", - "message_end": "#/components/schemas/StreamEventChatMessageEnd", - "message_replace": "#/components/schemas/StreamEventChatMessageReplace", - "error": "#/components/schemas/StreamEventChatError", - "ping": "#/components/schemas/StreamEventChatPing", - "reasoning_chunk": "#/components/schemas/StreamEventChatReasoningChunk", - "workflow_started": "#/components/schemas/StreamEventWorkflowStarted", - "workflow_finished": "#/components/schemas/StreamEventWorkflowFinished", - "node_started": "#/components/schemas/StreamEventNodeStarted", - "node_finished": "#/components/schemas/StreamEventNodeFinished", - "node_retry": "#/components/schemas/StreamEventNodeRetry", - "iteration_started": "#/components/schemas/StreamEventIterationStarted", - "iteration_next": "#/components/schemas/StreamEventIterationNext", - "iteration_completed": "#/components/schemas/StreamEventIterationCompleted", - "loop_started": "#/components/schemas/StreamEventLoopStarted", - "loop_next": "#/components/schemas/StreamEventLoopNext", - "loop_completed": "#/components/schemas/StreamEventLoopCompleted", - "workflow_paused": "#/components/schemas/StreamEventWorkflowPaused", - "human_input_required": "#/components/schemas/StreamEventHumanInputRequired", - "human_input_form_filled": "#/components/schemas/StreamEventHumanInputFormFilled", - "human_input_form_timeout": "#/components/schemas/StreamEventHumanInputFormTimeout", - "agent_log": "#/components/schemas/StreamEventAgentLog", - "text_chunk": "#/components/schemas/StreamEventChatTextChunk" - } - } - }, - "StreamEventBase": { - "type": "object", - "description": "流式事件的基础属性。", - "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "任务 ID。" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" + } + } + }, + "description": "请求成功。" }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "唯一消息 ID。" + "400": { + "content": { + "application/json": {} + }, + "description": "请求参数无效。" }, - "conversation_id": { - "type": "string", - "format": "uuid", - "description": "会话 ID。" + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "创建时间戳。" + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" } - } - }, - "StreamEventChatMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, + }, + "tags": [ + "service_api" + ], + "summary": "已弃用的兼容端点" + } + }, + "/datasets/{dataset_id}/documents/{document_id}/update_by_file": { + "post": { + "deprecated": true, + "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + "operationId": "update_document_by_file_deprecated_5dc5fe59", + "parameters": [ { - "$ref": "#/components/schemas/StreamEventBase" + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } }, { - "type": "object", - "properties": { - "answer": { - "type": "string", - "description": "LLM 返回的文本块。" - } + "in": "path", + "name": "document_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" } } - ] - }, - "StreamEventChatAgentMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "properties": { - "answer": { - "type": "string", - "description": "LLM 返回的文本块(Agent 模式)。" + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "data": { + "type": "string" + }, + "file": { + "format": "binary", + "type": "string" + } + }, + "type": "object" } } - } - ] - }, - "StreamEventChatTtsMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "TTS 音频流事件(base64 编码的 Mp3)。自动播放启用时可用。", - "properties": { - "audio": { - "type": "string", - "format": "byte", - "description": "Base64 编码的 MP3 音频块。按顺序解码并拼接所有块即可生成完整的音频文件。" + "required": false + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" + } } - } - } - ] - }, - "StreamEventChatTtsMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + }, + "description": "文档更新成功。" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "400": { + "content": { + "application/json": {} + }, + "description": "请求参数无效。" }, - { - "type": "object", - "description": "TTS 音频流结束事件。", - "properties": { - "audio": { - "type": "string", - "description": "空字符串。标识音频流结束。" - } - } - } - ] - }, - "StreamEventChatAgentThought": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" }, - { - "type": "object", - "description": "Agent 思考、LLM 推理、工具调用详情(Agent 模式)。", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Agent 思考 ID。" - }, - "position": { - "type": "integer", - "description": "该思考在消息序列中的位置。" - }, - "thought": { - "type": "string", - "description": "LLM 正在思考的内容。" - }, - "observation": { - "type": "string", - "description": "工具调用的响应。" - }, - "tool": { - "type": "string", - "description": "调用的工具列表,以 `;` 分隔。" - }, - "tool_input": { - "type": "string", - "description": "工具输入(JSON 格式)。" - }, - "message_files": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - }, - "description": "与该思考相关的文件 ID 列表。" - } - } - } - ] - }, - "StreamEventChatMessageFile": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "413": { + "content": { + "application/json": {} + }, + "description": "请求失败。" }, - { - "type": "object", - "description": "消息文件事件,由工具创建的新文件。", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "文件唯一 ID。" - }, - "type": { - "type": "string", - "description": "文件类型,例如 `image`。" - }, - "belongs_to": { - "type": "string", - "description": "该文件的所属者。工具生成的文件始终为 `assistant`。" - }, - "url": { - "type": "string", - "format": "url", - "description": "文件的远程 URL。" - } - } + "415": { + "content": { + "application/json": {} + }, + "description": "请求失败。" } + }, + "summary": "已弃用的兼容端点", + "tags": [ + "文档" ] - }, - "StreamEventChatMessageEnd": { - "allOf": [ + } + }, + "/datasets/{dataset_id}/documents/{document_id}/update_by_text": { + "post": { + "deprecated": true, + "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + "operationId": "update_document_by_text_deprecated", + "parameters": [ { - "$ref": "#/components/schemas/ChunkChatEvent" + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } }, { - "$ref": "#/components/schemas/StreamEventBase" + "in": "path", + "name": "document_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentTextUpdate" + } + } }, - { - "type": "object", - "description": "消息结束事件,流式传输已结束。", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "消息的唯一 ID。" - }, - "metadata": { - "type": "object", - "description": "包含用量和检索资源的元数据。", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" - }, - "retriever_resources": { - "type": "array", - "description": "使用的检索资源列表。", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } - } + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DocumentAndBatchResponse" } } - } - } - ] - }, - "StreamEventChatMessageReplace": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + }, + "description": "请求成功。" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" }, + "404": { + "content": { + "application/json": {} + }, + "description": "找不到请求的资源。" + } + }, + "tags": [ + "service_api" + ], + "summary": "已弃用的兼容端点" + } + }, + "/datasets/{dataset_id}/hit-testing": { + "post": { + "deprecated": true, + "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + "operationId": "dataset_hit_testing_f584b2dd", + "parameters": [ { - "type": "object", - "description": "消息内容替换事件(例如由于内容审核)。", - "properties": { - "answer": { - "type": "string", - "description": "替换内容。" - }, - "reason": { - "type": "string", - "description": "内容替换的原因。" - } + "in": "path", + "name": "dataset_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" } } - ] - }, - "StreamEventChatError": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "流式输出过程中的错误事件。", - "properties": { - "status": { - "type": "integer", - "description": "HTTP 状态码。" - }, - "code": { - "type": "string", - "description": "错误码。" - }, - "message": { - "type": "string", - "description": "错误信息。" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HitTestingPayload" } } - } - ] - }, - "StreamEventChatPing": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" }, - { - "type": "object", - "description": "Ping 事件,用于保持连接活跃。以 `event: ping` 行的形式送达,无 `data:` 载荷。对 Chatflow 应用,`ping` 也是每个流的第一个事件。" + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HitTestingResponse" + } + } + }, + "description": "检索结果。" + }, + "400": { + "content": { + "application/json": {} + }, + "description": "请求参数无效。" + }, + "401": { + "content": { + "application/json": {} + }, + "description": "身份验证失败:API 令牌无效。" + }, + "403": { + "content": { + "application/json": {} + }, + "description": "没有访问此资源的权限。" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "`not_found` : 知识库未找到。" + }, + "500": { + "content": { + "application/json": {} + }, + "description": "`internal_server_error` : 检索过程中发生内部错误。" } + }, + "summary": "已弃用的兼容端点", + "tags": [ + "知识库" ] + } + } + }, + "components": { + "securitySchemes": { + "Bearer": { + "bearerFormat": "API_KEY", + "description": "每个请求都通过 API Key 认证:`Authorization: Bearer {API_KEY}`。应用接口使用应用 API Key,知识库接口使用知识库 API Key([快速开始](/zh/api-reference/guides/get-started))。\n\nAPI Key 应保存在服务端,切勿嵌入客户端代码。缺失或无效的 Key 会返回 HTTP `401`(`unauthorized`)。", + "scheme": "bearer", + "type": "http" + } + }, + "responses": { + "AppInvokeQuotaExceededError": { + "description": "请求失败。" + }, + "Exception": { + "description": "请求失败。" }, - "Usage": { + "HTTPException": { + "description": "请求失败。" + }, + "MaskError": { + "description": "请求失败。" + }, + "ParseError": { + "description": "请求失败。" + }, + "PluginRuntimeError": { + "description": "请求失败。" + }, + "ValueError": { + "description": "请求失败。" + } + }, + "schemas": { + "RetrieverResource": { "type": "object", - "description": "模型使用信息。", + "description": "检索资源的引用和归属信息。", "properties": { - "prompt_tokens": { - "type": "integer", - "description": "提示词中的令牌数。" - }, - "prompt_unit_price": { - "type": "string", - "format": "decimal", - "description": "每个提示词令牌的单价。" - }, - "prompt_price_unit": { + "id": { "type": "string", - "format": "decimal", - "description": "提示词令牌的价格单位。" + "format": "uuid", + "description": "检索资源的唯一 ID。" }, - "prompt_price": { + "message_id": { "type": "string", - "format": "decimal", - "description": "提示词令牌的总价。" + "format": "uuid", + "description": "该资源所属消息的 ID。" }, - "completion_tokens": { + "position": { "type": "integer", - "description": "补全内容中的令牌数。" - }, - "completion_unit_price": { - "type": "string", - "format": "decimal", - "description": "每个补全令牌的单价。" - }, - "completion_price_unit": { - "type": "string", - "format": "decimal", - "description": "补全令牌的价格单位。" - }, - "completion_price": { - "type": "string", - "format": "decimal", - "description": "补全令牌的总价。" - }, - "total_tokens": { - "type": "integer", - "description": "使用的令牌总数。" - }, - "total_price": { - "type": "string", - "format": "decimal", - "description": "所有令牌的总价。" - }, - "currency": { - "type": "string", - "description": "计价货币。" - }, - "latency": { - "type": "number", - "format": "double", - "description": "延迟时间(秒)。" - } - } - }, - "RetrieverResource": { - "type": "object", - "description": "检索资源的引用和归属信息。", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "检索资源的唯一 ID。" - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "该资源所属消息的 ID。" - }, - "position": { - "type": "integer", - "description": "资源在列表中的位置。" + "description": "资源在列表中的位置。" }, "dataset_id": { - "type": "string", - "format": "uuid", - "description": "知识库 ID。" + "description": "知识库 ID。", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "dataset_name": { - "type": "string", - "description": "知识库名称。" + "description": "知识库名称。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "document_id": { - "type": "string", - "format": "uuid", - "description": "文档 ID。" + "description": "文档 ID。", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "document_name": { - "type": "string", - "description": "文档名称。" + "description": "文档名称。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "data_source_type": { - "type": "string", - "description": "数据源类型。" + "description": "数据源类型。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "segment_id": { - "type": "string", - "format": "uuid", - "description": "文档中特定块的 ID。" + "description": "文档中特定块的 ID。", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "score": { - "type": "number", - "format": "float", - "description": "资源的相关性评分。" + "description": "资源的相关性评分。", + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "null" + } + ], + "default": null }, "hit_count": { - "type": "integer", - "description": "该块被命中的次数。" + "description": "该块被命中的次数。", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, "word_count": { - "type": "integer", - "description": "块的字数。" + "description": "块的字数。", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, "segment_position": { - "type": "integer", - "description": "块在文档中的位置。" + "description": "块在文档中的位置。", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, "index_node_hash": { - "type": "string", - "description": "索引节点的哈希值。" + "description": "索引节点的哈希值。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "content": { - "type": "string", - "description": "资源的内容片段。" + "description": "资源的内容片段。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "summary": { "type": "string", @@ -13882,92 +12347,22 @@ "description": "块内容的摘要。" }, "created_at": { - "type": "integer", - "format": "int64", - "description": "创建时间戳(Unix 纪元秒)。" - } - } - }, - "FileUploadResponse": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "唯一文件 ID。" - }, - "reference": { - "type": "string", - "nullable": true, - "description": "在 Agent 和工具场景中附加文件时内部使用的不透明文件引用。通过此端点上传的文件始终为 `null`。" - }, - "name": { - "type": "string", - "description": "文件名。" - }, - "size": { - "type": "integer", - "description": "文件大小(字节)。" - }, - "extension": { - "type": "string", - "nullable": true, - "description": "文件扩展名。" - }, - "mime_type": { - "type": "string", - "nullable": true, - "description": "文件的 MIME 类型。" - }, - "created_by": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "上传者的终端用户 ID。可通过 [获取终端用户信息](/zh/api-reference/end-users/get-end-user-info) 查询详情。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "上传时间戳(Unix 纪元秒)。" - }, - "preview_url": { - "type": "string", - "nullable": true, - "description": "文件的预览 URL。" - }, - "source_url": { - "type": "string", - "description": "文件的签名下载 URL。" - }, - "original_url": { - "type": "string", - "nullable": true, - "description": "文件的原始 URL。" - }, - "user_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "未使用,始终为 `null`。" - }, - "tenant_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "关联的租户 ID。" - }, - "conversation_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "关联的会话 ID。" - }, - "file_key": { - "type": "string", - "nullable": true, - "description": "未使用,始终为 `null`。" + "description": "创建时间戳(Unix 纪元秒)。", + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "position" + ] }, "EndUserDetail": { "type": "object", @@ -13983,24 +12378,45 @@ "description": "租户 ID。" }, "app_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "应用 ID。" + "description": "应用 ID。", + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "type": { "type": "string", "description": "终端用户类型。Service API 用户固定为 `service-api`。" }, "external_user_id": { - "type": "string", - "nullable": true, - "description": "API 请求中提供的 `user` 标识符(例如 [发送对话消息](/zh/api-reference/chat-messages/send-chat-message) 中的 `user` 字段)。" + "description": "API 请求中提供的 `user` 标识符(例如 [发送对话消息](/zh/api-reference/chat-messages/send-chat-message) 中的 `user` 字段)。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "name": { - "type": "string", - "nullable": true, - "description": "终端用户名称。" + "description": "终端用户名称。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "is_anonymous": { "type": "boolean", @@ -14020,5651 +12436,11488 @@ "format": "date-time", "description": "最后更新时间戳。" } - } + }, + "required": [ + "created_at", + "id", + "is_anonymous", + "session_id", + "tenant_id", + "type", + "updated_at" + ] }, - "MessageFeedbackRequest": { + "AppInfoResponse": { "type": "object", - "description": "提交消息反馈的请求体。", - "required": [ - "user" - ], "properties": { - "rating": { + "name": { "type": "string", - "enum": [ - "like", - "dislike", - null - ], - "nullable": true, - "description": "反馈评分。设为 `null` 可撤销之前提交的反馈。" + "description": "应用名称。" }, - "user": { + "description": { "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。反馈按终端用户隔离,必须与收到该消息的 `user` 一致。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" + "description": "应用描述。" }, - "content": { + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "应用标签。" + }, + "mode": { "type": "string", - "description": "提供额外详情的可选文字反馈。" + "description": "应用模式。`completion` 为文本生成应用,`chat` 为基础对话应用,`agent-chat` 为 Agent 应用,`advanced-chat` 为 Chatflow 应用,`workflow` 为 Workflow 应用,`agent` 为新 Agent 应用。" + }, + "author_name": { + "description": "应用作者名称。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } - } + }, + "required": [ + "author_name", + "description", + "mode", + "name", + "tags" + ] }, - "AppFeedbacksResponse": { + "AppMetaResponse": { "type": "object", "properties": { - "data": { - "type": "array", - "description": "反馈项列表。", - "items": { - "$ref": "#/components/schemas/FeedbackItem" - } + "tool_icons": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "format": "url", + "type": "string" + }, + { + "$ref": "#/components/schemas/ToolIcon" + } + ] + }, + "description": "工具图标。键为工具名称。" } } }, - "FeedbackItem": { + "HumanInputContent": { "type": "object", - "description": "单条反馈项。", + "description": "人工介入节点的执行内容,包括表单定义和提交数据。", "properties": { - "id": { + "workflow_run_id": { "type": "string", - "format": "uuid", - "description": "反馈 ID。" + "description": "该内容所属的工作流运行 ID。" }, - "app_id": { - "type": "string", - "format": "uuid", - "description": "应用 ID。" - }, - "conversation_id": { - "type": "string", - "format": "uuid", - "description": "会话 ID。" - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "消息 ID。" - }, - "rating": { - "type": "string", - "description": "反馈评分。`like` 为正面,`dislike` 为负面。" - }, - "content": { - "type": "string", - "nullable": true, - "description": "可选的文字反馈。" - }, - "from_source": { - "type": "string", - "description": "反馈来源。`user` 为终端用户通过 API 提交的反馈,`admin` 为从控制台提交的反馈。" - }, - "from_end_user_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "提交反馈的终端用户 ID。当 `from_source` 为 `user` 时存在。" + "submitted": { + "type": "boolean", + "description": "人工介入表单是否已提交。" }, - "from_account_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "提交反馈的账户 ID。当 `from_source` 为 `admin` 时存在。" + "type": { + "description": "`human_input` 表示人工介入内容。", + "$ref": "#/components/schemas/ExecutionContentType", + "default": "human_input" }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "创建时间戳。" + "form_definition": { + "description": "人工介入节点的表单定义。当内容表示提交响应时为 `null`。", + "anyOf": [ + { + "$ref": "#/components/schemas/HumanInputFormDefinition" + }, + { + "type": "null" + } + ], + "default": null }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "最后更新时间戳。" + "form_submission_data": { + "description": "已提交的表单数据。表单尚未提交时为 `null`。", + "anyOf": [ + { + "$ref": "#/components/schemas/HumanInputFormSubmissionData" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "submitted", + "workflow_run_id" + ] }, - "SuggestedQuestionsResponse": { + "HumanInputFormDefinition": { "type": "object", + "description": "由人工介入节点渲染的人工介入表单定义。", "properties": { - "result": { + "form_id": { "type": "string", - "description": "结果状态。" - }, - "data": { - "type": "array", - "items": { - "type": "string" - }, - "description": "建议问题列表。" - } - } - }, - "ConversationHistoryResponse": { - "type": "object", - "properties": { - "limit": { - "type": "integer", - "description": "每页条目数。" - }, - "has_more": { - "type": "boolean", - "description": "是否有更多消息。" + "description": "表单唯一标识符。" }, - "data": { - "type": "array", - "description": "消息列表。", - "items": { - "$ref": "#/components/schemas/ConversationMessageItem" - } - } - } - }, - "ConversationMessageItem": { - "type": "object", - "properties": { - "id": { + "node_id": { "type": "string", - "format": "uuid", - "description": "消息 ID。" + "description": "生成该表单的人工介入节点 ID。" }, - "conversation_id": { + "node_title": { "type": "string", - "format": "uuid", - "description": "会话 ID。" + "description": "人工介入节点的标题。" }, - "parent_message_id": { + "form_content": { "type": "string", - "format": "uuid", - "nullable": true, - "description": "线程会话的父消息 ID。" + "description": "与表单一起显示的 Markdown 或文本内容。" }, "inputs": { - "type": "object", - "additionalProperties": true, - "description": "该消息的输入变量。" - }, - "query": { - "type": "string", - "description": "用户查询文本。" - }, - "answer": { - "type": "string", - "description": "助手回答文本。" - }, - "status": { - "type": "string", - "description": "消息状态。成功消息为 `normal`,生成失败时为 `error`。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "当 `status` 为 `error` 时的错误消息。" - }, - "message_files": { - "type": "array", - "description": "附加到该消息的文件。", - "items": { - "$ref": "#/components/schemas/MessageFileItem" - } - }, - "feedback": { - "type": "object", - "nullable": true, - "description": "该消息的用户反馈。", - "properties": { - "rating": { - "type": "string", - "description": "反馈评分。`like` 为正面,`dislike` 为负面。" - } - } - }, - "retriever_resources": { "type": "array", - "description": "该消息使用的检索资源。", + "description": "表单中的输入字段。", "items": { - "$ref": "#/components/schemas/RetrieverResource" + "$ref": "#/components/schemas/FormInputConfig" } }, - "agent_thoughts": { + "actions": { "type": "array", - "description": "该消息的 Agent 思考。", + "description": "表单上可用的操作按钮。", "items": { - "$ref": "#/components/schemas/AgentThoughtItem" + "$ref": "#/components/schemas/UserActionConfig" } }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "创建时间戳(Unix 纪元秒)。" - }, - "extra_contents": { - "type": "array", - "description": "与此消息关联的附加执行内容,例如 Chatflow 工作流中人工介入节点的表单数据。", - "items": { - "$ref": "#/components/schemas/HumanInputContent" - } + "display_in_ui": { + "type": "boolean", + "description": "表单是否应在 UI 中显示。", + "default": false }, - "message_tokens": { - "type": "integer", - "description": "输入消息的 token 数量。" + "form_token": { + "description": "表单提交认证的令牌。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "answer_tokens": { - "type": "integer", - "description": "生成回答的 token 数量。" + "resolved_default_values": { + "type": "object", + "additionalProperties": true, + "description": "表单输入的已解析默认值,按输出变量名称索引。" }, - "total_tokens": { + "expiration_time": { "type": "integer", - "description": "使用的 token 总数,即 `message_tokens` 与 `answer_tokens` 之和。" - }, - "provider_response_latency": { - "type": "number", - "format": "double", - "description": "模型供应商的响应延迟,单位为秒。" - }, - "total_price": { - "type": "string", - "format": "decimal", - "nullable": true, - "description": "所用 token 的总价,无定价信息时为 `null`。" - }, - "currency": { - "type": "string", - "nullable": true, - "description": "`total_price` 的货币单位(例如 `USD`),无定价信息时为 `null`。" + "description": "表单过期的 Unix 时间戳。" } - } + }, + "required": [ + "expiration_time", + "form_content", + "form_id", + "node_id", + "node_title" + ] }, - "MessageFileItem": { + "HumanInputFormSubmissionData": { "type": "object", - "description": "附加到消息的文件。", + "description": "来自已提交的人工介入表单的数据。", "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "File ID." - }, - "filename": { + "node_id": { "type": "string", - "description": "原始文件名。" + "description": "人工介入节点的 ID。" }, - "type": { + "node_title": { "type": "string", - "description": "文件类型,例如 `image`。" + "description": "人工介入节点的标题。" }, - "url": { + "rendered_content": { "type": "string", - "format": "url", - "nullable": true, - "description": "文件的预览 URL。" + "description": "表单提交的渲染内容。" }, - "mime_type": { + "action_id": { "type": "string", - "nullable": true, - "description": "文件的 MIME 类型。" - }, - "size": { - "type": "integer", - "nullable": true, - "description": "文件大小(字节)。" + "description": "被点击的操作按钮的 ID。" }, - "transfer_method": { + "action_text": { "type": "string", - "description": "使用的传输方式。`remote_url` 表示基于 URL 的文件,`local_file` 表示已上传的文件,`tool_file` 表示工具生成的文件。" + "description": "被点击的操作按钮的显示文本。" }, - "belongs_to": { - "type": "string", - "nullable": true, - "description": "该文件的所属者。用户上传的文件为 `user`,助手生成的文件为 `assistant`。" + "submitted_data": { + "anyOf": [ + { + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "action_id", + "action_text", + "node_id", + "node_title", + "rendered_content" + ] + }, + "WorkflowBlockingResponse": { + "anyOf": [ + { + "$ref": "#/components/schemas/WorkflowFinishedBlockingResponse" }, - "upload_file_id": { - "type": "string", - "format": "uuid", - "nullable": true, - "description": "通过 `local_file` 传输时的上传文件 ID。" + { + "$ref": "#/components/schemas/WorkflowPausedBlockingResponse" } - } + ] }, - "AgentThoughtItem": { + "RetrievalModel": { "type": "object", - "description": "消息中的 Agent 思考步骤。", + "required": [ + "reranking_enable", + "score_threshold_enabled", + "search_method", + "top_k" + ], "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Agent 思考 ID。" + "search_method": { + "description": "用于检索的搜索方法。", + "$ref": "#/components/schemas/RetrievalMethod" }, - "chain_id": { - "type": "string", - "nullable": true, - "description": "该思考的链 ID。" + "reranking_enable": { + "type": "boolean", + "description": "是否启用重排序。" }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "该思考所属的唯一消息 ID。" + "reranking_model": { + "description": "重排序模型配置。", + "anyOf": [ + { + "$ref": "#/components/schemas/RerankingModel" + }, + { + "type": "null" + } + ], + "default": null }, - "position": { - "type": "integer", - "description": "该思考的位置。" + "reranking_mode": { + "description": "重排序模式。当 `reranking_enable` 为 `true` 时必填。", + "anyOf": [ + { + "enum": [ + "reranking_model", + "weighted_score" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "thought": { - "type": "string", - "description": "LLM 正在思考的内容。" - }, - "tool": { - "type": "string", - "description": "调用的工具,以 `;` 分隔。" - }, - "tool_labels": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "已使用工具的标签。" + "top_k": { + "type": "integer", + "description": "返回的最大结果数。" }, - "tool_input": { - "type": "string", - "description": "工具输入(JSON 格式)。" + "score_threshold_enabled": { + "type": "boolean", + "description": "是否启用分数阈值过滤。" }, - "observation": { - "type": "string", - "description": "工具调用的响应。" + "score_threshold": { + "description": "结果的最低相关性分数。仅在 `score_threshold_enabled` 为 `true` 时生效。", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null }, - "files": { - "type": "array", - "items": { - "type": "string" - }, - "description": "与该思考相关的文件 ID。" + "weights": { + "description": "混合搜索的权重配置。", + "anyOf": [ + { + "$ref": "#/components/schemas/WeightModel" + }, + { + "type": "null" + } + ], + "default": null }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "创建时间戳。" + "metadata_filtering_conditions": { + "description": "仅检索文档元数据匹配指定条件的分段。条件由服务端基于文档元数据字段评估。", + "anyOf": [ + { + "$ref": "#/components/schemas/MetadataFilteringCondition" + }, + { + "type": "null" + } + ], + "default": null } } }, - "ConversationsListResponse": { - "type": "object", + "AgentThought": { "properties": { - "limit": { - "type": "integer", - "description": "每页条目数。" + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "has_more": { - "type": "boolean", - "description": "是否有更多会话。" + "chain_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "data": { - "type": "array", - "description": "会话列表。", + "created_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "files": { "items": { - "$ref": "#/components/schemas/ConversationListItem" - } - } - } - }, - "ConversationListItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "会话 ID。" + "type": "string" + }, + "type": "array" }, - "name": { - "type": "string", - "description": "会话名称。" + "id": { + "type": "string" }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "会话的输入变量。" + "message_id": { + "type": "string" }, - "status": { - "type": "string", - "description": "会话状态。活跃会话为 `normal`。" + "observation": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "introduction": { - "type": "string", - "description": "会话介绍。" + "position": { + "type": "integer" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "创建时间戳。" + "thought": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "updated_at": { - "type": "integer", - "format": "int64", - "description": "最后更新时间戳。" - } - } - }, - "ConversationRenameRequest": { - "type": "object", - "description": "重命名会话的请求体。", - "properties": { - "name": { - "type": "string", - "description": "新的会话名称。除非 `auto_generate` 为 `true`,否则必填。" + "tool": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "auto_generate": { - "type": "boolean", - "default": false, - "description": "自动生成会话名称。当为 `true` 时,`name` 字段将被忽略。" + "tool_input": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" + "tool_labels": { + "$ref": "#/components/schemas/JSONValue" } - } + }, + "required": [ + "files", + "id", + "message_id", + "position", + "tool_labels" + ], + "type": "object" }, - "ConversationVariablesResponse": { - "type": "object", + "Annotation": { "properties": { - "limit": { - "type": "integer", - "description": "每页条目数。" + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "has_more": { - "type": "boolean", - "description": "是否有下一页。" + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "hit_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "data": { - "type": "array", - "description": "会话变量列表。", - "items": { - "$ref": "#/components/schemas/ConversationVariableItem" - } - } - } - }, - "ConversationVariableItem": { - "type": "object", - "properties": { "id": { - "type": "string", "format": "uuid", - "description": "Variable ID." - }, - "name": { - "type": "string", - "description": "变量名称。" - }, - "value_type": { - "type": "string", - "description": "变量值类型。可选值:`string`、`number`、`object`、`secret`、`file`、`boolean`、`array[any]`、`array[string]`、`array[number]`、`array[object]`、`array[file]`、`array[boolean]`。" - }, - "value": { - "type": "string", - "description": "变量值(复杂类型可以是 JSON 字符串)。" - }, - "description": { - "type": "string", - "description": "变量描述。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "创建时间戳。" + "type": "string" }, - "updated_at": { - "type": "integer", - "format": "int64", - "description": "最后更新时间戳。" + "question": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } - } - }, - "ConversationVariableUpdateRequest": { - "type": "object", - "description": "更新会话变量的请求体。", + }, "required": [ - "value" + "id" ], + "type": "object" + }, + "AnnotationCreatePayload": { "properties": { - "value": { - "description": "变量的新值。必须与变量的预期类型匹配。" + "answer": { + "type": "string" }, - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" + "question": { + "type": "string" } - } - }, - "AudioToTextRequest": { - "type": "object", - "description": "语音转文字的请求体。", + }, "required": [ - "file" + "answer", + "question" ], + "type": "object" + }, + "AnnotationJobStatusDetailResponse": { "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "要转写的音频文件。接受的 MIME 类型:`audio/mp3`、`audio/m4a`(也接受 `audio/x-m4a`)、`audio/wav`、`audio/amr`、`audio/mpga`。其他类型(包括常见的 `audio/mpeg`)会返回 `unsupported_audio_type` 错误。最大 `30 MB`。" + "error_msg": { + "default": "", + "type": "string" }, - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" + "job_id": { + "format": "uuid", + "type": "string" + }, + "job_status": { + "type": "string" } - } + }, + "required": [ + "job_id", + "job_status" + ], + "type": "object" }, - "AudioToTextResponse": { - "type": "object", + "AnnotationJobStatusResponse": { "properties": { - "text": { - "type": "string", - "description": "语音识别输出的文字。" + "job_id": { + "format": "uuid", + "type": "string" + }, + "job_status": { + "type": "string" } - } + }, + "required": [ + "job_id", + "job_status" + ], + "type": "object" }, - "TextToAudioRequest": { - "type": "object", - "description": "文字转语音的请求体。提供 `message_id` 或 `text` 其中之一。", + "AnnotationList": { "properties": { - "message_id": { - "type": "string", - "format": "uuid", - "description": "要转为语音的消息答案的 ID。同时提供 `text` 时,优先使用 `message_id`。消息 ID 从 [获取会话历史消息](/zh/api-reference/conversations/list-conversation-messages) 获取。" + "data": { + "items": { + "$ref": "#/components/schemas/Annotation" + }, + "type": "array" }, - "text": { - "type": "string", - "description": "要合成为语音的文本。" + "has_more": { + "type": "boolean" }, - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" + "limit": { + "type": "integer" }, - "voice": { - "type": "string", - "description": "文字转语音使用的声音。可用声音取决于为此应用配置的 TTS 提供商。使用[获取应用参数](/zh/api-reference/applications/get-app-parameters) → `text_to_speech.voice` 中的 `voice` 值作为默认值。" + "page": { + "type": "integer" }, - "streaming": { - "type": "boolean", - "description": "为向后兼容而保留,但不产生任何效果。音频是否以流式返回由配置的 TTS 供应商的输出决定,而非此字段。" + "total": { + "type": "integer" } - } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "type": "object" }, - "AppInfoResponse": { - "type": "object", + "AnnotationListQuery": { "properties": { - "name": { - "type": "string", - "description": "应用名称。" - }, - "description": { - "type": "string", - "description": "应用描述。" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "应用标签。" + "keyword": { + "default": "", + "description": "按问题或回答内容筛选标注的关键词。", + "type": "string" }, - "mode": { - "type": "string", - "description": "应用模式。`completion` 为文本生成应用,`chat` 为基础对话应用,`agent-chat` 为 Agent 应用,`advanced-chat` 为 Chatflow 应用,`workflow` 为 Workflow 应用,`agent` 为新 Agent 应用。" + "limit": { + "default": 20, + "description": "每页条目数。", + "minimum": 1, + "type": "integer" }, - "author_name": { - "type": "string", - "description": "应用作者名称。" + "page": { + "default": 1, + "minimum": 1, + "type": "integer" } - } + }, + "type": "object" }, - "UserInputFormItem": { - "type": "object", - "oneOf": [ - { - "$ref": "#/components/schemas/TextInputControlWrapper" + "AnnotationReplyActionPayload": { + "properties": { + "embedding_model_name": { + "type": "string" }, - { - "$ref": "#/components/schemas/ParagraphControlWrapper" + "embedding_provider_name": { + "type": "string" }, - { - "$ref": "#/components/schemas/SelectControlWrapper" - } - ] - }, - "TextInputControlWrapper": { - "title": "Text Input", - "type": "object", - "properties": { - "text-input": { - "$ref": "#/components/schemas/TextInputControl" - } - } - }, - "ParagraphControlWrapper": { - "title": "Paragraph", - "type": "object", - "properties": { - "paragraph": { - "$ref": "#/components/schemas/ParagraphControl" + "score_threshold": { + "description": "标注被视为匹配的最低相似度分数。值越高,要求匹配越精确。", + "format": "float", + "type": "number" } - } + }, + "required": [ + "embedding_model_name", + "embedding_provider_name", + "score_threshold" + ], + "type": "object" }, - "SelectControlWrapper": { - "title": "Select", - "type": "object", + "AppFeedbackListResponse": { "properties": { - "select": { - "$ref": "#/components/schemas/SelectControl" + "data": { + "items": { + "$ref": "#/components/schemas/AppFeedbackResponse" + }, + "type": "array" } - } + }, + "required": [ + "data" + ], + "type": "object" }, - "TextInputControl": { - "type": "object", + "AppFeedbackResponse": { "properties": { - "label": { - "type": "string", - "description": "表单字段的显示标签。" + "app_id": { + "format": "uuid", + "type": "string" }, - "variable": { - "type": "string", - "description": "用作 `inputs` 对象中键的变量名。" + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "required": { - "type": "boolean", - "description": "提交前是否必须填写此字段。" + "conversation_id": { + "format": "uuid", + "type": "string" }, - "default": { - "type": "string", - "description": "表单字段中预填的默认值。" - } - } - }, - "ParagraphControl": { - "type": "object", - "properties": { - "label": { - "type": "string", - "description": "表单字段的显示标签。" + "created_at": { + "type": "string" }, - "variable": { - "type": "string", - "description": "用作 `inputs` 对象中键的变量名。" + "from_account_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "required": { - "type": "boolean", - "description": "提交前是否必须填写此字段。" + "from_end_user_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "default": { - "type": "string", - "description": "表单字段中预填的默认值。" - } - } - }, - "SelectControl": { - "type": "object", - "properties": { - "label": { - "type": "string", - "description": "表单字段的显示标签。" + "from_source": { + "type": "string" }, - "variable": { - "type": "string", - "description": "用作 `inputs` 对象中键的变量名。" + "id": { + "format": "uuid", + "type": "string" }, - "required": { - "type": "boolean", - "description": "提交前是否必须做出选择。" + "message_id": { + "format": "uuid", + "type": "string" }, - "default": { - "type": "string", - "description": "默认选中的值。" + "rating": { + "type": "string" }, - "options": { - "type": "array", - "items": { - "type": "string" - }, - "description": "此表单控件的可选值列表。" + "updated_at": { + "type": "string" } - } + }, + "required": [ + "app_id", + "conversation_id", + "created_at", + "from_source", + "id", + "message_id", + "rating", + "updated_at" + ], + "type": "object" }, - "AppMetaResponse": { - "type": "object", + "AudioBinaryResponse": { + "format": "binary", + "type": "string" + }, + "AudioTranscriptResponse": { "properties": { - "tool_icons": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "title": "Icon URL", - "type": "string", - "format": "url", - "description": "图标的 URL。" - }, - { - "$ref": "#/components/schemas/ToolIconDetail" - } - ] - }, - "description": "工具图标。键为工具名称。" + "text": { + "type": "string" } - } + }, + "required": [ + "text" + ], + "type": "object" }, - "ToolIconDetail": { - "title": "Emoji Icon", - "type": "object", - "description": "使用 emoji 的工具图标详情。", + "BinaryFileResponse": { + "format": "binary", + "type": "string" + }, + "BlockingMetadataResponse": { + "additionalProperties": true, "properties": { - "background": { - "type": "string", - "description": "十六进制格式的背景颜色。" + "retriever_resources": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/BlockingRetrieverResourceResponse" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null }, - "content": { - "type": "string", - "description": "Emoji 内容。" + "usage": { + "anyOf": [ + { + "$ref": "#/components/schemas/BlockingUsageResponse" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "type": "object" }, - "WebAppSettingsResponse": { - "type": "object", + "BlockingRetrieverResourceResponse": { + "additionalProperties": true, "properties": { - "title": { - "type": "string", - "description": "Web 应用标题。" + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "chat_color_theme": { - "type": "string", - "description": "聊天主题颜色。" + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "chat_color_theme_inverted": { - "type": "boolean", - "description": "聊天主题颜色是否反转。" + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "icon_type": { - "type": "string", - "description": "使用的图标类型。`emoji` 为表情图标,`image` 为上传的图片图标。" + "dataset_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "icon": { - "type": "string", - "description": "图标内容(表情或图片 ID)。" + "dataset_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "icon_background": { - "type": "string", - "description": "图标背景颜色。" + "document_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "icon_url": { - "type": "string", - "format": "url", - "nullable": true, - "description": "图标图片的 URL。" + "document_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "description": { - "type": "string", - "description": "Web 应用描述。" + "hit_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "copyright": { - "type": "string", - "description": "版权文本。" + "id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "privacy_policy": { - "type": "string", - "description": "隐私政策 URL。" + "index_node_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "input_placeholder": { - "type": "string", - "nullable": true, - "description": "Web 应用消息输入框中显示的占位文本。未配置时为 `null`。" + "message_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "custom_disclaimer": { - "type": "string", - "description": "自定义免责声明文本。" + "position": { + "type": "integer" }, - "default_language": { - "type": "string", - "description": "默认语言代码。" + "score": { + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "null" + } + ], + "default": null }, - "show_workflow_steps": { - "type": "boolean", - "description": "是否显示工作流步骤。" + "segment_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "use_icon_as_answer_icon": { - "type": "boolean", - "description": "是否使用应用图标作为回答图标。" + "segment_position": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "word_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "position" + ], + "type": "object" }, - "AnnotationListResponse": { - "type": "object", + "BlockingUsageResponse": { + "additionalProperties": true, "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AnnotationItem" - }, - "description": "当前页面的标注项列表。" + "completion_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "has_more": { - "type": "boolean", - "description": "如果当前结果集之后还有更多页面,则为 `true`。" + "completion_price_unit": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "limit": { - "type": "integer", - "description": "每页条目数。" + "completion_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "total": { - "type": "integer", - "description": "匹配查询条件的标注总数。" + "completion_unit_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "page": { - "type": "integer", - "description": "当前页码。" - } - } - }, - "AnnotationItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "标注唯一标识符。" + "currency": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "question": { - "type": "string", - "nullable": true, - "description": "触发该标注的问题文本。" + "latency": { + "anyOf": [ + { + "format": "double", + "type": "number" + }, + { + "type": "null" + } + ], + "default": null }, - "answer": { - "type": "string", - "nullable": true, - "description": "标注被匹配时返回的预定义回答。" + "prompt_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "hit_count": { - "type": "integer", - "nullable": true, - "description": "该标注被匹配并作为回复返回的次数。" + "prompt_price_unit": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "created_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "创建时间戳(Unix 纪元秒)。" - } - } - }, - "CreateAnnotationRequest": { - "type": "object", - "description": "创建新标注的请求体。", - "required": [ - "question", - "answer" - ], - "properties": { - "question": { - "type": "string", - "description": "应用用来匹配用户输入的问题文本。" + "prompt_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "answer": { - "type": "string", - "description": "命中该标注时返回的答案。" - } - } - }, - "UpdateAnnotationRequest": { - "type": "object", - "description": "更新标注的请求体。", - "required": [ - "question", - "answer" - ], - "properties": { - "question": { - "type": "string", - "description": "标注的新问题文本。" + "prompt_unit_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "answer": { - "type": "string", - "description": "标注的新答案文本。" + "total_price": { + "anyOf": [ + { + "format": "decimal", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "type": "object" }, - "InitialAnnotationReplySettingsRequest": { - "type": "object", - "description": "配置标注回复设置的请求体。", - "required": [ - "score_threshold", - "embedding_provider_name", - "embedding_model_name" + "ButtonStyle": { + "enum": [ + "accent", + "default", + "ghost", + "primary" ], - "properties": { - "embedding_provider_name": { - "type": "string", - "description": "嵌入模型供应商(例如 `openai`)。可用供应商从 [获取可用模型](/zh/api-reference/models/get-available-models) 获取。" + "type": "string" + }, + "ChatBlockingResponse": { + "discriminator": { + "mapping": { + "message": "#/components/schemas/ChatMessageBlockingResponse", + "workflow_paused": "#/components/schemas/ChatPausedBlockingResponse" }, - "embedding_model_name": { - "type": "string", - "description": "用于将标注向量化以进行匹配的嵌入模型(例如 `text-embedding-3-small`)。" + "propertyName": "event" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ChatMessageBlockingResponse" }, - "score_threshold": { - "type": "number", - "format": "float", - "description": "标注被视为匹配的最低相似度分数。值越高,要求匹配越精确。" + { + "$ref": "#/components/schemas/ChatPausedBlockingResponse" } - } + ] }, - "InitialAnnotationReplySettingsResponse": { - "type": "object", + "ChatMessageBlockingResponse": { + "additionalProperties": true, "properties": { - "job_id": { - "type": "string", + "answer": { + "type": "string" + }, + "conversation_id": { "format": "uuid", - "description": "异步任务 ID。配合 [查询标注回复配置任务状态](/zh/api-reference/annotations/get-annotation-reply-job-status) 使用以跟踪进度。" + "type": "string" }, - "job_status": { - "type": "string", - "description": "当前任务状态,仅为 `waiting`(排队中)或 `processing`(处理中);`completed` 和 `error` 仅由 [查询标注回复配置任务状态](/zh/api-reference/annotations/get-annotation-reply-job-status) 返回。" - } - } - }, - "InitialAnnotationReplySettingsStatusResponse": { - "type": "object", - "properties": { - "job_id": { - "type": "string", + "created_at": { + "format": "int64", + "type": "integer" + }, + "event": { + "const": "message", + "type": "string" + }, + "id": { "format": "uuid", - "description": "来自 [配置标注回复](/zh/api-reference/annotations/configure-annotation-reply) 调用的任务 ID。" + "type": "string" }, - "job_status": { - "type": "string", - "description": "当前任务状态。`waiting` 表示排队中,`processing` 表示处理中,`completed` 表示已完成,`error` 表示失败。" + "message_id": { + "format": "uuid", + "type": "string" }, - "error_msg": { - "type": "string", - "description": "描述任务失败原因的错误消息。当 `job_status` 不是 `error` 时为空字符串。" + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "type": "string" + }, + "task_id": { + "format": "uuid", + "type": "string" } - } + }, + "required": [ + "answer", + "conversation_id", + "created_at", + "event", + "id", + "message_id", + "metadata", + "mode", + "task_id" + ], + "type": "object" }, - "AppParametersResponse": { - "type": "object", + "ChatPauseReasonResponse": { + "additionalProperties": true, "properties": { - "opening_statement": { - "type": "string", - "nullable": true, - "description": "开场白文本。" + "TYPE": { + "type": "string" }, - "suggested_questions": { - "type": "array", + "actions": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "type": "array" + }, + "approval_channels": { "items": { "type": "string" }, - "description": "建议问题列表。" + "type": "array" }, - "suggested_questions_after_answer": { - "type": "object", - "description": "回答后建议问题的配置。", - "properties": { - "enabled": { - "type": "boolean", - "description": "是否启用此功能。" + "display_in_ui": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" } - } + ], + "default": null }, - "speech_to_text": { - "type": "object", - "description": "语音转文字功能配置。", - "properties": { - "enabled": { - "type": "boolean", - "description": "是否启用此功能。" + "expiration_time": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" } - } + ], + "default": null }, - "text_to_speech": { - "type": "object", - "description": "文字转语音功能配置。", - "properties": { - "enabled": { - "type": "boolean", - "description": "是否启用此功能。" - }, - "voice": { - "type": "string", - "description": "TTS 声音标识符。" - }, - "language": { - "type": "string", - "description": "TTS 语言。" + "form_content": { + "anyOf": [ + { + "type": "string" }, - "autoPlay": { - "type": "string", - "description": "自动播放设置。`enabled` 为自动播放音频,`disabled` 为需要手动播放。" + { + "type": "null" } - } + ], + "default": null }, - "retriever_resource": { - "type": "object", - "description": "知识检索引用资源配置。", - "properties": { - "enabled": { - "type": "boolean", - "description": "是否启用此功能。" + "form_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "annotation_reply": { - "type": "object", - "description": "标注回复功能配置。", - "properties": { - "enabled": { - "type": "boolean", - "description": "是否启用此功能。" + "form_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "more_like_this": { - "type": "object", - "description": "更多类似推荐功能配置。", - "properties": { - "enabled": { - "type": "boolean", - "description": "是否启用此功能。" + "inputs": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "type": "array" + }, + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "sensitive_word_avoidance": { - "type": "object", - "description": "内容审核功能配置。", - "properties": { - "enabled": { - "type": "boolean", - "description": "是否启用此功能。" + "node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "user_input_form": { - "type": "array", + "node_title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "resolved_default_values": { + "additionalProperties": true, + "type": "object" + } + }, + "required": [ + "TYPE" + ], + "type": "object" + }, + "ChatPausedBlockingDataResponse": { + "additionalProperties": true, + "properties": { + "answer": { + "type": "string" + }, + "conversation_id": { + "format": "uuid", + "type": "string" + }, + "created_at": { + "format": "int64", + "type": "integer" + }, + "elapsed_time": { + "format": "float", + "type": "number" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "message_id": { + "format": "uuid", + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "type": "string" + }, + "paused_nodes": { "items": { - "type": "object", - "oneOf": [ - { - "title": "Text Input", - "type": "object", - "properties": { - "text-input": { - "type": "object", + "type": "string" + }, + "type": "array" + }, + "reasons": { + "items": { + "$ref": "#/components/schemas/ChatPauseReasonResponse" + }, + "type": "array" + }, + "status": { + "const": "paused", + "type": "string" + }, + "total_steps": { + "type": "integer" + }, + "total_tokens": { + "type": "integer" + }, + "workflow_run_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "answer", + "conversation_id", + "created_at", + "elapsed_time", + "id", + "message_id", + "metadata", + "mode", + "paused_nodes", + "reasons", + "status", + "total_steps", + "total_tokens", + "workflow_run_id" + ], + "type": "object" + }, + "ChatPausedBlockingResponse": { + "additionalProperties": true, + "properties": { + "answer": { + "type": "string" + }, + "conversation_id": { + "format": "uuid", + "type": "string" + }, + "created_at": { + "format": "int64", + "type": "integer" + }, + "data": { + "$ref": "#/components/schemas/ChatPausedBlockingDataResponse" + }, + "event": { + "const": "workflow_paused", + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "message_id": { + "format": "uuid", + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "type": "string" + }, + "task_id": { + "format": "uuid", + "type": "string" + }, + "workflow_run_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "answer", + "conversation_id", + "created_at", + "data", + "event", + "id", + "message_id", + "metadata", + "mode", + "task_id", + "workflow_run_id" + ], + "type": "object" + }, + "ChatRequestPayload": { + "properties": { + "auto_generate_name": { + "default": true, + "type": "boolean" + }, + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { "properties": { - "label": { - "type": "string", - "description": "输入字段的显示标签。" + "remote_url": { + "format": "url", + "type": "string" }, - "variable": { - "type": "string", - "description": "工作流中使用的变量名称。" + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" }, - "required": { - "type": "boolean", - "description": "该字段是否必填。" + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "default": { - "type": "string", - "description": "输入字段的默认值。" + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" } - } - } - } - }, - { - "title": "Paragraph", - "type": "object", - "properties": { - "paragraph": { - "type": "object", + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { "properties": { - "label": { - "type": "string", - "description": "段落字段的显示标签。" + "remote_url": { + "format": "url", + "type": "string" }, - "variable": { - "type": "string", - "description": "工作流中使用的变量名称。" + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" }, - "required": { - "type": "boolean", - "description": "该字段是否必填。" + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "default": { - "type": "string", - "description": "段落字段的默认值。" + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" } - } - } - } - }, - { - "title": "Select", - "type": "object", - "properties": { - "select": { - "type": "object", + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { "properties": { - "label": { - "type": "string", - "description": "下拉选择字段的显示标签。" + "remote_url": { + "format": "url", + "type": "string" }, - "variable": { - "type": "string", - "description": "工作流中使用的变量名称。" + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" }, - "required": { - "type": "boolean", - "description": "该字段是否必填。" + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "default": { - "type": "string", - "description": "默认选中的值。" + "upload_file_id": { + "type": "string" }, - "options": { - "type": "array", - "items": { - "type": "string" - }, - "description": "此表单控件的可选值列表。" + "url": { + "format": "url", + "type": "string" } - } - } - } - } - ] - }, - "description": "用户输入表单配置。" - }, - "file_upload": { - "type": "object", - "description": "文件上传配置。", - "properties": { - "image": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "是否启用图片上传。" - }, - "number_limits": { - "type": "integer", - "description": "可上传的最大图片数量。" - }, - "detail": { - "type": "string", - "description": "视觉模型的图像细节级别。" - }, - "transfer_methods": { - "type": "array", - "items": { - "type": "string" + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" }, - "description": "图片上传允许的传输方式。`remote_url` 表示通过文件 URL 上传,`local_file` 表示上传本地文件。" - } - } + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" } - } + ], + "default": null }, - "system_parameters": { - "type": "object", - "description": "系统级参数限制。", - "properties": { - "file_size_limit": { - "type": "integer", - "description": "常规文件最大大小(MB)。" - }, - "image_file_size_limit": { - "type": "integer", - "description": "最大图片文件大小(MB)。" - }, - "audio_file_size_limit": { - "type": "integer", - "description": "最大音频文件大小(MB)。" + "inputs": { + "additionalProperties": true, + "type": "object" + }, + "query": { + "type": "string" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "video_file_size_limit": { - "type": "integer", - "description": "最大视频文件大小(MB)。" + { + "type": "null" + } + ], + "default": null + }, + "workflow_id": { + "anyOf": [ + { + "type": "string" }, - "workflow_file_upload_limit": { - "type": "integer", - "description": "每次工作流执行的最大文件数量。" + { + "type": "null" } - } + ], + "default": null } - } + }, + "required": [ + "inputs", + "query" + ], + "type": "object" }, - "StreamEventWorkflowStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChatRequestPayloadWithUser": { + "properties": { + "auto_generate_name": { + "default": true, + "type": "boolean" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "description": "工作流执行已开始。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "工作流运行 ID。" - }, - "workflow_id": { - "type": "string", - "description": "关联的工作流 ID。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "本次工作流执行的输入变量。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "开始时间戳(Unix 纪元秒)。" - }, - "reason": { - "type": "string", - "description": "工作流启动原因。`initial` 表示首次启动,`resumption` 表示暂停后恢复(例如人工介入后)。" - } - } + { + "type": "null" } - } - } - ] - }, - "StreamEventWorkflowFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/StreamEventBase" + "inputs": { + "additionalProperties": true, + "type": "object" }, - { - "type": "object", - "description": "工作流执行已完成。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" + "query": { + "type": "string" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "工作流运行 ID。" - }, - "workflow_id": { - "type": "string", - "description": "关联的工作流 ID。" - }, - "status": { - "type": "string", - "description": "执行状态。`running` 表示进行中,`succeeded` 表示成功,`failed` 表示失败,`stopped` 表示手动停止,`partial-succeeded` 表示部分完成,`paused` 表示等待人工介入。" - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "工作流输出数据。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "执行失败时的错误消息。" - }, - "elapsed_time": { - "type": "number", - "description": "总执行耗时(秒)。" - }, - "total_tokens": { - "type": "integer", - "description": "消耗的总令牌数。" - }, - "total_steps": { - "type": "integer", - "description": "已执行的总步数。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "开始时间戳(Unix 纪元秒)。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "结束时间戳(Unix 纪元秒)。" - }, - "exceptions_count": { - "type": "integer", - "nullable": true, - "description": "执行期间的异常数量。" - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "工作流执行期间生成的文件。" - } - } + { + "type": "null" } - } - } - ] - }, - "StreamEventNodeStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/StreamEventBase" + "user": { + "type": "string" }, - { - "type": "object", - "description": "节点执行已开始。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" + "workflow_id": { + "anyOf": [ + { + "type": "string" }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "节点执行 ID。" - }, - "node_id": { - "type": "string", - "description": "工作流图中的节点 ID。" - }, - "node_type": { - "type": "string", - "description": "节点类型(例如 `llm`、`knowledge-retrieval`、`code`)。" - }, - "title": { - "type": "string", - "description": "Node title." - }, - "index": { - "type": "integer", - "description": "执行索引。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "前驱节点的 ID。" - }, - "inputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "节点输入数据。在简化 API 响应中可能为 `null`。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "开始时间戳(Unix 纪元秒)。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "附加元数据。" - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "如果该节点在迭代内运行,则为迭代 ID。" - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "当该节点在循环内运行时的循环 ID。" - } - } + { + "type": "null" } - } + ], + "default": null } - ] + }, + "required": [ + "inputs", + "query", + "user" + ], + "type": "object" }, - "StreamEventNodeFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChildChunkCreatePayload": { + "properties": { + "content": { + "description": "子分段文本内容。", + "type": "string" + } + }, + "required": [ + "content" + ], + "type": "object" + }, + "ChildChunkDetailResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/ChildChunkResponse" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "ChildChunkListQuery": { + "properties": { + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "搜索关键词。" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "limit": { + "default": 20, + "description": "每页的项目数量。服务器上限为 `100`。", + "minimum": 1, + "type": "integer" }, - { - "type": "object", - "description": "节点执行已完成。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "节点执行 ID。" - }, - "node_id": { - "type": "string", - "description": "工作流图中的节点 ID。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Node title." - }, - "index": { - "type": "integer", - "description": "执行索引。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "前驱节点的 ID。" - }, - "inputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "节点输入数据。在简化 API 响应中可能为 `null`。" - }, - "process_data": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "节点处理数据。在简化 API 响应中可能为 `null`。" - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "节点输出数据。在简化 API 响应中可能为 `null`。" - }, - "status": { - "type": "string", - "description": "节点执行状态。`running` 表示进行中,`succeeded` 表示成功,`failed` 表示失败,`exception` 表示发生异常。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "节点失败时的错误消息。" - }, - "elapsed_time": { - "type": "number", - "description": "节点执行耗时(秒)。" - }, - "execution_metadata": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "执行元数据(例如令牌用量、模型信息)。在简化 API 响应中可能为 `null`。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "开始时间戳(Unix 纪元秒)。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "结束时间戳(Unix 纪元秒)。" - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "该节点生成的文件。" - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "如果该节点在迭代内运行,则为迭代 ID。" - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "当该节点在循环内运行时的循环 ID。" - } - } - } - } + "page": { + "default": 1, + "minimum": 1, + "type": "integer" } - ] + }, + "type": "object" }, - "StreamEventNodeRetry": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChildChunkListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ChildChunkResponse" + }, + "type": "array" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "limit": { + "type": "integer" }, - { - "type": "object", - "description": "节点重试次数。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "节点执行 ID。" - }, - "node_id": { - "type": "string", - "description": "工作流图中的节点 ID。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "Node title." - }, - "index": { - "type": "integer", - "description": "执行索引。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "前驱节点的 ID。" - }, - "inputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "节点输入数据。" - }, - "process_data": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "节点处理数据。" - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "节点输出数据。" - }, - "status": { - "type": "string", - "description": "节点执行状态。`running` 表示进行中,`succeeded` 表示成功,`failed` 表示失败,`exception` 表示发生异常。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "本次重试的错误消息。" - }, - "elapsed_time": { - "type": "number", - "description": "本次尝试的执行时间(秒)。" - }, - "execution_metadata": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "执行元数据。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "开始时间戳(Unix 纪元秒)。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "结束时间戳(Unix 纪元秒)。" - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "本次重试期间生成的文件。" - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "迭代 ID(如适用)。" - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "循环 ID(如适用)。" - }, - "retry_index": { - "type": "integer", - "description": "重试次数索引,从 `0` 开始。" - } - } - } - } - } - ] - }, - "StreamEventIterationStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "page": { + "type": "integer" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "total": { + "type": "integer" }, - { - "type": "object", - "description": "迭代循环已开始。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "迭代执行 ID。" - }, - "node_id": { - "type": "string", - "description": "迭代节点 ID。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "迭代节点标题。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "开始时间戳(Unix 纪元秒)。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "附加元数据。" - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "迭代元数据。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "迭代输入数据。" - } - } - } - } + "total_pages": { + "type": "integer" } - ] + }, + "required": [ + "data", + "limit", + "page", + "total", + "total_pages" + ], + "type": "object" }, - "StreamEventIterationNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "ChildChunkResponse": { + "properties": { + "content": { + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "created_at": { + "type": "integer" }, - { - "type": "object", - "description": "迭代已进入下一项。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "迭代执行 ID。" - }, - "node_id": { - "type": "string", - "description": "迭代节点 ID。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "迭代节点标题。" - }, - "index": { - "type": "integer", - "description": "当前迭代索引(从 0 开始)。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "时间戳(Unix 纪元秒)。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "附加元数据。" - } - } - } - } - } - ] - }, - "StreamEventIterationCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "id": { + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "position": { + "type": "integer" }, - { - "type": "object", - "description": "迭代循环已完成。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "迭代执行 ID。" - }, - "node_id": { - "type": "string", - "description": "迭代节点 ID。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "迭代节点标题。" - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "迭代输出数据。" - }, - "status": { - "type": "string", - "description": "迭代执行状态。`running` 表示进行中,`succeeded` 表示成功,`failed` 表示失败,`exception` 表示发生异常。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "迭代失败时的错误消息。" - }, - "elapsed_time": { - "type": "number", - "description": "迭代总耗时(秒)。" - }, - "total_tokens": { - "type": "integer", - "description": "所有迭代中消耗的令牌总数。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "开始时间戳(Unix 纪元秒)。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "结束时间戳(Unix 纪元秒)。" - }, - "steps": { - "type": "integer", - "description": "已执行的迭代步骤总数。" - } - } - } - } - } - ] - }, - "StreamEventLoopStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "segment_id": { + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "type": { + "type": "string" }, - { - "type": "object", - "description": "循环已开始。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "循环执行 ID。" - }, - "node_id": { - "type": "string", - "description": "循环节点 ID。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "循环节点标题。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "开始时间戳(Unix 纪元秒)。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "附加元数据。" - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "循环元数据。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "循环输入数据。" - } - } - } - } + "updated_at": { + "type": "integer" + }, + "word_count": { + "type": "integer" } - ] + }, + "required": [ + "content", + "created_at", + "id", + "position", + "segment_id", + "type", + "updated_at", + "word_count" + ], + "type": "object" }, - "StreamEventLoopNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "循环已进入下一次迭代。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "循环执行 ID。" - }, - "node_id": { - "type": "string", - "description": "循环节点 ID。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "循环节点标题。" - }, - "index": { - "type": "integer", - "description": "当前循环索引(从 0 开始)。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "时间戳(Unix 纪元秒)。" - }, - "pre_loop_output": { - "description": "上一次循环迭代的输出。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "附加元数据。" - } - } - } - } + "ChildChunkUpdatePayload": { + "properties": { + "content": { + "description": "子分段文本内容。", + "type": "string" } - ] + }, + "required": [ + "content" + ], + "type": "object" }, - "StreamEventLoopCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "CompletionBlockingResponse": { + "additionalProperties": true, + "properties": { + "answer": { + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "created_at": { + "format": "int64", + "type": "integer" }, - { - "type": "object", - "description": "循环已完成。", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "循环执行 ID。" - }, - "node_id": { - "type": "string", - "description": "循环节点 ID。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "循环节点标题。" - }, - "outputs": { - "type": "object", - "nullable": true, - "additionalProperties": true, - "description": "循环输出数据。" - }, - "status": { - "type": "string", - "description": "循环执行状态。`running` 表示进行中,`succeeded` 表示成功,`failed` 表示失败,`exception` 表示发生异常。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "循环失败时的错误消息。" - }, - "elapsed_time": { - "type": "number", - "description": "循环总执行耗时(秒)。" - }, - "total_tokens": { - "type": "integer", - "description": "所有循环迭代中消耗的令牌总数。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "开始时间戳(Unix 纪元秒)。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "结束时间戳(Unix 纪元秒)。" - }, - "steps": { - "type": "integer", - "description": "已执行的循环总步数。" - } - } - } - } - } - ] - }, - "StreamEventHumanInputRequired": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "event": { + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "id": { + "format": "uuid", + "type": "string" }, - { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" - }, - "data": { - "type": "object", - "properties": { - "form_id": { - "type": "string", - "description": "表单实例的标识符,会在错误消息和日志中出现。Service API 调用请使用 `form_token`。" - }, - "node_id": { - "type": "string", - "description": "产生该表单的 Human Input 节点 ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input 节点的显示标题。" - }, - "form_content": { - "type": "string", - "description": "已替换工作流变量的预渲染表单正文。" - }, - "inputs": { - "type": "array", - "items": { - "type": "object", + "message_id": { + "format": "uuid", + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BlockingMetadataResponse" + }, + "mode": { + "type": "string" + }, + "task_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "answer", + "created_at", + "event", + "id", + "message_id", + "metadata", + "mode", + "task_id" + ], + "type": "object" + }, + "CompletionRequestPayload": { + "properties": { + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, "type": { - "type": "string", - "description": "表单输入控件类型。可用值:`paragraph`(多行文本输入)、`select`(从列表中单选)、`file`(单文件上传)和 `file-list`(多文件上传)。" + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" }, - "output_variable_name": { - "type": "string", - "description": "引用该输入提交值在工作流中使用的变量名。对应提交 `inputs` 对象中的键。" + "upload_file_id": { + "type": "string" }, - "default": { - "type": "object", - "nullable": true, - "description": "从工作流上下文解析得到的默认值。未配置默认值时为 `null`。", - "properties": { - "type": { - "type": "string", - "description": "默认值来源。`constant` 表示将 `value` 作为字面字符串;`variable` 表示 `selector` 指向工作流变量。" - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "当 `type` 为 `variable` 时,变量引用路径(例如 `[\"node_id\", \"var_name\"]`)。至少包含两个元素。" - }, - "value": { - "type": "string", - "description": "当 `type` 为 `constant` 时的字面默认值。始终为字符串。" - } - } + "url": { + "format": "url", + "type": "string" } - } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" }, - "description": "接收者需要填写的表单输入字段。" - }, - "actions": { - "type": "array", - "items": { - "type": "object", + { "properties": { - "id": { - "type": "string", - "maxLength": 20, - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "操作按钮的标识。当接收者选择该按钮时,作为 `action` 传入 [提交人工介入表单](/zh/api-reference/human-input/submit-human-input-form)。" + "remote_url": { + "format": "url", + "type": "string" }, - "title": { - "type": "string", - "maxLength": 100, - "description": "显示给接收者的按钮文本。" + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" }, - "button_style": { - "type": "string", - "description": "按钮视觉样式。可用值:`primary`、`default`、`accent`、`ghost`。" + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" } - } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" }, - "description": "接收者提交时可选择的用户操作(按钮)。" - }, - "display_in_ui": { - "type": "boolean", - "description": "表单是否也在 Dify 控制台中显示。" - }, - "form_token": { - "type": "string", - "nullable": true, - "description": "[获取人工介入表单](/zh/api-reference/human-input/get-human-input-form) 和 [提交人工介入表单](/zh/api-reference/human-input/submit-human-input-form) 的访问令牌。当人工介入节点使用邮件或控制台送达时为 `null`(Service API 仅能处理 Web 应用送达的表单)。" - }, - "resolved_default_values": { - "type": "object", - "additionalProperties": { - "type": "string" + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" }, - "description": "按输入的 `output_variable_name` 分组的预填充默认值。所有值均为字符串。" - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix 时间戳(秒),超过后表单无法再被提交。" - } - } + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" } - } - } - ] - }, - "StreamEventWorkflowPaused": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" + ], + "default": null }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "此工作流运行记录的持久化标识符。配合 [获取工作流运行详情](/zh/api-reference/workflow-runs/get-workflow-run-detail) 使用以在执行后获取结果。" - }, - "paused_nodes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "已暂停的节点 ID 列表。" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "description": "暂停时的部分输出。" - }, - "reasons": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "暂停原因。" - }, - "status": { - "type": "string", - "description": "工作流执行状态。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "创建时间戳。" - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "总耗时(秒)。" - }, - "total_tokens": { - "type": "integer", - "description": "消耗的总令牌数。" - }, - "total_steps": { - "type": "integer", - "description": "已执行的总步数。" - } - } - } - } - } - ] - }, - "StreamEventHumanInputFormFilled": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "inputs": { + "additionalProperties": true, + "type": "object" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "query": { + "default": "", + "type": "string" }, - { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "表单被填写的 Human Input 节点 ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input 节点的显示标题。" - }, - "rendered_content": { - "type": "string", - "description": "包含接收者提交值的渲染后表单内容(`human_input_required` 上的 `form_content` 是未填写的模板)。" - }, - "action_id": { - "type": "string", - "description": "接收者所选操作的标识(与传入 [提交人工介入表单](/zh/api-reference/human-input/submit-human-input-form) 的 `action` 一致)。" - }, - "action_text": { - "type": "string", - "description": "所选操作的显示文本。" - }, - "submitted_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "接收者提交的表单值,以各输入项的 `output_variable_name` 为键。" - } - } + { + "type": "null" } - } + ], + "default": null } - ] + }, + "required": [ + "inputs" + ], + "type": "object" }, - "StreamEventHumanInputFormTimeout": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "description": "工作流执行运行 ID。" - }, - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "表单过期的 Human Input 节点 ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input 节点的显示标题。" + "CompletionRequestPayloadWithUser": { + "properties": { + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null + }, + "inputs": { + "additionalProperties": true, + "type": "object" + }, + "query": { + "default": "", + "type": "string" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user": { + "type": "string" + } + }, + "required": [ + "inputs", + "user" + ], + "type": "object" + }, + "Condition": { + "properties": { + "comparison_operator": { + "enum": [ + "<", + "=", + ">", + "after", + "before", + "contains", + "empty", + "end with", + "in", + "is", + "is not", + "not contains", + "not empty", + "not in", + "start with", + "≠", + "≤", + "≥" + ], + "type": "string" + }, + "name": { + "description": "用于比较的元数据字段名称。", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "comparison_operator", + "name" + ], + "type": "object" + }, + "ConversationInfiniteScrollPagination": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/SimpleConversation" + }, + "type": "array" + }, + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit" + ], + "type": "object" + }, + "ConversationListQuery": { + "properties": { + "last_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "limit": { + "default": 20, + "description": "返回的记录数。", + "maximum": 100, + "minimum": 1, + "type": "integer" + }, + "sort_by": { + "default": "-updated_at", + "enum": [ + "-created_at", + "-updated_at", + "created_at", + "updated_at" + ], + "type": "string" + } + }, + "type": "object" + }, + "ConversationRenamePayload": { + "anyOf": [ + { + "properties": { + "auto_generate": { + "description": "自动生成会话名称。当为 `true` 时,`name` 字段将被忽略。", + "enum": [ + true + ], + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "auto_generate" + ], + "type": "object" + }, + { + "properties": { + "auto_generate": { + "default": false, + "description": "自动生成会话名称。当为 `true` 时,`name` 字段将被忽略。", + "enum": [ + false + ], + "type": "boolean" + }, + "name": { + "pattern": ".*\\S.*", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + ], + "properties": { + "auto_generate": { + "default": false, + "description": "自动生成会话名称。当为 `true` 时,`name` 字段将被忽略。", + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "ConversationRenamePayloadWithUser": { + "anyOf": [ + { + "properties": { + "auto_generate": { + "description": "自动生成会话名称。当为 `true` 时,`name` 字段将被忽略。", + "enum": [ + true + ], + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user": { + "type": "string" + } + }, + "required": [ + "auto_generate" + ], + "type": "object" + }, + { + "properties": { + "auto_generate": { + "default": false, + "description": "自动生成会话名称。当为 `true` 时,`name` 字段将被忽略。", + "enum": [ + false + ], + "type": "boolean" + }, + "name": { + "pattern": ".*\\S.*", + "type": "string" + }, + "user": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + ], + "properties": { + "auto_generate": { + "default": false, + "description": "自动生成会话名称。当为 `true` 时,`name` 字段将被忽略。", + "type": "boolean" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user": { + "type": "string" + } + }, + "type": "object" + }, + "ConversationVariableInfiniteScrollPaginationResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ConversationVariableResponse" + }, + "type": "array" + }, + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit" + ], + "type": "object" + }, + "ConversationVariableResponse": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "format": "uuid", + "type": "string" + }, + "name": { + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "value_type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "value_type" + ], + "type": "object" + }, + "ConversationVariableUpdatePayload": { + "properties": { + "value": { + "description": "变量的新值。必须与变量的预期类型匹配。" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ConversationVariableUpdatePayloadWithUser": { + "properties": { + "user": { + "type": "string" + }, + "value": { + "description": "变量的新值。必须与变量的预期类型匹配。" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ConversationVariablesQuery": { + "properties": { + "last_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "limit": { + "default": 20, + "description": "返回的记录数。", + "maximum": 100, + "minimum": 1, + "type": "integer" + }, + "variable_name": { + "anyOf": [ + { + "maxLength": 255, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "按指定名称筛选变量。" + } + }, + "type": "object" + }, + "CustomConfigurationStatus": { + "enum": [ + "active", + "no-configure" + ], + "type": "string" + }, + "DatasetBoundTagListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DatasetBoundTagResponse" + }, + "type": "array" + }, + "total": { + "type": "integer" + } + }, + "required": [ + "data", + "total" + ], + "type": "object" + }, + "DatasetBoundTagResponse": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "DatasetCreatePayload": { + "properties": { + "description": { + "default": "", + "description": "知识库描述。", + "maxLength": 400, + "type": "string" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_api_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "外部知识库的 ID。" + }, + "indexing_technique": { + "anyOf": [ + { + "enum": [ + "economy", + "high_quality" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "`high_quality` 使用嵌入模型进行精确搜索;`economy` 使用基于关键词的索引。" + }, + "name": { + "description": "知识库名称。", + "maxLength": 40, + "minLength": 1, + "type": "string" + }, + "permission": { + "anyOf": [ + { + "$ref": "#/components/schemas/PermissionEnum" + }, + { + "type": "null" + } + ], + "default": "only_me" + }, + "provider": { + "default": "vendor", + "enum": [ + "external", + "vendor" + ], + "type": "string" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "summary_index_setting": { + "anyOf": [ + { + "properties": { + "enable": { + "description": "是否启用摘要索引。", + "type": "boolean" + }, + "model_name": { + "description": "用于生成摘要的模型名称。", + "type": "string" + }, + "model_provider_name": { + "description": "摘要生成模型的供应商。", + "type": "string" + }, + "summary_prompt": { + "description": "用于摘要生成的自定义提示词模板。", + "type": "string" + } + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "description": "摘要索引配置。" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "DatasetDetailResponse": { + "properties": { + "app_count": { + "type": "integer" + }, + "author_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "built_in_field_enabled": { + "type": "boolean" + }, + "chunk_structure": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "integer" + }, + "created_by": { + "type": "string" + }, + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "doc_form": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DatasetDocMetadataResponse" + }, + "type": "array" + }, + "document_count": { + "type": "integer" + }, + "embedding_available": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "enable_api": { + "type": "boolean" + }, + "external_knowledge_info": { + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + }, + "external_retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/DatasetExternalRetrievalModelResponse" + }, + { + "type": "null" + } + ] + }, + "icon_info": { + "$ref": "#/components/schemas/DatasetIconInfoResponse" + }, + "id": { + "type": "string" + }, + "indexing_technique": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "is_multimodal": { + "type": "boolean" + }, + "is_published": { + "type": "boolean" + }, + "maintainer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "type": "string" + }, + "permission": { + "type": "string" + }, + "permission_keys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "pipeline_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "provider": { + "type": "string" + }, + "retrieval_model_dict": { + "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + }, + "runtime_mode": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "summary_index_setting": { + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + }, + "tags": { + "items": { + "$ref": "#/components/schemas/DatasetTagResponse" + }, + "type": "array" + }, + "total_available_documents": { + "type": "integer" + }, + "total_documents": { + "type": "integer" + }, + "updated_at": { + "type": "integer" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "word_count": { + "type": "integer" + } + }, + "required": [ + "app_count", + "author_name", + "built_in_field_enabled", + "chunk_structure", + "created_at", + "created_by", + "data_source_type", + "description", + "doc_form", + "doc_metadata", + "document_count", + "embedding_model", + "embedding_model_provider", + "enable_api", + "external_retrieval_model", + "id", + "indexing_technique", + "is_multimodal", + "is_published", + "name", + "permission", + "pipeline_id", + "provider", + "retrieval_model_dict", + "runtime_mode", + "tags", + "total_available_documents", + "total_documents", + "updated_at", + "updated_by", + "word_count" + ], + "type": "object" + }, + "DatasetDetailWithPartialMembersResponse": { + "properties": { + "app_count": { + "type": "integer" + }, + "author_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "built_in_field_enabled": { + "type": "boolean" + }, + "chunk_structure": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "integer" + }, + "created_by": { + "type": "string" + }, + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "doc_form": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DatasetDocMetadataResponse" + }, + "type": "array" + }, + "document_count": { + "type": "integer" + }, + "embedding_available": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "enable_api": { + "type": "boolean" + }, + "external_knowledge_info": { + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + }, + "external_retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/DatasetExternalRetrievalModelResponse" + }, + { + "type": "null" + } + ] + }, + "icon_info": { + "$ref": "#/components/schemas/DatasetIconInfoResponse" + }, + "id": { + "type": "string" + }, + "indexing_technique": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "is_multimodal": { + "type": "boolean" + }, + "is_published": { + "type": "boolean" + }, + "maintainer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "type": "string" + }, + "partial_member_list": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null + }, + "permission": { + "type": "string" + }, + "permission_keys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "pipeline_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "provider": { + "type": "string" + }, + "retrieval_model_dict": { + "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + }, + "runtime_mode": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "summary_index_setting": { + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + }, + "tags": { + "items": { + "$ref": "#/components/schemas/DatasetTagResponse" + }, + "type": "array" + }, + "total_available_documents": { + "type": "integer" + }, + "total_documents": { + "type": "integer" + }, + "updated_at": { + "type": "integer" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "word_count": { + "type": "integer" + } + }, + "required": [ + "app_count", + "author_name", + "built_in_field_enabled", + "chunk_structure", + "created_at", + "created_by", + "data_source_type", + "description", + "doc_form", + "doc_metadata", + "document_count", + "embedding_model", + "embedding_model_provider", + "enable_api", + "external_retrieval_model", + "id", + "indexing_technique", + "is_multimodal", + "is_published", + "name", + "permission", + "pipeline_id", + "provider", + "retrieval_model_dict", + "runtime_mode", + "tags", + "total_available_documents", + "total_documents", + "updated_at", + "updated_by", + "word_count" + ], + "type": "object" + }, + "DatasetDocMetadataResponse": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "DatasetExternalKnowledgeInfoResponse": { + "properties": { + "external_knowledge_api_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_api_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_api_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetExternalRetrievalModelResponse": { + "properties": { + "score_threshold": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + }, + "score_threshold_enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "top_k": { + "type": "integer" + } + }, + "required": [ + "top_k" + ], + "type": "object" + }, + "DatasetIconInfoResponse": { + "properties": { + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "icon_background": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "icon_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "icon_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetKeywordSettingResponse": { + "properties": { + "keyword_weight": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetListQuery": { + "properties": { + "include_all": { + "default": false, + "description": "是否包含所有知识库,无论权限如何。", + "type": "boolean" + }, + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "按名称筛选的搜索关键词。" + }, + "limit": { + "default": 20, + "description": "每页的项目数量。服务器上限为 `100`。", + "type": "integer" + }, + "page": { + "default": 1, + "type": "integer" + }, + "tag_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "DatasetListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DatasetDetailResponse" + }, + "type": "array" + }, + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "total": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "type": "object" + }, + "DatasetMetadataActionResponse": { + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ], + "type": "object" + }, + "DatasetMetadataBuiltInFieldResponse": { + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "name", + "type" + ], + "type": "object" + }, + "DatasetMetadataBuiltInFieldsResponse": { + "properties": { + "fields": { + "items": { + "$ref": "#/components/schemas/DatasetMetadataBuiltInFieldResponse" + }, + "type": "array" + } + }, + "required": [ + "fields" + ], + "type": "object" + }, + "DatasetMetadataListItemResponse": { + "properties": { + "count": { + "default": 0, + "type": "integer" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "DatasetMetadataListResponse": { + "properties": { + "built_in_field_enabled": { + "type": "boolean" + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DatasetMetadataListItemResponse" + }, + "type": "array" + } + }, + "required": [ + "built_in_field_enabled", + "doc_metadata" + ], + "type": "object" + }, + "DatasetMetadataResponse": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "DatasetRerankingModelResponse": { + "properties": { + "reranking_model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "reranking_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetRetrievalModelResponse": { + "properties": { + "reranking_enable": { + "type": "boolean" + }, + "reranking_mode": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "reranking_model": { + "$ref": "#/components/schemas/DatasetRerankingModelResponse" + }, + "score_threshold": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + }, + "score_threshold_enabled": { + "type": "boolean" + }, + "search_method": { + "type": "string" + }, + "top_k": { + "type": "integer" + }, + "weights": { + "anyOf": [ + { + "$ref": "#/components/schemas/DatasetWeightedScoreResponse" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "reranking_enable", + "score_threshold_enabled", + "search_method", + "top_k" + ], + "type": "object" + }, + "DatasetSummaryIndexSettingResponse": { + "properties": { + "enable": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "model_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "summary_prompt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetTagResponse": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "DatasetUpdatePayload": { + "properties": { + "description": { + "anyOf": [ + { + "maxLength": 400, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "知识库描述。" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_api_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "external_knowledge_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "外部知识库的 ID。" + }, + "external_retrieval_model": { + "anyOf": [ + { + "properties": { + "score_threshold": { + "type": "number" + }, + "score_threshold_enabled": { + "description": "是否启用分数阈值过滤。", + "type": "boolean" + }, + "top_k": { + "description": "返回的最大结果数。", + "type": "integer" + } + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "description": "外部知识库的检索设置。" + }, + "indexing_technique": { + "anyOf": [ + { + "enum": [ + "economy", + "high_quality" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "`high_quality` 使用嵌入模型进行精确搜索;`economy` 使用基于关键词的索引。" + }, + "name": { + "anyOf": [ + { + "maxLength": 40, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "知识库名称。" + }, + "partial_member_list": { + "anyOf": [ + { + "items": { + "properties": { + "user_id": { + "description": "要授予访问权限的团队成员 ID。", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "当 `permission` 为 `partial_members` 时有访问权限的团队成员列表。" + }, + "permission": { + "anyOf": [ + { + "$ref": "#/components/schemas/PermissionEnum" + }, + { + "type": "null" + } + ], + "default": null + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetVectorSettingResponse": { + "properties": { + "embedding_model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "vector_weight": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasetWeightedScoreResponse": { + "properties": { + "keyword_setting": { + "$ref": "#/components/schemas/DatasetKeywordSettingResponse" + }, + "vector_setting": { + "$ref": "#/components/schemas/DatasetVectorSettingResponse" + }, + "weight_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasourceCredentialInfoResponse": { + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "is_default": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "type": "object" + }, + "DatasourceNodeRunPayload": { + "properties": { + "credential_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "datasource_type": { + "description": "数据源类型。", + "enum": [ + "local_file", + "online_document", + "online_drive", + "website_crawl" + ], + "type": "string" + }, + "inputs": { + "additionalProperties": true, + "description": "数据源节点的输入变量。", + "type": "object" + }, + "is_published": { + "type": "boolean" + } + }, + "required": [ + "datasource_type", + "inputs", + "is_published" + ], + "type": "object" + }, + "DatasourcePluginListResponse": { + "items": { + "$ref": "#/components/schemas/DatasourcePluginResponse" + }, + "type": "array" + }, + "DatasourcePluginResponse": { + "properties": { + "credentials": { + "items": { + "$ref": "#/components/schemas/DatasourceCredentialInfoResponse" + }, + "type": "array" + }, + "datasource_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "plugin_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user_input_variables": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "DatasourcePluginsQuery": { + "properties": { + "is_published": { + "default": true, + "type": "boolean" + } + }, + "type": "object" + }, + "DocumentAndBatchResponse": { + "properties": { + "batch": { + "type": "string" + }, + "document": { + "$ref": "#/components/schemas/DocumentResponse" + } + }, + "required": [ + "batch", + "document" + ], + "type": "object" + }, + "DocumentBatchDownloadZipPayload": { + "properties": { + "document_ids": { + "items": { + "format": "uuid", + "type": "string" + }, + "maxItems": 100, + "minItems": 1, + "type": "array" + } + }, + "required": [ + "document_ids" + ], + "type": "object" + }, + "DocumentDetailResponse": { + "properties": { + "archived": { + "default": null, + "type": "boolean" + }, + "average_segment_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "number" + } + ], + "default": null + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_at": { + "default": null, + "type": "integer" + }, + "created_by": { + "default": null, + "type": "string" + }, + "created_from": { + "default": null, + "type": "string" + }, + "data_source_info": { + "additionalProperties": true, + "default": null, + "type": "object" + }, + "data_source_type": { + "default": null, + "type": "string" + }, + "dataset_process_rule": { + "additionalProperties": true, + "default": null, + "type": "object" + }, + "dataset_process_rule_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "disabled_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "display_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "doc_form": { + "default": null, + "type": "string" + }, + "doc_language": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "doc_metadata": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/DocumentMetadataResponse" + }, + "type": "array" + }, + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null + }, + "doc_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "document_process_rule": { + "additionalProperties": true, + "default": null, + "type": "object" + }, + "enabled": { + "default": null, + "type": "boolean" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "hit_count": { + "default": null, + "type": "integer" + }, + "id": { + "type": "string" + }, + "indexing_latency": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + }, + "indexing_status": { + "default": null, + "type": "string" + }, + "name": { + "default": null, + "type": "string" + }, + "need_summary": { + "default": null, + "type": "boolean" + }, + "position": { + "default": null, + "type": "integer" + }, + "segment_count": { + "default": null, + "type": "integer" + }, + "summary_index_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "updated_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "DocumentGetQuery": { + "properties": { + "metadata": { + "default": "all", + "description": "`all` 返回所有字段(包括元数据)。`only` 仅返回 `id`、`doc_type` 和 `doc_metadata`。`without` 返回除 `doc_metadata` 外的所有字段。", + "enum": [ + "all", + "only", + "without" + ], + "type": "string" + } + }, + "type": "object" + }, + "DocumentListQuery": { + "properties": { + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "按文档名称筛选的搜索关键词。" + }, + "limit": { + "default": 20, + "description": "每页的项目数量。服务器上限为 `100`。", + "type": "integer" + }, + "page": { + "default": 1, + "type": "integer" + }, + "status": { + "anyOf": [ + { + "enum": [ + "archived", + "available", + "disabled", + "error", + "indexing", + "paused", + "queuing" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "按显示状态筛选。" + } + }, + "type": "object" + }, + "DocumentListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DocumentResponse" + }, + "type": "array" + }, + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "total": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "type": "object" + }, + "DocumentMetadataOperation": { + "properties": { + "document_id": { + "format": "uuid", + "type": "string" + }, + "metadata_list": { + "items": { + "$ref": "#/components/schemas/MetadataDetail" + }, + "type": "array" + }, + "partial_update": { + "default": false, + "description": "是否部分更新元数据,保留未指定字段的现有值。", + "type": "boolean" + } + }, + "required": [ + "document_id", + "metadata_list" + ], + "type": "object" + }, + "DocumentMetadataResponse": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "DocumentResponse": { + "properties": { + "archived": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_from": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "data_source_detail_dict": { + "additionalProperties": true, + "type": "object" + }, + "data_source_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null + }, + "data_source_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "dataset_process_rule_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "disabled_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "display_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "doc_form": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "doc_metadata": { + "items": { + "$ref": "#/components/schemas/DocumentMetadataResponse" + }, + "type": "array" + }, + "enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "hit_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "type": "string" + }, + "indexing_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "type": "string" + }, + "need_summary": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "position": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "summary_index_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "word_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "data_source_detail_dict", + "id", + "name" + ], + "type": "object" + }, + "DocumentStatusListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DocumentStatusResponse" + }, + "type": "array" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "DocumentStatusPayload": { + "properties": { + "document_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "DocumentStatusResponse": { + "properties": { + "cleaning_completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "completed_segments": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "error_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "estimated_vector_space_mb": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "type": "string" + }, + "indexing_status": { + "type": "string" + }, + "parsing_completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "paused_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "processing_started_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "splitting_completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "stopped_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "total_segments": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "vector_space_limit_mb": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "cleaning_completed_at", + "completed_at", + "error", + "id", + "indexing_status", + "parsing_completed_at", + "paused_at", + "processing_started_at", + "splitting_completed_at", + "stopped_at" + ], + "type": "object" + }, + "DocumentTextCreatePayload": { + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` 为标准文本分段,`hierarchical_model` 为父子分段结构,`qa_model` 为问答对提取。", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "用于处理优化的文档语言。", + "type": "string" + }, + "embedding_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "embedding_model_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "indexing_technique": { + "anyOf": [ + { + "enum": [ + "economy", + "high_quality" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "description": "文档名称。", + "type": "string" + }, + "original_document_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "分块处理规则。" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "text": { + "description": "文档文本内容。", + "type": "string" + } + }, + "required": [ + "name", + "text" + ], + "type": "object" + }, + "DocumentTextUpdate": { + "anyOf": [ + { + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` 为标准文本分段,`hierarchical_model` 为父子分段结构,`qa_model` 为问答对提取。", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "用于处理优化的文档语言。", + "type": "string" + }, + "name": { + "default": null, + "description": "文档名称。当提供 `text` 时必填。", + "type": "string" + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "分块处理规则。" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "text": { + "default": null, + "description": "文档文本内容。", + "type": "string" + } + }, + "required": [ + "name", + "text" + ], + "type": "object" + }, + { + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` 为标准文本分段,`hierarchical_model` 为父子分段结构,`qa_model` 为问答对提取。", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "用于处理优化的文档语言。", + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "文档名称。当提供 `text` 时必填。" + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "分块处理规则。" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "text": { + "description": "文档文本内容。", + "type": "null" + } + }, + "type": "object" + } + ], + "properties": { + "doc_form": { + "default": "text_model", + "description": "`text_model` 为标准文本分段,`hierarchical_model` 为父子分段结构,`qa_model` 为问答对提取。", + "enum": [ + "hierarchical_model", + "qa_model", + "text_model" + ], + "type": "string" + }, + "doc_language": { + "default": "English", + "description": "用于处理优化的文档语言。", + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "文档名称。当提供 `text` 时必填。" + }, + "process_rule": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProcessRule" + }, + { + "type": "null" + } + ], + "default": null, + "description": "分块处理规则。" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "text": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "文档文本内容。" + } + }, + "type": "object" + }, + "EventStreamResponse": { + "type": "string" + }, + "ExecutionContentType": { + "enum": [ + "human_input" + ], + "type": "string" + }, + "FeedbackListQuery": { + "properties": { + "limit": { + "default": 20, + "maximum": 101, + "minimum": 1, + "type": "integer" + }, + "page": { + "default": 1, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "FetchFrom": { + "enum": [ + "customizable-model", + "predefined-model" + ], + "type": "string" + }, + "FileInputConfig": { + "properties": { + "allowed_file_extensions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "allowed_file_types": { + "items": { + "$ref": "#/components/schemas/FileType" + }, + "type": "array" + }, + "allowed_file_upload_methods": { + "items": { + "$ref": "#/components/schemas/FileTransferMethod" + }, + "type": "array" + }, + "output_variable_name": { + "type": "string" + }, + "type": { + "const": "file", + "default": "file", + "type": "string" + } + }, + "required": [ + "output_variable_name" + ], + "type": "object" + }, + "FileListInputConfig": { + "properties": { + "allowed_file_extensions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "allowed_file_types": { + "items": { + "$ref": "#/components/schemas/FileType" + }, + "type": "array" + }, + "allowed_file_upload_methods": { + "items": { + "$ref": "#/components/schemas/FileTransferMethod" + }, + "type": "array" + }, + "number_limits": { + "default": 0, + "minimum": 0, + "type": "integer" + }, + "output_variable_name": { + "type": "string" + }, + "type": { + "const": "file-list", + "default": "file-list", + "type": "string" + } + }, + "required": [ + "output_variable_name" + ], + "type": "object" + }, + "FilePreviewQuery": { + "properties": { + "as_attachment": { + "default": false, + "type": "boolean" + } + }, + "type": "object" + }, + "FileResponse": { + "properties": { + "conversation_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_by": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "extension": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "file_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "format": "uuid", + "type": "string" + }, + "mime_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "type": "string" + }, + "original_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "preview_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "reference": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "size": { + "type": "integer" + }, + "source_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tenant_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id", + "name", + "size" + ], + "type": "object" + }, + "FileTransferMethod": { + "enum": [ + "datasource_file", + "local_file", + "remote_url", + "tool_file" + ], + "type": "string" + }, + "FileType": { + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "FormInputConfig": { + "discriminator": { + "mapping": { + "file": "#/components/schemas/FileInputConfig", + "file-list": "#/components/schemas/FileListInputConfig", + "paragraph": "#/components/schemas/ParagraphInputConfig", + "select": "#/components/schemas/SelectInputConfig" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ParagraphInputConfig" + }, + { + "$ref": "#/components/schemas/SelectInputConfig" + }, + { + "$ref": "#/components/schemas/FileInputConfig" + }, + { + "$ref": "#/components/schemas/FileListInputConfig" + } + ] + }, + "HitTestingChildChunk": { + "properties": { + "content": { + "type": "string" + }, + "id": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "score": { + "type": "number" + } + }, + "required": [ + "content", + "id", + "position", + "score" + ], + "type": "object" + }, + "HitTestingDocument": { + "properties": { + "data_source_type": { + "type": "string" + }, + "doc_metadata": { + "anyOf": [ + {}, + { + "type": "null" + } + ] + }, + "doc_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "data_source_type", + "doc_metadata", + "doc_type", + "id", + "name" + ], + "type": "object" + }, + "HitTestingFile": { + "properties": { + "extension": { + "type": "string" + }, + "id": { + "type": "string" + }, + "mime_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "source_url": { + "type": "string" + } + }, + "required": [ + "extension", + "id", + "mime_type", + "name", + "size", + "source_url" + ], + "type": "object" + }, + "HitTestingPayload": { + "properties": { + "attachment_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "要包含在检索上下文中的附件 ID 列表。" + }, + "external_retrieval_model": { + "anyOf": [ + { + "properties": { + "score_threshold": { + "type": "number" + }, + "score_threshold_enabled": { + "description": "是否启用分数阈值过滤。", + "type": "boolean" + }, + "top_k": { + "description": "返回的最大结果数。", + "type": "integer" + } + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "description": "外部知识库的检索设置。" + }, + "query": { + "description": "搜索查询文本。", + "maxLength": 250, + "type": "string" + }, + "retrieval_model": { + "anyOf": [ + { + "$ref": "#/components/schemas/RetrievalModel" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "query" + ], + "type": "object" + }, + "HitTestingQuery": { + "properties": { + "content": { + "type": "string" + } + }, + "required": [ + "content" + ], + "type": "object" + }, + "HitTestingRecord": { + "properties": { + "child_chunks": { + "items": { + "$ref": "#/components/schemas/HitTestingChildChunk" + }, + "type": "array" + }, + "files": { + "items": { + "$ref": "#/components/schemas/HitTestingFile" + }, + "type": "array" + }, + "score": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "segment": { + "$ref": "#/components/schemas/HitTestingSegment" + }, + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tsne_position": { + "anyOf": [ + {}, + { + "type": "null" + } + ] + } + }, + "required": [ + "child_chunks", + "files", + "score", + "segment", + "summary", + "tsne_position" + ], + "type": "object" + }, + "HitTestingResponse": { + "properties": { + "query": { + "$ref": "#/components/schemas/HitTestingQuery" + }, + "records": { + "items": { + "$ref": "#/components/schemas/HitTestingRecord" + }, + "type": "array" + } + }, + "required": [ + "query", + "records" + ], + "type": "object" + }, + "HitTestingSegment": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "content": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "created_by": { + "type": "string" + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "disabled_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "document": { + "$ref": "#/components/schemas/HitTestingDocument" + }, + "document_id": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "hit_count": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "index_node_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "index_node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "indexing_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "keywords": { + "items": { + "type": "string" + }, + "type": "array" + }, + "position": { + "type": "integer" + }, + "sign_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "stopped_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "tokens": { + "type": "integer" + }, + "word_count": { + "type": "integer" + } + }, + "required": [ + "answer", + "completed_at", + "content", + "created_at", + "created_by", + "disabled_at", + "disabled_by", + "document", + "document_id", + "enabled", + "error", + "hit_count", + "id", + "index_node_hash", + "index_node_id", + "indexing_at", + "keywords", + "position", + "sign_content", + "status", + "stopped_at", + "tokens", + "word_count" + ], + "type": "object" + }, + "HumanInputFormDefinitionResponse": { + "properties": { + "expiration_time": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "form_content": { + "type": "string" + }, + "inputs": { + "items": { + "$ref": "#/components/schemas/FormInputConfig" + }, + "type": "array" + }, + "resolved_default_values": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "user_actions": { + "items": { + "$ref": "#/components/schemas/UserActionConfig" + }, + "type": "array" + } + }, + "required": [ + "form_content", + "inputs", + "resolved_default_values", + "user_actions" + ], + "type": "object" + }, + "HumanInputFormSubmitPayload": { + "properties": { + "action": { + "type": "string" + }, + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + }, + "examples": [ + { + "attachment": { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "4e0d1b87-52f2-49f6-b8c6-95cd9c954b3e" + }, + "attachments": [ + { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee" + }, + { + "transfer_method": "remote_url", + "type": "document", + "url": "https://example.com/report.pdf" + } + ], + "decision": "approve" + } + ], + "type": "object" + } + }, + "required": [ + "action", + "inputs" + ], + "type": "object" + }, + "HumanInputFormSubmitPayloadWithUser": { + "properties": { + "action": { + "type": "string" + }, + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + }, + "examples": [ + { + "attachment": { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "4e0d1b87-52f2-49f6-b8c6-95cd9c954b3e" + }, + "attachments": [ + { + "transfer_method": "local_file", + "type": "document", + "upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee" + }, + { + "transfer_method": "remote_url", + "type": "document", + "url": "https://example.com/report.pdf" + } + ], + "decision": "approve" + } + ], + "type": "object" + }, + "user": { + "type": "string" + } + }, + "required": [ + "action", + "inputs", + "user" + ], + "type": "object" + }, + "HumanInputFormSubmitResponse": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "I18nObject": { + "properties": { + "en_US": { + "type": "string" + }, + "zh_Hans": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "en_US" + ], + "type": "object" + }, + "IndexInfoResponse": { + "properties": { + "api_version": { + "type": "string" + }, + "server_version": { + "type": "string" + }, + "welcome": { + "type": "string" + } + }, + "required": [ + "api_version", + "server_version", + "welcome" + ], + "type": "object" + }, + "JSONObject": { + "additionalProperties": true, + "type": "object" + }, + "JSONValue": {}, + "JSONValueType": {}, + "JsonValue": {}, + "KnowledgeTagListResponse": { + "items": { + "$ref": "#/components/schemas/KnowledgeTagResponse" + }, + "type": "array" + }, + "KnowledgeTagResponse": { + "properties": { + "binding_count": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "type" + ], + "type": "object" + }, + "MessageFeedbackPayload": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "提供额外详情的可选文字反馈。" + }, + "rating": { + "anyOf": [ + { + "enum": [ + "dislike", + "like" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "反馈评分。设为 `null` 可撤销之前提交的反馈。" + } + }, + "type": "object" + }, + "MessageFeedbackPayloadWithUser": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "提供额外详情的可选文字反馈。" + }, + "rating": { + "anyOf": [ + { + "enum": [ + "dislike", + "like" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "反馈评分。设为 `null` 可撤销之前提交的反馈。" + }, + "user": { + "type": "string" + } + }, + "required": [ + "user" + ], + "type": "object" + }, + "MessageFile": { + "properties": { + "belongs_to": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "filename": { + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "mime_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "transfer_method": { + "type": "string" + }, + "type": { + "type": "string" + }, + "upload_file_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "url": { + "anyOf": [ + { + "format": "url", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "filename", + "id", + "transfer_method", + "type" + ], + "type": "object" + }, + "MessageInfiniteScrollPagination": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/MessageListItem" + }, + "type": "array" + }, + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit" + ], + "type": "object" + }, + "MessageListItem": { + "properties": { + "agent_thoughts": { + "items": { + "$ref": "#/components/schemas/AgentThought" + }, + "type": "array" + }, + "answer": { + "type": "string" + }, + "answer_tokens": { + "default": 0, + "type": "integer" + }, + "conversation_id": { + "format": "uuid", + "type": "string" + }, + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + }, + "currency": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "extra_contents": { + "items": { + "$ref": "#/components/schemas/HumanInputContent" + }, + "type": "array" + }, + "feedback": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleFeedback" + }, + { + "type": "null" + } + ], + "default": null + }, + "id": { + "format": "uuid", + "type": "string" + }, + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JSONValueType" + }, + "type": "object" + }, + "message_files": { + "items": { + "$ref": "#/components/schemas/MessageFile" + }, + "type": "array" + }, + "message_tokens": { + "default": 0, + "type": "integer" + }, + "parent_message_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "provider_response_latency": { + "default": 0, + "format": "float", + "type": "number" + }, + "query": { + "type": "string" + }, + "retriever_resources": { + "items": { + "$ref": "#/components/schemas/RetrieverResource" + }, + "type": "array" + }, + "status": { + "type": "string" + }, + "total_price": { + "anyOf": [ + { + "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "total_tokens": { + "readOnly": true, + "type": "integer" + } + }, + "required": [ + "agent_thoughts", + "answer", + "conversation_id", + "extra_contents", + "id", + "inputs", + "message_files", + "query", + "retriever_resources", + "status", + "total_tokens" + ], + "type": "object" + }, + "MessageListQuery": { + "properties": { + "conversation_id": { + "description": "会话 ID。", + "type": "string" + }, + "first_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "limit": { + "default": 20, + "description": "每次请求返回的聊天历史消息数量。", + "maximum": 100, + "minimum": 1, + "type": "integer" + } + }, + "required": [ + "conversation_id" + ], + "type": "object" + }, + "MetadataArgs": { + "properties": { + "name": { + "description": "元数据字段名称。", + "type": "string" + }, + "type": { + "description": "`string` 为文本值,`number` 为数值,`time` 为日期/时间值。", + "enum": [ + "number", + "string", + "time" + ], + "type": "string" + } + }, + "required": [ + "name", + "type" + ], + "type": "object" + }, + "MetadataDetail": { + "properties": { + "id": { + "format": "uuid", + "type": "string" + }, + "name": { + "description": "元数据字段名称。", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "元数据值。可以是字符串、数字或 `null`。" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "MetadataFilteringCondition": { + "properties": { + "conditions": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/Condition" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "deprecated": true, + "description": "要评估的元数据条件列表。" + }, + "logical_operator": { + "anyOf": [ + { + "enum": [ + "and", + "or" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "and", + "description": "多个条件之间的组合方式。" + } + }, + "type": "object" + }, + "MetadataOperationData": { + "properties": { + "operation_data": { + "items": { + "$ref": "#/components/schemas/DocumentMetadataOperation" + }, + "type": "array" + } + }, + "required": [ + "operation_data" + ], + "type": "object" + }, + "MetadataUpdatePayload": { + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "ModelFeature": { + "enum": [ + "agent-thought", + "audio", + "document", + "multi-tool-call", + "polling", + "stream-tool-call", + "structured-output", + "tool-call", + "video", + "vision" + ], + "type": "string" + }, + "ModelPropertyKey": { + "enum": [ + "audio_type", + "context_size", + "default_voice", + "file_upload_limit", + "max_characters_per_chunk", + "max_chunks", + "max_workers", + "mode", + "supported_file_extensions", + "voices", + "word_limit" + ], + "type": "string" + }, + "ModelStatus": { + "enum": [ + "active", + "credential-removed", + "disabled", + "no-configure", + "no-permission", + "quota-exceeded" + ], + "type": "string" + }, + "ModelType": { + "enum": [ + "llm", + "moderation", + "rerank", + "speech2text", + "text-embedding", + "tts" + ], + "type": "string" + }, + "OptionalServiceApiUserPayload": { + "properties": { + "user": { + "type": "string" + } + }, + "type": "object" + }, + "ParagraphInputConfig": { + "properties": { + "default": { + "anyOf": [ + { + "$ref": "#/components/schemas/StringSource" + }, + { + "type": "null" + } + ], + "default": null + }, + "output_variable_name": { + "type": "string" + }, + "type": { + "const": "paragraph", + "default": "paragraph", + "type": "string" + } + }, + "required": [ + "output_variable_name" + ], + "type": "object" + }, + "Parameters": { + "properties": { + "annotation_reply": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "file_upload": { + "properties": { + "allowed_file_extensions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "allowed_file_types": { + "items": { + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "type": "array" + }, + "allowed_file_upload_methods": { + "items": { + "enum": [ + "local_file", + "remote_url" + ], + "type": "string" + }, + "type": "array" + }, + "enabled": { + "type": "boolean" + }, + "image": { + "properties": { + "detail": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "number_limits": { + "type": "integer" + }, + "transfer_methods": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "number_limits": { + "type": "integer" + } + }, + "type": "object" + }, + "more_like_this": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "opening_statement": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "retriever_resource": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "sensitive_word_avoidance": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "speech_to_text": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "suggested_questions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "suggested_questions_after_answer": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "system_parameters": { + "$ref": "#/components/schemas/SystemParameters" + }, + "text_to_speech": { + "properties": { + "autoPlay": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "language": { + "type": "string" + }, + "voice": { + "type": "string" + } + }, + "type": "object" + }, + "user_input_form": { + "items": { + "oneOf": [ + { + "additionalProperties": false, + "properties": { + "text-input": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "text-input" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "select": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "select" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "paragraph": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "paragraph" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "number": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "number" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "external_data_tool": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "external_data_tool" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "file": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "file" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "file-list": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "file-list" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "checkbox": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } + }, + "required": [ + "checkbox" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "json_object": { + "properties": { + "allowed_file_extensions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_types": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "allowed_file_upload_methods": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] + }, + "config": { + "additionalProperties": true, + "type": "object" + }, + "default": {}, + "description": { + "type": "string" + }, + "hide": { + "type": "boolean" + }, + "json_schema": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "label": { + "type": "string" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "options": { + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "type": "boolean" + }, + "type": { + "enum": [ + "checkbox", + "external_data_tool", + "file", + "file-list", + "json_object", + "number", + "paragraph", + "select", + "text-input" + ], + "type": "string" + }, + "variable": { + "type": "string" + } + }, + "required": [ + "label", + "variable" + ], + "type": "object" + } }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix 时间戳(秒),表示表单过期时刻。" - } + "required": [ + "json_object" + ], + "type": "object" } - } - } + ], + "type": "object" + }, + "type": "array" } - ] + }, + "required": [ + "annotation_reply", + "file_upload", + "more_like_this", + "retriever_resource", + "sensitive_word_avoidance", + "speech_to_text", + "suggested_questions", + "suggested_questions_after_answer", + "system_parameters", + "text_to_speech", + "user_input_form" + ], + "type": "object" }, - "StreamEventAgentLog": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" - }, - { - "type": "object", - "description": "工作流中 Agent 节点的 Agent 日志。", - "properties": { - "data": { - "type": "object", - "properties": { - "node_execution_id": { - "type": "string", - "description": "节点执行 ID。" - }, - "id": { - "type": "string", - "description": "日志条目 ID。" - }, - "label": { - "type": "string", - "description": "日志条目标签。" - }, - "parent_id": { - "type": "string", - "nullable": true, - "description": "嵌套条目的父日志条目 ID。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "错误消息(如适用)。" - }, - "status": { - "type": "string", - "description": "日志条目状态。" - }, - "data": { - "type": "object", - "additionalProperties": true, - "description": "日志条目数据。" - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "附加元数据。" - }, - "node_id": { - "type": "string", - "description": "工作流图中的节点 ID。" - } - } - } - } - } - ] + "PermissionEnum": { + "enum": [ + "all_team_members", + "only_me", + "partial_members" + ], + "type": "string" }, - "StreamEventChatReasoningChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" - }, - { - "$ref": "#/components/schemas/StreamEventBase" + "PipelineDataset": { + "properties": { + "chunk_structure": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "message_id": { - "type": "string", - "format": "uuid", - "description": "此推理内容所属消息的 ID(与顶层 `message_id` 一致)。" - }, - "reasoning": { - "type": "string", - "description": "由 `reasoning_format` 为 `separated` 的 LLM 节点发送的推理内容增量。拼接连续的 `reasoning_chunk` 事件即可还原完整推理内容。本流与 `message` 并行;`message`(回答)流不含 `` 标签。" - }, - "node_id": { - "type": "string", - "nullable": true, - "description": "产生该推理内容的 LLM 节点 ID。当多个 LLM 节点运行时,可据此归属推理内容。" - }, - "is_final": { - "type": "boolean", - "description": "`true` 标志 LLM 节点推理阶段结束(即「思考完成」信号);该事件的 `reasoning` 可能为空。" - } - } - } - } - } - ] - }, - "StreamEventChatTextChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkChatEvent" + "description": { + "default": "", + "type": "string" }, - { - "$ref": "#/components/schemas/StreamEventBase" + "id": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "文本内容块。" - }, - "from_variable_selector": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true, - "description": "工作流中文本变量的源路径。" - } - } - } - } + "name": { + "type": "string" } - ] + }, + "required": [ + "chunk_structure", + "id", + "name" + ], + "type": "object" }, - "WorkflowRunDetailResponse": { - "type": "object", + "PipelineDocument": { "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "工作流运行 ID。" - }, - "workflow_id": { - "type": "string", - "format": "uuid", - "description": "工作流 ID." - }, - "status": { - "type": "string", - "description": "工作流执行状态。`running` 表示执行中,`succeeded` 表示成功完成,`failed` 表示执行出错,`stopped` 表示手动停止,`partial-succeeded` 表示部分节点成功但其他失败,`paused` 表示等待人工介入。" + "data_source_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null }, - "inputs": { - "type": "string", - "nullable": true, - "description": "工作流运行的输入变量,以原始 JSON 字符串返回(例如 `{\"query\": \"...\"}`),客户端需自行解析;可能为 `null`。" + "data_source_type": { + "type": "string" }, - "outputs": { - "type": "object", - "additionalProperties": true, - "description": "工作流的输出数据。尚无输出时为空对象。" + "enabled": { + "type": "boolean" }, "error": { - "type": "string", - "nullable": true, - "description": "工作流失败时的错误消息。" - }, - "total_steps": { - "type": "integer", - "description": "已执行的工作流总步数。" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "total_tokens": { - "type": "integer", - "description": "消耗的总令牌数。" + "id": { + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "工作流运行创建时的 Unix 时间戳。" + "indexing_status": { + "type": "string" }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "工作流运行结束时的 Unix 时间戳。" + "name": { + "type": "string" }, - "elapsed_time": { - "type": "number", - "format": "float", - "nullable": true, - "description": "总耗时(秒)。" + "position": { + "type": "integer" } - } + }, + "required": [ + "data_source_type", + "enabled", + "id", + "indexing_status", + "name", + "position" + ], + "type": "object" }, - "WorkflowLogsResponse": { - "type": "object", + "PipelineRunApiEntity": { "properties": { - "page": { - "type": "integer", - "description": "当前页码。" - }, - "limit": { - "type": "integer", - "description": "每页条目数。" - }, - "total": { - "type": "integer", - "description": "日志条目总数。" - }, - "has_more": { - "type": "boolean", - "description": "是否有更多可用页面。" - }, - "data": { - "type": "array", + "datasource_info_list": { + "description": "待处理的数据源对象列表。条目结构取决于 `datasource_type`。", "items": { - "$ref": "#/components/schemas/WorkflowLogItem" - }, - "description": "工作流日志条目列表。" - } - } - }, - "WorkflowLogItem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "日志条目 ID。" - }, - "workflow_run": { - "$ref": "#/components/schemas/WorkflowRunSummary" + "oneOf": [ + { + "properties": { + "name": { + "type": "string" + }, + "reference": { + "type": "string" + } + }, + "required": [ + "reference" + ], + "title": "Local File", + "type": "object" + }, + { + "properties": { + "credential_id": { + "type": "string" + }, + "page": { + "description": "页面详情。", + "properties": { + "page_id": { + "description": "页面标识符。", + "type": "string" + }, + "page_name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "page_id", + "type" + ], + "type": "object" + }, + "workspace_id": { + "type": "string" + } + }, + "required": [ + "page", + "workspace_id" + ], + "title": "Online Document", + "type": "object" + }, + { + "properties": { + "title": { + "type": "string" + }, + "url": { + "description": "待爬取的 URL。", + "type": "string" + } + }, + "required": [ + "url" + ], + "title": "Website Crawl", + "type": "object" + }, + { + "properties": { + "bucket": { + "type": "string" + }, + "id": { + "description": "文件或文件夹 ID。", + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "description": "该条目是单个文件还是待展开的文件夹。", + "enum": [ + "file", + "folder" + ], + "type": "string" + } + }, + "required": [ + "id", + "type" + ], + "title": "Online Drive", + "type": "object" + } + ] + }, + "type": "array" }, - "created_from": { - "type": "string", - "description": "工作流运行的来源(例如 `service-api`)。" + "datasource_type": { + "description": "数据源类型。决定 `datasource_info_list` 中条目所需的字段。", + "enum": [ + "local_file", + "online_document", + "online_drive", + "website_crawl" + ], + "type": "string" }, - "created_by_role": { - "type": "string", - "description": "创建者的角色(例如 `end_user`、`account`)。" + "inputs": { + "additionalProperties": true, + "description": "流水线输入变量的键值对,对应工作流中定义的流水线变量。如果流水线没有输入变量,传 `{}`。", + "type": "object" }, - "created_by_account": { - "type": "object", - "nullable": true, - "description": "由管理员用户创建时的账户详情。", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "账户 ID。" - }, - "name": { - "type": "string", - "description": "账户显示名称。" - }, - "email": { - "type": "string", - "description": "账户邮箱地址。" - } - } + "is_published": { + "type": "boolean" }, - "created_by_end_user": { - "$ref": "#/components/schemas/EndUserSummary" + "response_mode": { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "日志条目创建时的 Unix 时间戳。" + "start_node_id": { + "type": "string" + } + }, + "required": [ + "datasource_info_list", + "datasource_type", + "inputs", + "is_published", + "response_mode", + "start_node_id" + ], + "type": "object" + }, + "PipelineRunJsonResponse": { + "anyOf": [ + { + "$ref": "#/components/schemas/PublishedPipelineRunResponse" }, - "details": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "日志条目的附加详情。" + { + "$ref": "#/components/schemas/WorkflowBlockingResponse" } - } + ] }, - "WorkflowRunSummary": { - "type": "object", + "PipelineUploadFileResponse": { "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "工作流运行 ID。" - }, - "version": { - "type": "string", - "description": "工作流版本标识符。" - }, - "status": { - "type": "string", - "description": "工作流执行状态。`running` 表示执行中,`succeeded` 表示成功完成,`failed` 表示执行出错,`stopped` 表示手动停止,`partial-succeeded` 表示部分节点成功但其他失败,`paused` 表示等待人工介入。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "工作流失败时的错误消息。" - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "总耗时(秒)。" + "created_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "total_tokens": { - "type": "integer", - "description": "消耗的总令牌数。" + "created_by": { + "type": "string" }, - "total_steps": { - "type": "integer", - "description": "已执行的工作流总步数。" + "extension": { + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "工作流运行创建时的 Unix 时间戳。" + "id": { + "type": "string" }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "工作流运行结束时的 Unix 时间戳。" + "mime_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "exceptions_count": { - "type": "integer", - "description": "执行期间发生的异常数量。" + "name": { + "type": "string" }, - "triggered_from": { - "type": "string", - "description": "触发工作流运行的来源。`app-run` 表示从应用或 API 发起的运行,`webhook` 表示由 Webhook 触发器发起的运行,`schedule` 表示由定时触发器发起的运行,`plugin` 表示由集成触发器发起的运行。" + "size": { + "type": "integer" } - } + }, + "required": [ + "created_by", + "extension", + "id", + "name", + "size" + ], + "type": "object" }, - "EndUserSummary": { - "type": "object", + "PreProcessingRule": { "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "终端用户 ID。" - }, - "type": { - "type": "string", - "description": "终端用户类型。" - }, - "is_anonymous": { - "type": "boolean", - "description": "终端用户是否为匿名。" + "enabled": { + "description": "该预处理规则是否启用。", + "type": "boolean" }, - "session_id": { - "type": "string", - "description": "会话标识符。" + "id": { + "description": "规则标识符。", + "enum": [ + "remove_extra_spaces", + "remove_stopwords", + "remove_urls_emails" + ], + "type": "string" } - } + }, + "required": [ + "enabled", + "id" + ], + "type": "object" }, - "HumanInputContent": { - "type": "object", - "description": "人工介入节点的执行内容,包括表单定义和提交数据。", + "ProcessRule": { "properties": { - "workflow_run_id": { - "type": "string", - "description": "该内容所属的工作流运行 ID。" - }, - "submitted": { - "type": "boolean", - "description": "人工介入表单是否已提交。" - }, - "type": { - "type": "string", - "description": "`human_input` 表示人工介入内容。" - }, - "form_definition": { - "nullable": true, - "description": "人工介入节点的表单定义。当内容表示提交响应时为 `null`。", - "$ref": "#/components/schemas/HumanInputFormDefinition" + "mode": { + "$ref": "#/components/schemas/ProcessRuleMode" }, - "form_submission_data": { - "nullable": true, - "description": "已提交的表单数据。表单尚未提交时为 `null`。", - "$ref": "#/components/schemas/HumanInputFormSubmissionData" + "rules": { + "anyOf": [ + { + "$ref": "#/components/schemas/Rule" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "mode" + ], + "type": "object" }, - "HumanInputFormDefinition": { - "type": "object", - "description": "由人工介入节点渲染的人工介入表单定义。", + "ProcessRuleMode": { + "enum": [ + "automatic", + "custom", + "hierarchical" + ], + "type": "string" + }, + "ProviderModelWithStatusEntity": { "properties": { - "form_id": { - "type": "string", - "description": "表单唯一标识符。" - }, - "node_id": { - "type": "string", - "description": "生成该表单的人工介入节点 ID。" + "deprecated": { + "default": false, + "type": "boolean" }, - "node_title": { - "type": "string", - "description": "人工介入节点的标题。" + "features": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ModelFeature" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null }, - "form_content": { - "type": "string", - "description": "与表单一起显示的 Markdown 或文本内容。" + "fetch_from": { + "$ref": "#/components/schemas/FetchFrom" }, - "inputs": { - "type": "array", - "description": "表单中的输入字段。", - "items": { - "$ref": "#/components/schemas/FormInput" - } + "has_invalid_load_balancing_configs": { + "default": false, + "type": "boolean" }, - "actions": { - "type": "array", - "description": "表单上可用的操作按钮。", - "items": { - "$ref": "#/components/schemas/UserAction" - } + "label": { + "$ref": "#/components/schemas/I18nObject" }, - "display_in_ui": { - "type": "boolean", - "description": "表单是否应在 UI 中显示。" + "load_balancing_enabled": { + "default": false, + "type": "boolean" }, - "form_token": { - "type": "string", - "nullable": true, - "description": "表单提交认证的令牌。" + "model": { + "type": "string" }, - "resolved_default_values": { - "type": "object", + "model_properties": { "additionalProperties": true, - "description": "表单输入的已解析默认值,按输出变量名称索引。" + "propertyNames": { + "$ref": "#/components/schemas/ModelPropertyKey" + }, + "type": "object" }, - "expiration_time": { - "type": "integer", - "description": "表单过期的 Unix 时间戳。" + "model_type": { + "$ref": "#/components/schemas/ModelType" + }, + "status": { + "$ref": "#/components/schemas/ModelStatus" } - } + }, + "required": [ + "fetch_from", + "label", + "model", + "model_properties", + "model_type", + "status" + ], + "type": "object" }, - "HumanInputFormSubmissionData": { - "type": "object", - "description": "来自已提交的人工介入表单的数据。", + "ProviderWithModelsListResponse": { "properties": { - "node_id": { - "type": "string", - "description": "人工介入节点的 ID。" - }, - "node_title": { - "type": "string", - "description": "人工介入节点的标题。" - }, - "rendered_content": { - "type": "string", - "description": "表单提交的渲染内容。" - }, - "action_id": { - "type": "string", - "description": "被点击的操作按钮的 ID。" - }, - "action_text": { - "type": "string", - "description": "被点击的操作按钮的显示文本。" + "data": { + "items": { + "$ref": "#/components/schemas/ProviderWithModelsResponse" + }, + "type": "array" } - } + }, + "required": [ + "data" + ], + "type": "object" }, - "FormInput": { - "type": "object", - "description": "表单输入字段定义。", + "ProviderWithModelsResponse": { "properties": { - "type": { - "type": "string", - "description": "表单输入控件类型。可用值:`paragraph`(多行文本输入)、`select`(从列表中单选)、`file`(单文件上传)和 `file-list`(多文件上传)。" + "icon_small": { + "anyOf": [ + { + "$ref": "#/components/schemas/I18nObject" + }, + { + "type": "null" + } + ], + "default": null }, - "output_variable_name": { - "type": "string", - "description": "存储输入值的变量名称。" + "icon_small_dark": { + "anyOf": [ + { + "$ref": "#/components/schemas/I18nObject" + }, + { + "type": "null" + } + ], + "default": null }, - "default": { - "nullable": true, - "description": "该输入的默认值配置。", - "$ref": "#/components/schemas/FormInputDefault" - } - } - }, - "FormInputDefault": { - "type": "object", - "description": "表单输入的默认值配置。", - "properties": { - "type": { - "type": "string", - "description": "`variable` for dynamic values from 工作流 variables, `constant` for static values." + "label": { + "$ref": "#/components/schemas/I18nObject" }, - "selector": { - "type": "array", + "models": { "items": { - "type": "string" + "$ref": "#/components/schemas/ProviderModelWithStatusEntity" }, - "description": "当 `type` 为 `variable` 时的变量选择器路径。" + "type": "array" }, - "value": { - "type": "string", - "description": "当 `type` 为 `constant` 时的静态值。" + "provider": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/CustomConfigurationStatus" + }, + "tenant_id": { + "type": "string" } - } + }, + "required": [ + "label", + "models", + "provider", + "status", + "tenant_id" + ], + "type": "object" }, - "UserAction": { - "type": "object", - "description": "人工介入表单上的操作按钮。", + "PublishedPipelineRunResponse": { "properties": { - "id": { - "type": "string", - "description": "操作唯一标识符。" + "batch": { + "type": "string" }, - "title": { - "type": "string", - "description": "按钮显示文本。" + "dataset": { + "$ref": "#/components/schemas/PipelineDataset" }, - "button_style": { - "type": "string", - "description": "`primary`, `default`, `accent`, or `ghost`." + "documents": { + "items": { + "$ref": "#/components/schemas/PipelineDocument" + }, + "type": "array" } - } + }, + "required": [ + "batch", + "dataset", + "documents" + ], + "type": "object" }, - "WorkflowExecutionRequest": { - "type": "object", + "RequiredServiceApiUserPayload": { + "properties": { + "user": { + "type": "string" + } + }, "required": [ - "inputs", "user" ], + "type": "object" + }, + "RerankingModel": { "properties": { - "inputs": { - "type": "object", - "description": "工作流输入变量的键值对。变量名称和类型可从 [获取应用参数](/zh/api-reference/applications/get-app-parameters) 响应中的 `user_input_form` 字段获取。\n\n文件类型变量的值为文件对象数组,包含 `type`、`transfer_method` 以及 `url` 或 `upload_file_id`。", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "object" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/InputFileObject" - } - } - ] - } - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" + "reranking_model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], - "description": "响应模式。使用 `blocking` 获取同步响应(Cloudflare 超时时间为 `100 s`),使用 `streaming` 获取服务器发送事件。未指定时默认为阻塞模式。" - }, - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。用于限定数据访问范围:工作流运行及其文件仅对携带相同 `user` 的后续请求可见。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" + "default": null, + "description": "重排序模型名称。" }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/InputFileObject" - }, - "nullable": true, - "description": "文件列表。适用于需要将文件与文本组合输入的场景,仅在模型支持 Vision 能力时可用。要附加本地文件,请先通过 [上传文件](/zh/api-reference/files/upload-file) 上传,然后将返回的 `id` 作为 `upload_file_id`,并设置 `transfer_method: local_file`。" + "reranking_provider_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "type": "object" }, - "InputFileObject": { - "type": "object", + "ResultResponse": { + "properties": { + "result": { + "type": "string" + } + }, "required": [ - "type", - "transfer_method" + "result" + ], + "type": "object" + }, + "RetrievalMethod": { + "enum": [ + "full_text_search", + "hybrid_search", + "keyword_search", + "semantic_search" ], + "type": "string" + }, + "Rule": { "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "document", - "audio", - "video", - "custom" + "parent_mode": { + "anyOf": [ + { + "enum": [ + "full-doc", + "paragraph" + ], + "type": "string" + }, + { + "type": "null" + } ], - "description": "文件类型。" + "default": null }, - "transfer_method": { - "type": "string", - "enum": [ - "remote_url", - "local_file" + "pre_processing_rules": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/PreProcessingRule" + }, + "type": "array" + }, + { + "type": "null" + } ], - "description": "传输方式:文件 URL 使用 `remote_url`,上传文件使用 `local_file`。" + "default": null }, - "url": { - "type": "string", - "format": "url", - "description": "文件 URL(当 `transfer_method` 为 `remote_url` 时)。" + "segmentation": { + "anyOf": [ + { + "$ref": "#/components/schemas/Segmentation" + }, + { + "type": "null" + } + ], + "default": null }, - "upload_file_id": { - "type": "string", - "description": "已上传文件 ID,通过 [上传文件](/zh/api-reference/files/upload-file) API 预先上传获取(当 `transfer_method` 为 `local_file` 时使用)。" + "subchunk_segmentation": { + "anyOf": [ + { + "$ref": "#/components/schemas/Segmentation" + }, + { + "type": "null" + } + ], + "default": null } }, - "anyOf": [ - { - "properties": { - "transfer_method": { - "enum": [ - "remote_url" - ] + "type": "object" + }, + "SegmentAttachmentResponse": { + "properties": { + "extension": { + "type": "string" + }, + "id": { + "type": "string" + }, + "mime_type": { + "anyOf": [ + { + "type": "string" }, - "url": { - "type": "string", - "format": "url" + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "source_url": { + "type": "string" + } + }, + "required": [ + "extension", + "id", + "mime_type", + "name", + "size", + "source_url" + ], + "type": "object" + }, + "SegmentCreateItemPayload": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - }, - "required": [ - "url" ], - "not": { - "required": [ - "upload_file_id" - ] - } + "default": null }, - { - "properties": { - "transfer_method": { - "enum": [ - "local_file" - ] + "attachment_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" }, - "upload_file_id": { - "type": "string" + { + "type": "null" } - }, - "required": [ - "upload_file_id" ], - "not": { - "required": [ - "url" - ] - } + "default": null, + "description": "附件文件 ID。" + }, + "content": { + "description": "分段文本内容。", + "minLength": 1, + "type": "string" + }, + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "分段的关键词。" } - ] + }, + "required": [ + "content" + ], + "type": "object" }, - "WorkflowBlockingResponse": { - "type": "object", + "SegmentCreateListResponse": { "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "进行中的执行任务 ID。配合 [停止工作流任务](/zh/api-reference/workflow-runs/stop-workflow-task) 使用以取消运行中的工作流。仅在执行期间有效。" - }, - "workflow_run_id": { - "type": "string", - "format": "uuid", - "description": "此工作流运行记录的持久化标识符。配合 [获取工作流运行详情](/zh/api-reference/workflow-runs/get-workflow-run-detail) 使用以在执行后获取结果。" - }, "data": { - "$ref": "#/components/schemas/WorkflowFinishedData" + "items": { + "$ref": "#/components/schemas/SegmentResponse" + }, + "type": "array" + }, + "doc_form": { + "type": "string" } - } - }, - "ChunkWorkflowEvent": { - "type": "object", + }, "required": [ - "event" + "data", + "doc_form" ], + "type": "object" + }, + "SegmentCreatePayload": { "properties": { - "event": { - "type": "string", - "enum": [ - "workflow_started", - "node_started", - "node_finished", - "node_retry", - "iteration_started", - "iteration_next", - "iteration_completed", - "loop_started", - "loop_next", - "loop_completed", - "reasoning_chunk", - "text_chunk", - "workflow_finished", - "tts_message", - "tts_message_end", - "workflow_paused", - "agent_log", - "human_input_required", - "human_input_form_filled", - "human_input_form_timeout", - "error", - "ping" - ], - "description": "流式事件的类型。" + "segments": { + "description": "要创建的分段对象数组。", + "items": { + "$ref": "#/components/schemas/SegmentCreateItemPayload" + }, + "minItems": 1, + "type": "array" } }, - "discriminator": { - "propertyName": "event", - "mapping": { - "workflow_started": "#/components/schemas/WorkflowStreamEventWorkflowStarted", - "node_started": "#/components/schemas/WorkflowStreamEventNodeStarted", - "node_finished": "#/components/schemas/WorkflowStreamEventNodeFinished", - "node_retry": "#/components/schemas/WorkflowStreamEventNodeRetry", - "iteration_started": "#/components/schemas/WorkflowStreamEventIterationStarted", - "iteration_next": "#/components/schemas/WorkflowStreamEventIterationNext", - "iteration_completed": "#/components/schemas/WorkflowStreamEventIterationCompleted", - "loop_started": "#/components/schemas/WorkflowStreamEventLoopStarted", - "loop_next": "#/components/schemas/WorkflowStreamEventLoopNext", - "loop_completed": "#/components/schemas/WorkflowStreamEventLoopCompleted", - "reasoning_chunk": "#/components/schemas/StreamEventReasoningChunk", - "text_chunk": "#/components/schemas/StreamEventTextChunk", - "workflow_finished": "#/components/schemas/WorkflowStreamEventWorkflowFinished", - "tts_message": "#/components/schemas/StreamEventTtsMessage", - "tts_message_end": "#/components/schemas/StreamEventTtsMessageEnd", - "error": "#/components/schemas/StreamEventError", - "ping": "#/components/schemas/StreamEventPing", - "workflow_paused": "#/components/schemas/WorkflowStreamEventWorkflowPaused", - "agent_log": "#/components/schemas/WorkflowStreamEventAgentLog", - "human_input_required": "#/components/schemas/WorkflowStreamEventHumanInputRequired", - "human_input_form_filled": "#/components/schemas/WorkflowStreamEventHumanInputFormFilled", - "human_input_form_timeout": "#/components/schemas/WorkflowStreamEventHumanInputFormTimeout" + "required": [ + "segments" + ], + "type": "object" + }, + "SegmentDetailResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/SegmentResponse" + }, + "doc_form": { + "type": "string" } - } + }, + "required": [ + "data", + "doc_form" + ], + "type": "object" }, - "StreamEventReasoningChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentListQuery": { + "properties": { + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "搜索关键词。" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "limit": { + "default": 20, + "description": "每页的项目数量。服务器上限为 `100`。", + "minimum": 1, + "type": "integer" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "reasoning": { - "type": "string", - "description": "由 `reasoning_format` 为 `separated` 的 LLM 节点发送的推理内容增量。拼接连续的 `reasoning_chunk` 事件即可还原完整推理内容。本流与 `text_chunk` 并行;`text` 流不含 `` 标签。" - }, - "node_id": { - "type": "string", - "nullable": true, - "description": "产生该推理内容的 LLM 节点 ID。当多个 LLM 节点运行时,可据此归属推理内容。" - }, - "is_final": { - "type": "boolean", - "description": "`true` 标志 LLM 节点推理阶段结束(即「思考完成」信号);该事件的 `reasoning` 可能为空。" - } - } - } - } + "page": { + "default": 1, + "minimum": 1, + "type": "integer" + }, + "status": { + "items": { + "type": "string" + }, + "type": "array" } - ] + }, + "type": "object" }, - "StreamEventTextChunk": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentListResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/SegmentResponse" + }, + "type": "array" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "doc_form": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "文本内容块。" - }, - "from_variable_selector": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true, - "description": "工作流中文本变量的源路径。" - } - } - } - } + "has_more": { + "type": "boolean" + }, + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "total": { + "type": "integer" } - ] + }, + "required": [ + "data", + "doc_form", + "has_more", + "limit", + "page", + "total" + ], + "type": "object" }, - "StreamEventTtsMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentResponse": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "attachments": { + "items": { + "$ref": "#/components/schemas/SegmentAttachmentResponse" + }, + "type": "array" }, - { - "type": "object", - "properties": { - "audio": { - "type": "string", - "format": "byte", - "description": "Base64 编码的 MP3 音频块。按顺序解码并拼接所有块即可生成完整的音频文件。" + "child_chunks": { + "items": { + "$ref": "#/components/schemas/ChildChunkResponse" + }, + "type": "array" + }, + "completed_at": { + "anyOf": [ + { + "type": "integer" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "该音频块生成时的 Unix 时间戳。" + { + "type": "null" } - } - } - ] - }, - "StreamEventTtsMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ] }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "content": { + "type": "string" }, - { - "type": "object", - "properties": { - "audio": { - "type": "string", - "description": "空字符串。标识音频流结束。" + "created_at": { + "type": "integer" + }, + "created_by": { + "type": "string" + }, + "disabled_at": { + "anyOf": [ + { + "type": "integer" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "音频流结束时的 Unix 时间戳。" + { + "type": "null" } - } - } - ] - }, - "StreamEventError": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" - }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + ] }, - { - "type": "object", - "properties": { - "status": { - "type": "integer", - "description": "错误的 HTTP 状态码。" + "disabled_by": { + "anyOf": [ + { + "type": "string" }, - "code": { - "type": "string", - "description": "错误码。" + { + "type": "null" + } + ] + }, + "document_id": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "error": { + "anyOf": [ + { + "type": "string" }, - "message": { - "type": "string", - "description": "错误信息。" + { + "type": "null" } - } - } - ] - }, - "StreamEventPing": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ] + }, + "hit_count": { + "type": "integer" }, - { - "type": "object", - "description": "保活 ping 事件。以 `event: ping` 行的形式送达,无 `data:` 载荷;每个流的第一个事件都是 `ping`。" - } - ] - }, - "WorkflowFinishedData": { - "type": "object", - "properties": { "id": { - "type": "string", - "format": "uuid", - "description": "工作流运行 ID。" + "type": "string" }, - "workflow_id": { - "type": "string", - "format": "uuid", - "description": "工作流 ID." + "index_node_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "status": { - "type": "string", - "description": "工作流执行状态。`running` 表示执行中,`succeeded` 表示成功完成,`failed` 表示执行出错,`stopped` 表示手动停止,`partial-succeeded` 表示部分节点成功但其他失败,`paused` 表示等待人工介入。" + "index_node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "工作流的输出数据。" + "indexing_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] }, - "error": { - "type": "string", - "nullable": true, - "description": "工作流失败时的错误消息。" + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ] }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "总耗时(秒)。" + "position": { + "type": "integer" }, - "total_tokens": { - "type": "integer", - "description": "所有节点消耗的总令牌数。" + "sign_content": { + "type": "string" }, - "total_steps": { - "type": "integer", - "description": "已执行的工作流总步数。" + "status": { + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "工作流运行创建时的 Unix 时间戳。" + "stopped_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] }, - "finished_at": { - "type": "integer", - "format": "int64", - "nullable": true, - "description": "工作流运行结束时的 Unix 时间戳。" + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "created_by": { - "type": "object", - "additionalProperties": true, - "description": "创建者信息。仅存在于流式 `workflow_finished` 事件中。" + "tokens": { + "type": "integer" }, - "exceptions_count": { - "type": "integer", - "nullable": true, - "description": "执行过程中遇到的异常数量。仅在流式 `workflow_finished` 事件中出现。" + "updated_at": { + "type": "integer" }, - "files": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "nullable": true, - "description": "工作流执行期间生成的文件。仅存在于流式 `workflow_finished` 事件中。" - } - } - }, - "WorkflowStreamEventBase": { - "type": "object", - "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "进行中的执行任务 ID。配合 [停止工作流任务](/zh/api-reference/workflow-runs/stop-workflow-task) 使用以取消运行中的工作流。仅在执行期间有效。" + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "workflow_run_id": { - "type": "string", - "format": "uuid", - "description": "此工作流运行记录的持久化标识符。配合 [获取工作流运行详情](/zh/api-reference/workflow-runs/get-workflow-run-detail) 使用以在执行后获取结果。" + "word_count": { + "type": "integer" } - } + }, + "required": [ + "answer", + "attachments", + "child_chunks", + "completed_at", + "content", + "created_at", + "created_by", + "disabled_at", + "disabled_by", + "document_id", + "enabled", + "error", + "hit_count", + "id", + "index_node_hash", + "index_node_id", + "indexing_at", + "keywords", + "position", + "sign_content", + "status", + "stopped_at", + "summary", + "tokens", + "updated_at", + "updated_by", + "word_count" + ], + "type": "object" }, - "WorkflowStreamEventWorkflowStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentUpdateArgs": { + "properties": { + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "attachment_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "附件文件 ID。" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "工作流运行 ID。" - }, - "workflow_id": { - "type": "string", - "format": "uuid", - "description": "工作流 ID." - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "本次工作流运行的输入变量。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "工作流运行开始时的 Unix 时间戳。" - }, - "reason": { - "type": "string", - "description": "工作流启动原因。`initial` 表示新执行,`resumption` 表示从暂停状态恢复。" - } - } + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventWorkflowFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "分段是否已启用。" }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/WorkflowFinishedData" + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventNodeStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "regenerate_child_chunks": { + "default": false, + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "节点执行 ID。" - }, - "node_id": { - "type": "string", - "description": "工作流图中的节点 ID。" - }, - "node_type": { - "type": "string", - "description": "节点类型(例如 `llm`、`code`、`template-transform`)。" - }, - "title": { - "type": "string", - "description": "节点的显示名称。" - }, - "index": { - "type": "integer", - "description": "执行序列索引。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "前驱节点的 ID(如有)。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "该节点的输入变量。" - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` 数据是否被截断。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "节点执行开始时的 Unix 时间戳。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "description": "节点执行的附加元数据。" - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "如果该节点在迭代内运行,则为父迭代 ID。" - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "如果该节点在循环内运行,则为父循环 ID。" - } - } + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "description": "摘要索引的摘要内容。" } - ] + }, + "type": "object" }, - "WorkflowStreamEventNodeFinished": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SegmentUpdatePayload": { + "properties": { + "segment": { + "$ref": "#/components/schemas/SegmentUpdateArgs" + } + }, + "required": [ + "segment" + ], + "type": "object" + }, + "Segmentation": { + "properties": { + "chunk_overlap": { + "default": 0, + "description": "分段之间的令牌重叠数。", + "type": "integer" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "max_tokens": { + "description": "每个分段的最大令牌数。", + "type": "integer" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "节点执行 ID。" - }, - "node_id": { - "type": "string", - "description": "工作流图中的节点 ID。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "节点的显示名称。" - }, - "index": { - "type": "integer", - "description": "执行序列索引。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "前驱节点的 ID(如有)。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "该节点的输入变量。" - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` 数据是否被截断。" - }, - "process_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "节点执行期间生成的处理数据。" - }, - "process_data_truncated": { - "type": "boolean", - "description": "`process_data` 是否被截断。" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "节点的输出数据。" - }, - "outputs_truncated": { - "type": "boolean", - "description": "`outputs` 数据是否被截断。" - }, - "status": { - "type": "string", - "description": "节点执行状态。`running` 表示进行中,`succeeded` 表示已完成,`failed` 表示出错,`stopped` 表示手动停止,`exception` 表示意外失败。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "节点失败时的错误消息。" - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "耗时(秒)。" - }, - "execution_metadata": { - "type": "object", - "nullable": true, - "description": "执行元数据,包含令牌用量。", - "properties": { - "total_tokens": { - "type": "integer", - "nullable": true, - "description": "该节点消耗的总令牌数。" - }, - "total_price": { - "type": "number", - "format": "float", - "nullable": true, - "description": "该节点执行的总费用。" - }, - "currency": { - "type": "string", - "nullable": true, - "description": "费用货币(例如 `USD`)。" - } - } - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "节点执行开始时的 Unix 时间戳。" - }, - "finished_at": { - "type": "integer", - "format": "int64", - "description": "节点执行结束时的 Unix 时间戳。" - }, - "files": { - "type": "array", - "nullable": true, - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "该节点生成的文件。" - }, - "iteration_id": { - "type": "string", - "nullable": true, - "description": "如果该节点在迭代内运行,则为父迭代 ID。" - }, - "loop_id": { - "type": "string", - "nullable": true, - "description": "如果该节点在循环内运行,则为父循环 ID。" - } - } - } - } + "separator": { + "default": "\n", + "description": "用于拆分文本的自定义分隔符。", + "type": "string" } - ] + }, + "required": [ + "max_tokens" + ], + "type": "object" }, - "WorkflowStreamEventNodeRetry": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SelectInputConfig": { + "properties": { + "option_source": { + "$ref": "#/components/schemas/StringListSource" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "output_variable_name": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "节点执行 ID。" - }, - "node_id": { - "type": "string", - "description": "工作流图中的节点 ID。" - }, - "node_type": { - "type": "string", - "description": "Node type." - }, - "title": { - "type": "string", - "description": "节点的显示名称。" - }, - "index": { - "type": "integer", - "description": "执行序列索引。" - }, - "predecessor_node_id": { - "type": "string", - "nullable": true, - "description": "前驱节点的 ID(如有)。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` 数据是否被截断。" - }, - "process_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "节点执行期间生成的处理数据。" - }, - "process_data_truncated": { - "type": "boolean", - "description": "`process_data` 是否被截断。" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "outputs_truncated": { - "type": "boolean", - "description": "`outputs` 数据是否被截断。" - }, - "status": { - "type": "string", - "description": "重试点的节点执行状态。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "触发重试的错误消息。" - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "耗时(秒)。" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "finished_at": { - "type": "integer", - "format": "int64" - }, - "retry_index": { - "type": "integer", - "description": "从零开始的重试次数索引。" - }, - "iteration_id": { - "type": "string", - "nullable": true - }, - "loop_id": { - "type": "string", - "nullable": true - }, - "execution_metadata": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "节点执行的元数据。" - }, - "files": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "节点在执行期间生成的文件。" - } - } - } - } + "type": { + "const": "select", + "default": "select", + "type": "string" } - ] + }, + "required": [ + "option_source", + "output_variable_name" + ], + "type": "object" }, - "WorkflowStreamEventIterationStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SimpleAccountResponse": { + "properties": { + "email": { + "type": "string" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "id": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "节点执行 ID。" - }, - "node_id": { - "type": "string", - "description": "迭代节点 ID。" - }, - "node_type": { - "type": "string", - "description": "节点类型(始终为 `iteration`)。" - }, - "title": { - "type": "string", - "description": "迭代节点的显示名称。" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "description": "迭代的输入变量。" - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` 数据是否被截断。" - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "迭代元数据。" - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } - } - } + "name": { + "type": "string" } - ] + }, + "required": [ + "email", + "id", + "name" + ], + "type": "object" }, - "WorkflowStreamEventIterationNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SimpleConversation": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "id": { + "format": "uuid", + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "index": { - "type": "integer", - "description": "当前迭代索引(从零开始)。" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } + "inputs": { + "additionalProperties": { + "$ref": "#/components/schemas/JSONValue" + }, + "type": "object" + }, + "introduction": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventIterationCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "name": { + "type": "string" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "outputs_truncated": { - "type": "boolean", - "description": "`outputs` 数据是否被截断。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "迭代的输入变量。" - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` 数据是否被截断。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "迭代开始时的 Unix 时间戳。" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "迭代的附加元数据。" - }, - "status": { - "type": "string", - "description": "迭代完成状态。" - }, - "error": { - "type": "string", - "nullable": true - }, - "elapsed_time": { - "type": "number", - "format": "float" - }, - "total_tokens": { - "type": "integer" - }, - "execution_metadata": { - "type": "object", - "additionalProperties": true, - "description": "执行元数据,包含令牌用量。" - }, - "finished_at": { - "type": "integer", - "format": "int64" - }, - "steps": { - "type": "integer", - "description": "已完成的迭代步数。" - } - } + "status": { + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" } - } + ], + "default": null } - ] + }, + "required": [ + "id", + "inputs", + "name", + "status" + ], + "type": "object" }, - "WorkflowStreamEventLoopStarted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "SimpleEndUser": { + "properties": { + "id": { + "type": "string" }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "is_anonymous": { + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "inputs": { - "type": "object", - "additionalProperties": true - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` 数据是否被截断。" - }, - "metadata": { - "type": "object", - "additionalProperties": true - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } + "session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "is_anonymous", + "type" + ], + "type": "object" + }, + "SimpleFeedback": { + "properties": { + "rating": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null } - ] + }, + "type": "object" }, - "WorkflowStreamEventLoopNext": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" - }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "SimpleResultResponse": { + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ], + "type": "object" + }, + "SimpleResultStringListResponse": { + "properties": { + "data": { + "items": { + "type": "string" + }, + "type": "array" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "index": { - "type": "integer", - "description": "当前循环迭代索引(从零开始)。" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "pre_loop_output": { - "description": "上一次循环迭代的输出。", - "nullable": true - }, - "extras": { - "type": "object", - "additionalProperties": true - } - } - } - } + "result": { + "type": "string" } - ] + }, + "required": [ + "data", + "result" + ], + "type": "object" }, - "WorkflowStreamEventLoopCompleted": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + "Site": { + "properties": { + "chat_color_theme": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "chat_color_theme_inverted": { + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "node_id": { - "type": "string" - }, - "node_type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "nullable": true - }, - "outputs_truncated": { - "type": "boolean", - "description": "`outputs` 数据是否被截断。" - }, - "inputs": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "循环的输入变量。" - }, - "inputs_truncated": { - "type": "boolean", - "description": "`inputs` 数据是否被截断。" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "extras": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "循环的附加元数据。" - }, - "status": { - "type": "string", - "description": "循环完成状态。" - }, - "error": { - "type": "string", - "nullable": true - }, - "elapsed_time": { - "type": "number", - "format": "float" - }, - "total_tokens": { - "type": "integer" - }, - "execution_metadata": { - "type": "object", - "additionalProperties": true, - "description": "执行元数据,包含令牌用量。" - }, - "finished_at": { - "type": "integer", - "format": "int64" - }, - "steps": { - "type": "integer", - "description": "已完成的循环迭代次数。" - } - } + "copyright": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventHumanInputRequired": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "custom_disclaimer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "form_id": { - "type": "string", - "description": "表单实例的标识符,会在错误消息和日志中出现。Service API 调用请使用 `form_token`。" - }, - "node_id": { - "type": "string", - "description": "产生该表单的 Human Input 节点 ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input 节点的显示标题。" - }, - "form_content": { - "type": "string", - "description": "已替换工作流变量的预渲染表单正文。" - }, - "inputs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "表单输入控件类型。可用值:`paragraph`(多行文本输入)、`select`(从列表中单选)、`file`(单文件上传)和 `file-list`(多文件上传)。" - }, - "output_variable_name": { - "type": "string", - "description": "引用该输入提交值在工作流中使用的变量名。对应提交 `inputs` 对象中的键。" - }, - "default": { - "type": "object", - "nullable": true, - "description": "从工作流上下文解析得到的默认值。未配置默认值时为 `null`。", - "properties": { - "type": { - "type": "string", - "description": "默认值来源。`constant` 表示将 `value` 作为字面字符串;`variable` 表示 `selector` 指向工作流变量。" - }, - "selector": { - "type": "array", - "items": { - "type": "string" - }, - "description": "当 `type` 为 `variable` 时,变量引用路径(例如 `[\"node_id\", \"var_name\"]`)。至少包含两个元素。" - }, - "value": { - "type": "string", - "description": "当 `type` 为 `constant` 时的字面默认值。始终为字符串。" - } - } - } - } - }, - "description": "接收者需要填写的表单输入字段。" - }, - "actions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "maxLength": 20, - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "操作按钮的标识。当接收者选择该按钮时,作为 `action` 传入 [提交人工介入表单](/zh/api-reference/human-input/submit-human-input-form)。" - }, - "title": { - "type": "string", - "maxLength": 100, - "description": "显示给接收者的按钮文本。" - }, - "button_style": { - "type": "string", - "description": "按钮视觉样式。可用值:`primary`、`default`、`accent`、`ghost`。" - } - } - }, - "description": "接收者提交时可选择的用户操作(按钮)。" - }, - "display_in_ui": { - "type": "boolean", - "description": "表单是否也在 Dify 控制台中显示。" - }, - "form_token": { - "type": "string", - "nullable": true, - "description": "[获取人工介入表单](/zh/api-reference/human-input/get-human-input-form) 和 [提交人工介入表单](/zh/api-reference/human-input/submit-human-input-form) 的访问令牌。当人工介入节点使用邮件或控制台送达时为 `null`(Service API 仅能处理 Web 应用送达的表单)。" - }, - "resolved_default_values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "按输入的 `output_variable_name` 分组的预填充默认值。所有值均为字符串。" - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix 时间戳(秒),超过后表单无法再被提交。" - } - } + "default_language": { + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventWorkflowPaused": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "workflow_run_id": { - "type": "string", - "format": "uuid", - "description": "此工作流运行记录的持久化标识符。配合 [获取工作流运行详情](/zh/api-reference/workflow-runs/get-workflow-run-detail) 使用以在执行后获取结果。" - }, - "paused_nodes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "已暂停的节点 ID 列表。" - }, - "outputs": { - "type": "object", - "additionalProperties": true, - "description": "暂停时的部分输出。" - }, - "reasons": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - }, - "description": "暂停原因。" - }, - "status": { - "type": "string", - "description": "工作流执行状态。" - }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "创建时间戳。" - }, - "elapsed_time": { - "type": "number", - "format": "float", - "description": "总耗时(秒)。" - }, - "total_tokens": { - "type": "integer", - "description": "消耗的总令牌数。" - }, - "total_steps": { - "type": "integer", - "description": "已执行的总步数。" - } - } + "icon_background": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventHumanInputFormFilled": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "icon_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "表单被填写的 Human Input 节点 ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input 节点的显示标题。" - }, - "rendered_content": { - "type": "string", - "description": "包含接收者提交值的渲染后表单内容(`human_input_required` 上的 `form_content` 是未填写的模板)。" - }, - "action_id": { - "type": "string", - "description": "接收者所选操作的标识(与传入 [提交人工介入表单](/zh/api-reference/human-input/submit-human-input-form) 的 `action` 一致)。" - }, - "action_text": { - "type": "string", - "description": "所选操作的显示文本。" - }, - "submitted_data": { - "type": "object", - "additionalProperties": true, - "nullable": true, - "description": "接收者提交的表单值,以各输入项的 `output_variable_name` 为键。" - } - } + "icon_url": { + "anyOf": [ + { + "format": "url", + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventHumanInputFormTimeout": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "readOnly": true }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "input_placeholder": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "node_id": { - "type": "string", - "description": "表单过期的 Human Input 节点 ID。" - }, - "node_title": { - "type": "string", - "description": "Human Input 节点的显示标题。" - }, - "expiration_time": { - "type": "integer", - "format": "int64", - "description": "Unix 时间戳(秒),表示表单过期时刻。" - } - } + "privacy_policy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } - } - ] - }, - "WorkflowStreamEventAgentLog": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkWorkflowEvent" + ], + "default": null }, - { - "$ref": "#/components/schemas/WorkflowStreamEventBase" + "show_workflow_steps": { + "type": "boolean" }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "node_execution_id": { - "type": "string", - "description": "节点执行 ID。" - }, - "id": { - "type": "string", - "description": "Agent 日志条目 ID。" - }, - "label": { - "type": "string", - "description": "Log label." - }, - "parent_id": { - "type": "string", - "nullable": true, - "description": "父日志条目 ID。" - }, - "error": { - "type": "string", - "nullable": true, - "description": "Agent 步骤失败时的错误消息。" - }, - "status": { - "type": "string", - "description": "Agent 步骤状态。" - }, - "data": { - "type": "object", - "additionalProperties": true, - "description": "Agent 步骤数据。" - }, - "metadata": { - "type": "object", - "additionalProperties": true, - "description": "Agent 步骤元数据。" - }, - "node_id": { - "type": "string", - "description": "Node ID." - } - } - } - } + "title": { + "type": "string" + }, + "use_icon_as_answer_icon": { + "type": "boolean" } - ] - }, - "CompletionRequest": { - "type": "object", + }, "required": [ - "inputs", - "user" + "chat_color_theme_inverted", + "default_language", + "icon_url", + "show_workflow_steps", + "title", + "use_icon_as_answer_icon" ], + "type": "object" + }, + "StringListSource": { "properties": { - "inputs": { - "type": "object", - "description": "应用输入变量的值,以变量名为键。变量名称和类型可从 [获取应用参数](/zh/api-reference/applications/get-app-parameters) 响应中的 `user_input_form` 字段获取。", - "additionalProperties": true - }, - "query": { - "type": "string", - "default": "", - "description": "要处理的文本。旧版字段;较新的应用改为在 `inputs` 中传递。" - }, - "response_mode": { - "type": "string", - "enum": [ - "streaming", - "blocking" - ], - "description": "响应返回模式。`streaming`(推荐)使用 SSE。`blocking` 等待完成后返回(长时间处理可能会被中断)。Cloudflare 超时为 `100 s`。省略时默认为阻塞模式。" + "selector": { + "items": { + "type": "string" + }, + "type": "array" }, - "user": { - "type": "string", - "description": "终端用户标识,由你的应用定义,需在应用内唯一。消息和文件仅对携带相同 `user` 的请求可见。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" + "type": { + "$ref": "#/components/schemas/ValueSourceType" }, - "files": { - "type": "array", + "value": { "items": { - "$ref": "#/components/schemas/InputFileObject" + "type": "string" }, - "description": "要附加到请求的文件。本地文件需先通过 [上传文件](/zh/api-reference/files/upload-file) 上传,再将返回的 `id` 作为 `upload_file_id` 引用,并设置 `transfer_method: local_file`。" + "type": "array" } - } + }, + "required": [ + "type" + ], + "type": "object" }, - "CompletionResponse": { - "type": "object", + "StringSource": { "properties": { - "event": { - "type": "string", - "description": "事件类型,固定为 `message`。" + "selector": { + "items": { + "type": "string" + }, + "type": "array" }, - "task_id": { - "type": "string", - "format": "uuid", - "description": "用于请求追踪和 [停止响应](/zh/api-reference/completion-messages/stop-completion-message-generation) API 的任务 ID。" + "type": { + "$ref": "#/components/schemas/ValueSourceType" }, - "id": { - "type": "string", - "format": "uuid", - "description": "该响应事件的唯一 ID。" + "value": { + "default": "", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "SystemParameters": { + "properties": { + "audio_file_size_limit": { + "type": "integer" }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "唯一的消息 ID。调用反馈或推荐问题接口时,将此值作为 `message_id` 参数使用。" + "file_size_limit": { + "type": "integer" }, - "mode": { - "type": "string", - "description": "应用模式,固定为 `completion`。" + "image_file_size_limit": { + "type": "integer" }, - "answer": { - "type": "string", - "description": "完整的响应内容。" + "video_file_size_limit": { + "type": "integer" }, - "metadata": { - "type": "object", - "description": "包含用量和检索资源的元数据。", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" - }, - "retriever_resources": { - "type": "array", - "description": "使用的检索资源列表。", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } - } - } + "workflow_file_upload_limit": { + "type": "integer" + } + }, + "required": [ + "audio_file_size_limit", + "file_size_limit", + "image_file_size_limit", + "video_file_size_limit", + "workflow_file_upload_limit" + ], + "type": "object" + }, + "TagBindingPayload": { + "properties": { + "tag_ids": { + "items": { + "type": "string" + }, + "minItems": 1, + "type": "array" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "消息创建时间戳(Unix 纪元秒)。" + "target_id": { + "type": "string" } - } + }, + "required": [ + "tag_ids", + "target_id" + ], + "type": "object" }, - "ChunkCompletionEvent": { - "type": "object", + "TagCreatePayload": { "properties": { - "event": { - "type": "string", - "enum": [ - "message", - "message_end", - "message_file", - "tts_message", - "tts_message_end", - "message_replace", - "error", - "ping" - ], - "description": "流式事件的类型。" + "name": { + "description": "Tag name.", + "maxLength": 50, + "minLength": 1, + "type": "string" } }, - "discriminator": { - "propertyName": "event", - "mapping": { - "message": "#/components/schemas/StreamEventMessage", - "message_end": "#/components/schemas/StreamEventMessageEnd", - "message_file": "#/components/schemas/StreamEventMessageFile", - "tts_message": "#/components/schemas/CompletionStreamEventTtsMessage", - "tts_message_end": "#/components/schemas/CompletionStreamEventTtsMessageEnd", - "message_replace": "#/components/schemas/StreamEventMessageReplace", - "error": "#/components/schemas/CompletionStreamEventError", - "ping": "#/components/schemas/CompletionStreamEventPing" + "required": [ + "name" + ], + "type": "object" + }, + "TagDeletePayload": { + "properties": { + "tag_id": { + "type": "string" } - } + }, + "required": [ + "tag_id" + ], + "type": "object" }, - "StreamEventMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" - }, + "TagUnbindingPayload": { + "anyOf": [ { - "type": "object", - "description": "LLM 返回文本块事件。", "properties": { - "answer": { - "type": "string", - "description": "LLM 返回的文本块内容。" + "tag_id": { + "deprecated": true, + "type": "string" + }, + "tag_ids": { + "items": { + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "target_id": { + "type": "string" } - } - } - ] - }, - "StreamEventMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + }, + "required": [ + "tag_id", + "target_id" + ], + "type": "object" }, { - "type": "object", - "description": "消息结束事件,收到此事件表示流式输出已结束。", "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "消息的唯一 ID。" - }, - "metadata": { - "type": "object", - "description": "包含用量和检索资源的元数据。", - "properties": { - "usage": { - "$ref": "#/components/schemas/Usage" + "tag_id": { + "anyOf": [ + { + "type": "string" }, - "retriever_resources": { - "type": "array", - "description": "使用的检索资源列表。", - "items": { - "$ref": "#/components/schemas/RetrieverResource" - } + { + "type": "null" } - } + ], + "deprecated": true }, - "files": { - "type": "array", - "nullable": true, - "description": "本次消息生成的文件,例如模型生成的图片。未生成任何文件时为 `null`。", + "tag_ids": { "items": { - "type": "object", - "properties": { - "related_id": { - "type": "string", - "description": "消息文件记录的 ID。" - }, - "type": { - "type": "string", - "description": "文件类型,例如 `image`。" - }, - "filename": { - "type": "string", - "description": "文件名。" - }, - "extension": { - "type": "string", - "description": "文件扩展名,包含前导点,例如 `.png`。" - }, - "mime_type": { - "type": "string", - "description": "文件的 MIME 类型。" - }, - "size": { - "type": "integer", - "description": "文件大小,单位为字节。" - }, - "transfer_method": { - "type": "string", - "description": "文件的引用方式:`remote_url`、`local_file` 或 `tool_file`。" - }, - "url": { - "type": "string", - "description": "文件的可访问 URL。" - }, - "upload_file_id": { - "type": "string", - "description": "关联的上传文件 ID。" - }, - "remote_url": { - "type": "string", - "nullable": true, - "description": "当文件以远程 URL 形式提供时的原始远程 URL,否则为空字符串。" - } - } - } + "type": "string" + }, + "minItems": 1, + "type": "array" + }, + "target_id": { + "type": "string" } - } + }, + "required": [ + "tag_ids", + "target_id" + ], + "type": "object" } ] }, - "StreamEventMessageFile": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "TagUpdatePayload": { + "properties": { + "name": { + "description": "Tag name.", + "maxLength": 50, + "minLength": 1, + "type": "string" }, - { - "type": "object", - "description": "消息文件事件,生成过程中产生的文件(通常为模型生成的图片)。", - "properties": { - "id": { - "type": "string", + "tag_id": { + "type": "string" + } + }, + "required": [ + "name", + "tag_id" + ], + "type": "object" + }, + "TextToAudioPayload": { + "properties": { + "message_id": { + "anyOf": [ + { "format": "uuid", - "description": "文件唯一 ID。" + "type": "string" }, - "type": { - "type": "string", - "description": "文件类型,例如 `image`。" + { + "type": "null" + } + ], + "default": null + }, + "streaming": { + "anyOf": [ + { + "type": "boolean" }, - "belongs_to": { - "type": "string", - "enum": [ - "assistant" - ], - "description": "该文件的归属方,此处始终为 `assistant`。" + { + "type": "null" + } + ], + "default": null + }, + "text": { + "anyOf": [ + { + "type": "string" }, - "url": { - "type": "string", - "format": "url", - "description": "文件的远程 URL。" + { + "type": "null" } - } + ], + "default": null + }, + "voice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } - ] + }, + "type": "object" }, - "StreamEventMessageReplace": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "TextToAudioPayloadWithUser": { + "properties": { + "message_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + "streaming": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null }, - { - "type": "object", - "description": "消息内容替换事件(例如由于内容审核)。", - "properties": { - "answer": { - "type": "string", - "description": "替换内容。" + "text": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "user": { + "type": "string" + }, + "voice": { + "anyOf": [ + { + "type": "string" }, - "reason": { - "type": "string", - "description": "内容替换的原因。" + { + "type": "null" } - } + ], + "default": null } - ] + }, + "type": "object" }, - "CompletionStreamEventBase": { - "type": "object", + "ToolIcon": { "properties": { - "task_id": { - "type": "string", - "format": "uuid", - "description": "任务 ID。" - }, - "message_id": { - "type": "string", - "format": "uuid", - "description": "唯一消息 ID。" + "background": { + "type": "string" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "创建时间戳。" + "content": { + "type": "string" } - } + }, + "required": [ + "background", + "content" + ], + "type": "object" }, - "CompletionStreamEventTtsMessage": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" - }, - { - "type": "object", - "description": "TTS 音频流事件(base64 编码的 MP3)。在启用自动播放时可用。", - "properties": { - "audio": { - "type": "string", - "format": "byte", - "description": "Base64 编码的 MP3 音频块。按顺序解码并拼接所有块即可生成完整的音频文件。" - } - } + "UrlResponse": { + "properties": { + "url": { + "type": "string" } - ] + }, + "required": [ + "url" + ], + "type": "object" }, - "CompletionStreamEventTtsMessageEnd": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "UserActionConfig": { + "properties": { + "button_style": { + "$ref": "#/components/schemas/ButtonStyle", + "default": "default" }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + "id": { + "maxLength": 20, + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "type": "string" }, - { - "type": "object", - "description": "TTS 音频流结束事件。", - "properties": { - "audio": { - "type": "string", - "description": "空字符串。标识音频流结束。" - } - } + "title": { + "maxLength": 100, + "type": "string" } - ] + }, + "required": [ + "id", + "title" + ], + "type": "object" }, - "CompletionStreamEventError": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" - }, - { - "$ref": "#/components/schemas/CompletionStreamEventBase" + "ValueSourceType": { + "enum": [ + "constant", + "variable" + ], + "type": "string" + }, + "WeightKeywordSetting": { + "properties": { + "keyword_weight": { + "description": "分配给关键词搜索结果的权重。", + "type": "number" + } + }, + "required": [ + "keyword_weight" + ], + "type": "object" + }, + "WeightModel": { + "properties": { + "keyword_setting": { + "anyOf": [ + { + "$ref": "#/components/schemas/WeightKeywordSetting" + }, + { + "type": "null" + } + ], + "default": null, + "description": "关键词搜索权重设置。" }, - { - "type": "object", - "description": "流式输出过程中的错误事件。", - "properties": { - "status": { - "type": "integer", - "description": "HTTP 状态码。" + "vector_setting": { + "anyOf": [ + { + "$ref": "#/components/schemas/WeightVectorSetting" }, - "code": { - "type": "string", - "description": "错误码。" + { + "type": "null" + } + ], + "default": null, + "description": "语义搜索权重设置。" + }, + "weight_type": { + "anyOf": [ + { + "enum": [ + "customized", + "keyword_first", + "semantic_first" + ], + "type": "string" }, - "message": { - "type": "string", - "description": "错误信息。" + { + "type": "null" } - } + ], + "default": null, + "description": "平衡语义搜索和关键词搜索权重的策略。" } - ] + }, + "type": "object" }, - "CompletionStreamEventPing": { - "allOf": [ - { - "$ref": "#/components/schemas/ChunkCompletionEvent" + "WeightVectorSetting": { + "properties": { + "embedding_model_name": { + "description": "用于向量搜索的嵌入模型名称。", + "type": "string" }, - { - "type": "object", - "description": "Ping 事件,用于保持连接活跃。以 `event: ping` 行的形式送达,无 `data:` 载荷。" + "embedding_provider_name": { + "description": "用于向量搜索的嵌入模型供应商。", + "type": "string" + }, + "vector_weight": { + "type": "number" } - ] + }, + "required": [ + "embedding_model_name", + "embedding_provider_name", + "vector_weight" + ], + "type": "object" }, - "Dataset": { - "type": "object", + "WorkflowAppLogPaginationResponse": { "properties": { - "id": { - "type": "string", - "description": "知识库的唯一标识符。" - }, - "name": { - "type": "string", - "description": "知识库的显示名称。在工作区内唯一。" - }, - "description": { - "type": "string", - "description": "描述知识库用途或内容的可选文本。" - }, - "provider": { - "type": "string", - "description": "供应商类型。内部管理为 `vendor`,外部知识库连接为 `external`。" - }, - "permission": { - "type": "string", - "description": "控制谁可以访问此知识库。可选值:`only_me`、`all_team_members`、`partial_members`。" - }, - "data_source_type": { - "type": "string", - "description": "文档的数据源类型,尚未配置时为 `null`。" - }, - "indexing_technique": { - "type": "string", - "description": "`high_quality` 使用嵌入模型进行精确搜索;`economy` 使用基于关键词的索引。" - }, - "app_count": { - "type": "integer", - "description": "当前使用该知识库的应用数量。" - }, - "document_count": { - "type": "integer", - "description": "知识库中的文档总数。" + "data": { + "items": { + "$ref": "#/components/schemas/WorkflowAppLogPartialResponse" + }, + "type": "array" }, - "word_count": { - "type": "integer", - "description": "所有文档的总字数。" + "has_more": { + "type": "boolean" }, - "created_by": { - "type": "string", - "description": "创建该知识库的用户 ID。" + "limit": { + "type": "integer" }, - "author_name": { - "type": "string", - "description": "创建者的显示名称。" + "page": { + "type": "integer" }, + "total": { + "type": "integer" + } + }, + "required": [ + "data", + "has_more", + "limit", + "page", + "total" + ], + "type": "object" + }, + "WorkflowAppLogPartialResponse": { + "properties": { "created_at": { - "type": "number", - "description": "创建时间戳(Unix 纪元,单位为秒)。" - }, - "updated_by": { - "type": "string", - "description": "最后更新该知识库的用户 ID。" - }, - "updated_at": { - "type": "number", - "description": "最后更新时间戳(Unix 纪元,单位为秒)。" - }, - "embedding_model": { - "type": "string", - "description": "用于索引的嵌入模型名称。" - }, - "embedding_model_provider": { - "type": "string", - "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。旧版知识库可能返回简写形式(例如 `openai`)。" - }, - "embedding_available": { - "type": "boolean", - "description": "配置的嵌入模型当前是否可用。" - }, - "retrieval_model_dict": { - "type": "object", - "description": "知识库的检索配置。", - "properties": { - "search_method": { - "type": "string", - "description": "用于检索的搜索方式。`keyword_search` 表示关键词匹配,`semantic_search` 表示基于嵌入的语义相似度,`full_text_search` 表示全文索引,`hybrid_search` 表示语义和关键词混合搜索。" - }, - "reranking_enable": { - "type": "boolean", - "description": "是否启用重排序。" - }, - "reranking_mode": { - "type": "string", - "nullable": true, - "description": "重排序模式。`reranking_model` 表示基于模型的重排序,`weighted_score` 表示基于分数的加权。重排序禁用时为 `null`。" - }, - "reranking_model": { - "type": "object", - "description": "重排序模型配置。", - "properties": { - "reranking_provider_name": { - "type": "string", - "description": "重排序模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/cohere/cohere`)。旧版知识库可能返回简写形式(例如 `cohere`)。" - }, - "reranking_model_name": { - "type": "string", - "description": "重排序模型名称。" - } - } - }, - "weights": { - "type": "object", - "nullable": true, - "description": "混合搜索的权重配置。", - "properties": { - "weight_type": { - "type": "string", - "description": "平衡语义搜索和关键词搜索权重的策略。" - }, - "vector_setting": { - "type": "object", - "description": "语义搜索权重设置。", - "properties": { - "vector_weight": { - "type": "number", - "description": "分配给语义(向量)搜索结果的权重。" - }, - "embedding_provider_name": { - "type": "string", - "description": "用于向量搜索的嵌入模型供应商。" - }, - "embedding_model_name": { - "type": "string", - "description": "用于向量搜索的嵌入模型名称。" - } - } - }, - "keyword_setting": { - "type": "object", - "description": "关键词搜索权重设置。", - "properties": { - "keyword_weight": { - "type": "number", - "description": "分配给关键词搜索结果的权重。" - } - } - } - } - }, - "top_k": { - "type": "integer", - "description": "返回的最大结果数。" - }, - "score_threshold_enabled": { - "type": "boolean", - "description": "是否启用分数阈值过滤。" + "anyOf": [ + { + "format": "int64", + "type": "integer" }, - "score_threshold": { - "type": "number", - "description": "结果的最低相关性分数。仅在 `score_threshold_enabled` 为 `true` 时生效。" + { + "type": "null" } - } + ], + "default": null }, - "summary_index_setting": { - "type": "object", - "nullable": true, - "description": "摘要索引配置。", - "properties": { - "enable": { - "type": "boolean", - "description": "是否已启用摘要索引。" - }, - "model_name": { - "type": "string", - "description": "用于生成摘要的模型名称。" + "created_by_account": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleAccountResponse" }, - "model_provider_name": { - "type": "string", - "description": "摘要生成模型的供应商。" + { + "type": "null" + } + ], + "default": null + }, + "created_by_end_user": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleEndUser" }, - "summary_prompt": { - "type": "string", - "description": "用于摘要生成的提示词模板。" + { + "type": "null" } - } + ], + "default": null }, - "tags": { - "type": "array", - "description": "与该知识库关联的标签。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "标签标识符。" - }, - "name": { - "type": "string", - "description": "Tag name." - }, - "type": { - "type": "string", - "description": "标签类型。知识库标签始终为 `knowledge`。" - } + "created_by_role": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "doc_form": { - "type": "string", - "description": "文档分块模式。`text_model` 表示标准文本分块,`hierarchical_model` 表示父子结构,`qa_model` 表示问答对提取。" + "created_from": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "external_knowledge_info": { - "type": "object", - "nullable": true, - "description": "外部知识库的连接详情。当 `provider` 为 `external` 时存在。", - "properties": { - "external_knowledge_id": { - "type": "string", - "description": "外部知识库的 ID。" + "details": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" }, - "external_knowledge_api_id": { - "type": "string", - "description": "外部知识库 API 连接的 ID。" + { + "items": {}, + "type": "array" }, - "external_knowledge_api_name": { - "type": "string", - "description": "外部知识库 API 的显示名称。" + { + "type": "string" }, - "external_knowledge_api_endpoint": { - "type": "string", - "description": "外部知识库 API 的端点 URL。" - } - } - }, - "external_retrieval_model": { - "type": "object", - "nullable": true, - "description": "外部知识库的检索设置。内部知识库时为 `null`。", - "properties": { - "top_k": { - "type": "integer", - "description": "从外部知识库返回的最大结果数量。" + { + "type": "integer" + }, + { + "type": "number" }, - "score_threshold": { - "type": "number", - "description": "最低相关性得分阈值。" + { + "type": "boolean" }, - "score_threshold_enabled": { - "type": "boolean", - "description": "是否启用分数阈值过滤。" + { + "type": "null" } - } + ], + "default": null }, - "doc_metadata": { - "type": "array", - "description": "知识库的元数据字段定义。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "元数据字段标识符。" - }, - "name": { - "type": "string", - "description": "元数据字段名称。" - }, - "type": { - "type": "string", - "description": "元数据字段值类型。" - } - } - } + "id": { + "format": "uuid", + "type": "string" }, - "built_in_field_enabled": { - "type": "boolean", - "description": "是否启用内置元数据字段(例如 `document_name`、`uploader`)。" + "workflow_run": { + "anyOf": [ + { + "$ref": "#/components/schemas/WorkflowRunForLogResponse" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "WorkflowEventsQuery": { + "properties": { + "continue_on_pause": { + "default": false, + "type": "boolean" }, - "pipeline_id": { - "type": "string", - "nullable": true, - "description": "自定义处理流水线的 ID(如果已配置)。" + "include_state_snapshot": { + "default": false, + "description": "为 `true` 时,从持久化状态快照重放,在流式发送新事件前附带已执行节点的状态摘要。", + "type": "boolean" }, - "runtime_mode": { - "type": "string", - "nullable": true, - "description": "运行时处理模式。" + "user": { + "type": "string" + } + }, + "required": [ + "user" + ], + "type": "object" + }, + "WorkflowFinishedBlockingDataResponse": { + "additionalProperties": true, + "properties": { + "created_at": { + "format": "int64", + "type": "integer" }, - "chunk_structure": { - "type": "string", - "nullable": true, - "description": "分段结构配置。" + "elapsed_time": { + "format": "float", + "type": "number" }, - "icon_info": { - "type": "object", - "nullable": true, - "description": "知识库的图标显示配置。", - "properties": { - "icon_type": { - "type": "string", - "description": "图标类型。" - }, - "icon": { - "type": "string", - "description": "图标标识符或表情符号。" - }, - "icon_background": { - "type": "string", - "description": "图标的背景颜色。" + "error": { + "anyOf": [ + { + "type": "string" }, - "icon_url": { - "type": "string", - "description": "自定义图标图片的 URL。" + { + "type": "null" } - } + ] }, - "is_published": { - "type": "boolean", - "description": "知识库是否已发布。" + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ] }, - "total_documents": { - "type": "integer", - "description": "文档总数。" + "id": { + "format": "uuid", + "type": "string" }, - "total_available_documents": { - "type": "integer", - "description": "已启用且可用的文档数量。" + "outputs": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] }, - "enable_api": { - "type": "boolean", - "description": "该知识库是否启用 API 访问。" + "status": { + "enum": [ + "failed", + "partial-succeeded", + "stopped", + "succeeded" + ], + "type": "string" }, - "is_multimodal": { - "type": "boolean", - "description": "是否启用多模态内容处理。" + "total_steps": { + "type": "integer" }, - "maintainer": { - "type": "string", - "nullable": true, - "description": "知识库维护者的显示名称。未设置时为 `null`。" + "total_tokens": { + "type": "integer" }, - "partial_member_list": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - }, - "description": "当 `permission` 为 `partial_members` 时被授予访问权限的成员账户 ID。更新响应中始终返回;详情响应中仅当 `permission` 为 `partial_members` 时返回。" + "workflow_id": { + "format": "uuid", + "type": "string" } - } + }, + "required": [ + "created_at", + "elapsed_time", + "error", + "finished_at", + "id", + "outputs", + "status", + "total_steps", + "total_tokens", + "workflow_id" + ], + "type": "object" }, - "Document": { - "type": "object", + "WorkflowFinishedBlockingResponse": { + "additionalProperties": true, "properties": { - "id": { - "type": "string", - "description": "文档的唯一标识符。" - }, - "position": { - "type": "integer", - "description": "文档在列表中的显示位置。" - }, - "data_source_type": { - "type": "string", - "description": "文档的创建方式。文件上传为 `upload_file`,Notion 导入为 `notion_import`。" + "data": { + "$ref": "#/components/schemas/WorkflowFinishedBlockingDataResponse" }, - "data_source_info": { - "type": "object", - "description": "原始数据源信息,随 `data_source_type` 而异。" + "task_id": { + "format": "uuid", + "type": "string" }, - "data_source_detail_dict": { - "type": "object", - "description": "详细的数据源信息,包括文件详情。" + "workflow_run_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "data", + "task_id", + "workflow_run_id" + ], + "type": "object" + }, + "WorkflowLogQuery": { + "properties": { + "created_at__after": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "筛选在此 ISO 8601 时间戳之后创建的日志。", + "format": "date-time" }, - "dataset_process_rule_id": { - "type": "string", - "description": "应用于该文档的处理规则 ID。" + "created_at__before": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "筛选在此 ISO 8601 时间戳之前创建的日志。", + "format": "date-time" }, - "name": { - "type": "string", - "description": "文档名称。" + "created_by_account": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "created_from": { - "type": "string", - "description": "文档来源。通过 API 创建时为 `api`,通过 UI 创建时为 `web`。" + "created_by_end_user_session_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "按终端用户会话 ID 筛选。" }, - "created_by": { - "type": "string", - "description": "创建该文档的用户 ID。" + "keyword": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "在日志中搜索的关键词。" }, - "created_at": { - "type": "number", - "description": "创建时间戳(Unix 纪元,单位为秒)。" + "limit": { + "default": 20, + "description": "每页条目数。", + "maximum": 100, + "minimum": 1, + "type": "integer" }, - "tokens": { - "type": "integer", - "description": "文档中的令牌总数。" + "page": { + "default": 1, + "maximum": 99999, + "minimum": 1, + "type": "integer" }, - "indexing_status": { - "type": "string", - "description": "当前索引状态。`waiting` 表示排队中,`parsing` 表示正在提取内容,`cleaning` 表示正在去噪,`splitting` 表示正在分块,`indexing` 表示正在构建向量,`completed` 表示就绪,`error` 表示失败,`paused` 表示手动暂停。" + "status": { + "anyOf": [ + { + "enum": [ + "failed", + "stopped", + "succeeded" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "按执行状态筛选。" + } + }, + "type": "object" + }, + "WorkflowPauseReasonResponse": { + "additionalProperties": true, + "properties": { + "TYPE": { + "type": "string" }, - "error": { - "type": "string", - "nullable": true, - "description": "索引失败时的错误消息。无错误时为 `null`。" + "actions": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "type": "array" }, - "enabled": { - "type": "boolean", - "description": "该文档是否启用检索。" + "approval_channels": { + "items": { + "type": "string" + }, + "type": "array" }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "文档被禁用的时间戳。启用时为 `null`。" + "display_in_ui": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "禁用该文档的用户 ID。启用时为 `null`。" + "expiration_time": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "archived": { - "type": "boolean", - "description": "文档是否已归档。" + "form_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "display_status": { - "type": "string", - "description": "基于 `indexing_status` 和 `enabled` 状态派生的面向用户的显示状态。" + "form_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "word_count": { - "type": "integer", - "description": "文档的总字数。" + "form_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "hit_count": { - "type": "integer", - "description": "该文档在检索查询中被匹配的次数。" + "inputs": { + "items": { + "$ref": "#/components/schemas/JSONObject" + }, + "type": "array" }, - "doc_form": { - "type": "string", - "description": "文档分块模式。`text_model` 表示标准文本分块,`hierarchical_model` 表示父子结构,`qa_model` 表示问答对提取。" + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "doc_metadata": { - "type": "array", - "description": "分配给该文档的元数据值。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "元数据字段标识符。" - }, - "name": { - "type": "string", - "description": "元数据字段名称。" - }, - "type": { - "type": "string", - "description": "元数据字段值类型。" - }, - "value": { - "type": "string", - "description": "此文档的元数据值。" - } + "node_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "summary_index_status": { - "type": "string", - "nullable": true, - "description": "该文档的摘要索引状态。未配置摘要索引时为 `null`。" + "node_title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "need_summary": { - "type": "boolean", - "description": "是否需要为该文档生成摘要。" + "resolved_default_values": { + "additionalProperties": true, + "type": "object" } - } + }, + "required": [ + "TYPE" + ], + "type": "object" }, - "Segment": { - "type": "object", + "WorkflowPausedBlockingDataResponse": { + "additionalProperties": true, "properties": { - "id": { - "type": "string", - "description": "分段的唯一标识符。" - }, - "position": { - "type": "integer", - "description": "分段在文档中的位置。" - }, - "document_id": { - "type": "string", - "description": "该分段所属文档的 ID。" + "created_at": { + "format": "int64", + "type": "integer" }, - "content": { - "type": "string", - "description": "分段的文本内容。" + "elapsed_time": { + "format": "float", + "type": "number" }, - "sign_content": { - "type": "string", - "description": "用于完整性验证的签名内容哈希。" + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "answer": { - "type": "string", - "description": "回答内容,用于问答模式文档。" + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ] }, - "word_count": { - "type": "integer", - "description": "分段内容的字数。" + "id": { + "format": "uuid", + "type": "string" }, - "tokens": { - "type": "integer", - "description": "分段内容的令牌数。" + "outputs": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ] }, - "keywords": { - "type": "array", - "description": "与该分段关联的关键词,用于基于关键词的检索。", + "paused_nodes": { "items": { "type": "string" - } + }, + "type": "array" }, - "index_node_id": { - "type": "string", - "description": "向量存储中索引节点的 ID。" + "reasons": { + "items": { + "$ref": "#/components/schemas/WorkflowPauseReasonResponse" + }, + "type": "array" }, - "index_node_hash": { - "type": "string", - "description": "索引内容的哈希值,用于检测变更。" + "status": { + "const": "paused", + "type": "string" }, - "hit_count": { - "type": "integer", - "description": "该分段在检索查询中被匹配的次数。" + "total_steps": { + "type": "integer" }, - "enabled": { - "type": "boolean", - "description": "该分段是否启用检索。" + "total_tokens": { + "type": "integer" }, - "disabled_at": { - "type": "number", - "nullable": true, - "description": "分段被禁用的时间戳。启用时为 `null`。" + "workflow_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "created_at", + "elapsed_time", + "error", + "finished_at", + "id", + "outputs", + "paused_nodes", + "reasons", + "status", + "total_steps", + "total_tokens", + "workflow_id" + ], + "type": "object" + }, + "WorkflowPausedBlockingResponse": { + "additionalProperties": true, + "properties": { + "data": { + "$ref": "#/components/schemas/WorkflowPausedBlockingDataResponse" }, - "disabled_by": { - "type": "string", - "nullable": true, - "description": "禁用该分段的用户 ID。启用时为 `null`。" + "task_id": { + "format": "uuid", + "type": "string" }, - "status": { - "type": "string", - "description": "分段的当前索引状态,例如 `completed`、`indexing`、`error`。" + "workflow_run_id": { + "format": "uuid", + "type": "string" + } + }, + "required": [ + "data", + "task_id", + "workflow_run_id" + ], + "type": "object" + }, + "WorkflowRunForLogResponse": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "created_by": { - "type": "string", - "description": "创建该分段的用户 ID。" + "elapsed_time": { + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "created_at": { - "type": "number", - "description": "创建时间戳(Unix 纪元,单位为秒)。" + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "updated_at": { - "type": "number", - "description": "最后更新时间戳(Unix 纪元,单位为秒)。" + "exceptions_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "updated_by": { - "type": "string", - "description": "最后更新该分段的用户 ID。" + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "indexing_at": { - "type": "number", - "nullable": true, - "description": "索引开始的时间戳。尚未开始时为 `null`。" + "id": { + "format": "uuid", + "type": "string" }, - "completed_at": { - "type": "number", - "nullable": true, - "description": "索引完成的时间戳。尚未完成时为 `null`。" + "status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "error": { - "type": "string", - "nullable": true, - "description": "索引失败时的错误消息。无错误时为 `null`。" + "total_steps": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "stopped_at": { - "type": "number", - "nullable": true, - "description": "索引停止的时间戳。未停止时为 `null`。" + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "child_chunks": { - "type": "array", - "description": "属于该分段的子分段。仅在分层模式文档中存在。", - "items": { - "$ref": "#/components/schemas/ChildChunk" - } + "triggered_from": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "attachments": { - "type": "array", - "description": "附加到该分段的文件。", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "附件文件标识符。" - }, - "name": { - "type": "string", - "description": "原始文件名。" - }, - "size": { - "type": "integer", - "description": "文件大小(字节)。" - }, - "extension": { - "type": "string", - "description": "文件扩展名。" - }, - "mime_type": { - "type": "string", - "description": "文件的 MIME 类型。" + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "WorkflowRunPayload": { + "properties": { + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" }, - "source_url": { - "type": "string", - "description": "访问附件的 URL。" - } + "type": "array" + }, + { + "type": "null" } - } + ], + "default": null }, - "summary": { - "type": "string", - "nullable": true, - "description": "AI 生成的分段内容摘要。未启用摘要索引时为 `null`。" + "inputs": { + "additionalProperties": true, + "type": "object" + }, + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } - } + }, + "required": [ + "inputs" + ], + "type": "object" }, - "ChildChunk": { - "type": "object", + "WorkflowRunPayloadWithUser": { "properties": { - "id": { - "type": "string", - "description": "子分段的唯一标识符。" - }, - "segment_id": { - "type": "string", - "description": "该子分段所属的父分段 ID。" - }, - "content": { - "type": "string", - "description": "子分段的文本内容。" - }, - "position": { - "type": "integer", - "description": "子分段在父分段中的位置。" - }, - "word_count": { - "type": "integer", - "description": "子分段内容的字数。" + "files": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "url" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "remote_url", + "transfer_method", + "type" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "remote_url" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + }, + { + "properties": { + "remote_url": { + "format": "url", + "type": "string" + }, + "transfer_method": { + "enum": [ + "local_file" + ], + "type": "string" + }, + "type": { + "description": "文件类型。", + "enum": [ + "audio", + "custom", + "document", + "image", + "video" + ], + "type": "string" + }, + "upload_file_id": { + "type": "string" + }, + "url": { + "format": "url", + "type": "string" + } + }, + "required": [ + "transfer_method", + "type", + "upload_file_id" + ], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null }, - "type": { - "type": "string", - "description": "子分段的创建方式。通过 API 创建或更新的子分段始终为 `customized`。系统生成的子分段为 `automatic`。" + "inputs": { + "additionalProperties": true, + "type": "object" }, - "created_at": { - "type": "number", - "description": "创建时间戳(Unix 纪元,单位为秒)。" + "response_mode": { + "anyOf": [ + { + "enum": [ + "blocking", + "streaming" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "updated_at": { - "type": "number", - "description": "最后更新时间戳(Unix 纪元,单位为秒)。" + "user": { + "type": "string" } - } - }, - "RetrievalModel": { - "type": "object", + }, "required": [ - "search_method", - "reranking_enable", - "top_k", - "score_threshold_enabled" + "inputs", + "user" ], + "type": "object" + }, + "WorkflowRunResponse": { "properties": { - "search_method": { - "type": "string", - "description": "用于检索的搜索方法。", - "enum": [ - "keyword_search", - "semantic_search", - "full_text_search", - "hybrid_search" - ] + "created_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "reranking_enable": { - "type": "boolean", - "description": "是否启用重排序。" + "elapsed_time": { + "anyOf": [ + { + "format": "float", + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null }, - "reranking_model": { - "type": "object", - "description": "重排序模型配置。", - "properties": { - "reranking_provider_name": { - "type": "string", - "description": "重排序模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/cohere/cohere`)。`cohere` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=rerank` 返回的 `provider` 字段获取。" + "error": { + "anyOf": [ + { + "type": "string" }, - "reranking_model_name": { - "type": "string", - "description": "重排序模型名称。" + { + "type": "null" } - } + ], + "default": null }, - "reranking_mode": { - "type": "string", - "enum": [ - "reranking_model", - "weighted_score" + "finished_at": { + "anyOf": [ + { + "format": "int64", + "type": "integer" + }, + { + "type": "null" + } ], - "nullable": true, - "description": "重排序模式。当 `reranking_enable` 为 `true` 时必填。" + "default": null }, - "top_k": { - "type": "integer", - "description": "返回的最大结果数。" + "id": { + "format": "uuid", + "type": "string" }, - "score_threshold_enabled": { - "type": "boolean", - "description": "是否启用分数阈值过滤。" + "inputs": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "items": {}, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null }, - "score_threshold": { - "type": "number", - "nullable": true, - "description": "结果的最低相关性分数。仅在 `score_threshold_enabled` 为 `true` 时生效。" + "outputs": { + "additionalProperties": true, + "type": "object" }, - "weights": { - "type": "object", - "nullable": true, - "description": "混合搜索的权重配置。", - "properties": { - "weight_type": { - "type": "string", - "description": "平衡语义搜索和关键词搜索权重的策略。", - "enum": [ - "semantic_first", - "keyword_first", - "customized" - ] - }, - "vector_setting": { - "type": "object", - "description": "语义搜索权重设置。", - "properties": { - "vector_weight": { - "type": "number", - "description": "分配给语义(向量)搜索结果的权重。" - }, - "embedding_provider_name": { - "type": "string", - "description": "用于向量搜索的嵌入模型供应商。" - }, - "embedding_model_name": { - "type": "string", - "description": "用于向量搜索的嵌入模型名称。" - } - } + "status": { + "type": "string" + }, + "total_steps": { + "anyOf": [ + { + "type": "integer" }, - "keyword_setting": { - "type": "object", - "description": "关键词搜索权重设置。", - "properties": { - "keyword_weight": { - "type": "number", - "description": "分配给关键词搜索结果的权重。" - } - } + { + "type": "null" } - } + ], + "default": null }, - "metadata_filtering_conditions": { - "type": "object", - "nullable": true, - "description": "仅检索文档元数据匹配指定条件的分段。条件由服务端基于文档元数据字段评估。", - "properties": { - "logical_operator": { - "type": "string", - "enum": [ - "and", - "or" - ], - "default": "and", - "nullable": true, - "description": "多个条件之间的组合方式。" - }, - "conditions": { - "type": "array", - "nullable": true, - "description": "要评估的元数据条件列表。", - "items": { - "type": "object", - "required": [ - "name", - "comparison_operator" - ], - "properties": { - "name": { - "type": "string", - "description": "用于比较的元数据字段名称。" - }, - "comparison_operator": { - "type": "string", - "description": "按元数据类型选择要应用的比较方式:\n\n- 字符串或数组类型元数据:`contains`、`not contains`、`start with`、`end with`、`is`、`is not`、`empty`、`not empty`、`in`、`not in`\n- 数值类型元数据:`=`、`≠`、`>`、`<`、`≥`、`≤`\n- 时间类型元数据:`before`、`after`", - "enum": [ - "contains", - "not contains", - "start with", - "end with", - "is", - "is not", - "empty", - "not empty", - "in", - "not in", - "=", - "≠", - ">", - "<", - "≥", - "≤", - "before", - "after" - ] - }, - "value": { - "nullable": true, - "description": "用于比较的值。类型取决于 `comparison_operator`:大多数字符串运算符使用字符串;`in` 和 `not in` 使用字符串数组;数值运算符使用数字;`empty` 和 `not empty` 时省略。", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "number" - } - ] - } - } - } + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" } - } + ], + "default": null + }, + "workflow_id": { + "format": "uuid", + "type": "string" } - } + }, + "required": [ + "id", + "status", + "workflow_id" + ], + "type": "object" } } } From e9b36e605bb5088f719e15eeca4081f5ebbcd3b2 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 26 Aug 2026 08:49:40 +0800 Subject: [PATCH 02/10] fix: hide service api root endpoint from navigation Keep the generated root operation in the wire contract without publishing Mintlify metadata, and preserve redirect ordering during navigation regeneration. --- docs.json | 38 ++++++-------- en/api-reference/openapi_service.json | 24 ++------- ja/api-reference/openapi_service.json | 23 +-------- tools/api-pipeline/README.md | 2 +- tools/api-pipeline/align_service_api.py | 52 +------------------- tools/api-pipeline/merge_specs.py | 24 +++++++-- tools/api-pipeline/test_align_service_api.py | 15 +++--- zh/api-reference/openapi_service.json | 23 +-------- 8 files changed, 55 insertions(+), 146 deletions(-) diff --git a/docs.json b/docs.json index a3eafc1fad..eefb5b1a67 100644 --- a/docs.json +++ b/docs.json @@ -379,7 +379,6 @@ "group": "Applications", "openapi": "en/api-reference/openapi_service.json", "pages": [ - "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -1101,7 +1100,6 @@ "group": "Applications", "openapi": "en/api-reference/openapi_service.json", "pages": [ - "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -1772,7 +1770,6 @@ "group": "应用配置", "openapi": "zh/api-reference/openapi_service.json", "pages": [ - "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -2494,7 +2491,6 @@ "group": "应用配置", "openapi": "zh/api-reference/openapi_service.json", "pages": [ - "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -3165,7 +3161,6 @@ "group": "アプリケーション設定", "openapi": "ja/api-reference/openapi_service.json", "pages": [ - "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -3887,7 +3882,6 @@ "group": "アプリケーション設定", "openapi": "ja/api-reference/openapi_service.json", "pages": [ - "GET /", "GET /info", "GET /parameters", "GET /meta", @@ -5357,6 +5351,22 @@ "source": "/use-dify/publish/developing-with-apis", "destination": "/en/api-reference/guides/get-started" }, + { + "source": "/api-reference/knowledge-bases/list-knowledge-bases", + "destination": "/en/api-reference/guides/knowledge" + }, + { + "source": "/api-reference/知识库/获取知识库列表", + "destination": "/zh/api-reference/guides/knowledge" + }, + { + "source": "/api-reference/データセット/ナレッジベースリストを取得", + "destination": "/ja/api-reference/guides/knowledge" + }, + { + "source": "/api-reference/:slug*", + "destination": "/en/api-reference/guides/get-started" + }, { "source": "/home", "destination": "/en/home" @@ -5380,22 +5390,6 @@ { "source": "/develop-plugin/:slug*", "destination": "/en/develop-plugin/:slug*" - }, - { - "source": "/api-reference/knowledge-bases/list-knowledge-bases", - "destination": "/en/api-reference/guides/knowledge" - }, - { - "source": "/api-reference/知识库/获取知识库列表", - "destination": "/zh/api-reference/guides/knowledge" - }, - { - "source": "/api-reference/データセット/ナレッジベースリストを取得", - "destination": "/ja/api-reference/guides/knowledge" - }, - { - "source": "/api-reference/:slug*", - "destination": "/en/api-reference/guides/get-started" } ], "integrations": { diff --git a/en/api-reference/openapi_service.json b/en/api-reference/openapi_service.json index 419ff5bedd..7c067d99dc 100644 --- a/en/api-reference/openapi_service.json +++ b/en/api-reference/openapi_service.json @@ -106,16 +106,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/IndexInfoResponse" - }, - "examples": { - "response": { - "summary": "Response Example", - "value": { - "welcome": "Dify OpenAPI", - "api_version": "v1", - "server_version": "1.17.0" - } - } } } }, @@ -123,18 +113,10 @@ } }, "security": [], - "summary": "Get API Information", + "summary": "Return public Service API metadata without requiring an API key", "tags": [ - "Applications" - ], - "description": "Returns the public Service API version and server version without requiring an API key.", - "x-mint": { - "href": "/en/api-reference/applications/get-api-information", - "metadata": { - "title": "Get API Information", - "sidebarTitle": "Get API Information" - } - } + "service_api" + ] } }, "/chat-messages": { diff --git a/ja/api-reference/openapi_service.json b/ja/api-reference/openapi_service.json index d51a4e2d46..c883ffceea 100644 --- a/ja/api-reference/openapi_service.json +++ b/ja/api-reference/openapi_service.json @@ -106,16 +106,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/IndexInfoResponse" - }, - "examples": { - "response": { - "summary": "レスポンス例", - "value": { - "welcome": "Dify OpenAPI", - "api_version": "v1", - "server_version": "1.17.0" - } - } } } }, @@ -123,18 +113,9 @@ } }, "security": [], - "summary": "API 情報の取得", "tags": [ - "アプリケーション設定" - ], - "description": "API キーを使用せずに、サービス API とサーバーのバージョンを取得します。", - "x-mint": { - "href": "/ja/api-reference/applications/get-api-information", - "metadata": { - "title": "API 情報の取得", - "sidebarTitle": "API 情報の取得" - } - } + "service_api" + ] } }, "/chat-messages": { diff --git a/tools/api-pipeline/README.md b/tools/api-pipeline/README.md index 6b5ea96857..cdffadec6a 100644 --- a/tools/api-pipeline/README.md +++ b/tools/api-pipeline/README.md @@ -41,7 +41,7 @@ The aligner takes paths, methods, parameters, schemas, status codes, authenticat ## Editing the spec - Edit all three languages; `parity_check` enforces structural parity with en. -- Every operation carries `x-mint.href = /{lang}/api-reference/{en-tag-kebab}/{en-summary-kebab}` (English slugs in every language, so the language switcher can map pages) and `x-mint.metadata.title`/`sidebarTitle` = the translated summary (without them, the custom href makes Mintlify label the sidebar from the English slug). Set all of these when adding an operation. +- Every published operation carries `x-mint.href = /{lang}/api-reference/{en-tag-kebab}/{en-summary-kebab}` (English slugs in every language, so the language switcher can map pages) and `x-mint.metadata.title`/`sidebarTitle` = the translated summary (without them, the custom href makes Mintlify label the sidebar from the English slug). Generated operations without `x-mint` remain in the wire contract but are excluded from the documentation navigation. - The `tags` arrays must stay index-aligned across languages; `wire` maps translated tag labels by position and fails on a mismatch. - Shared endpoints exist once, with availability lines and mode notes in the description; there is no cross-spec propagation anymore. - After adding, removing, retitling, or reordering operations: update `memberships.json` (and the app-type overview pages) if availability changed, then run `wire`, `check-coverage`, and the lints. Description-only edits need no `wire`. diff --git a/tools/api-pipeline/align_service_api.py b/tools/api-pipeline/align_service_api.py index ecf0cc48be..0c9d34c03a 100644 --- a/tools/api-pipeline/align_service_api.py +++ b/tools/api-pipeline/align_service_api.py @@ -36,27 +36,6 @@ "x-mint", } -ROOT_PRESENTATION = { - "en": { - "summary": "Get API Information", - "description": "Returns the public Service API version and server version without requiring an API key.", - "tag": "Applications", - "example_summary": "Response Example", - }, - "zh": { - "summary": "获取 API 信息", - "description": "无需 API 密钥即可获取服务 API 版本和服务器版本。", - "tag": "应用配置", - "example_summary": "响应示例", - }, - "ja": { - "summary": "API 情報の取得", - "description": "API キーを使用せずに、サービス API とサーバーのバージョンを取得します。", - "tag": "アプリケーション設定", - "example_summary": "レスポンス例", - }, -} - DEPRECATED_ALIAS_PRESENTATION = { "en": { "summary": "Deprecated Compatibility Endpoint", @@ -401,32 +380,6 @@ def localize_unmatched_tags( operation["tags"] = [tag_map.get(tag, tag) for tag in tags] -def apply_root_presentation(spec: dict[str, Any], language: str) -> None: - operation = spec["paths"]["/"]["get"] - presentation = ROOT_PRESENTATION[language] - operation["summary"] = presentation["summary"] - operation["description"] = presentation["description"] - operation["tags"] = [presentation["tag"]] - operation["x-mint"] = { - "href": f"/{language}/api-reference/applications/get-api-information", - "metadata": { - "title": presentation["summary"], - "sidebarTitle": presentation["summary"], - }, - } - media = operation["responses"]["200"]["content"]["application/json"] - media["examples"] = { - "response": { - "summary": presentation["example_summary"], - "value": { - "welcome": "Dify OpenAPI", - "api_version": "v1", - "server_version": "1.17.0", - }, - } - } - - def apply_deprecated_alias_presentation(spec: dict[str, Any], language: str) -> None: presentation = DEPRECATED_ALIAS_PRESENTATION[language] for path, _, operation in iter_operations(spec): @@ -454,8 +407,8 @@ def align_language( aligned = merge_presentation(generated, current) # JSON object order is not part of the wire contract, but it controls the - # generated sidebar order. Keep the reviewed docs order, prepend the new - # public API-information endpoint, and append other generated-only paths. + # generated sidebar order. Keep the reviewed docs order, retain the + # generated root path first, and append other generated-only paths. generated_paths = aligned.get("paths", {}) current_paths = current.get("paths", {}) if isinstance(generated_paths, dict) and isinstance(current_paths, dict): @@ -500,7 +453,6 @@ def align_language( if isinstance(scheme, dict): scheme["description"] = current_descriptions[0] - apply_root_presentation(aligned, language) apply_deprecated_alias_presentation(aligned, language) return aligned diff --git a/tools/api-pipeline/merge_specs.py b/tools/api-pipeline/merge_specs.py index 8ebe0df3bb..b9b770fdf4 100644 --- a/tools/api-pipeline/merge_specs.py +++ b/tools/api-pipeline/merge_specs.py @@ -40,7 +40,11 @@ def iter_ops(spec: dict): """Yield (path, method, op) for every operation in a spec.""" for path, item in spec.get("paths", {}).items(): for method, op in item.items(): - if method in HTTP_METHODS and op.get("deprecated") is not True: + if ( + method in HTTP_METHODS + and op.get("deprecated") is not True + and "x-mint" in op + ): yield path, method, op @@ -149,8 +153,22 @@ def wire(langs): # Catch-all last so the KB exceptions win (Mintlify matches sources in order). api_catchall = {"source": "/api-reference/:slug*", "destination": "/en/api-reference/guides/get-started"} - kept = [r for r in existing if "/api-reference/" not in r["source"]] - docs["redirects"] = kept + api_kb + [api_catchall] + api_indexes = [ + index + for index, redirect in enumerate(existing) + if "/api-reference/" in redirect["source"] + ] + kept = [redirect for redirect in existing if "/api-reference/" not in redirect["source"]] + if api_indexes: + insert_at = sum( + "/api-reference/" not in redirect["source"] + for redirect in existing[:api_indexes[0]] + ) + else: + insert_at = len(kept) + docs["redirects"] = ( + kept[:insert_at] + api_kb + [api_catchall] + kept[insert_at:] + ) print(f"redirects: {len(kept)} non-API + {len(api_kb)} KB + 1 catch-all") with open(docs_path, "w", encoding="utf-8") as f: diff --git a/tools/api-pipeline/test_align_service_api.py b/tools/api-pipeline/test_align_service_api.py index 9a5572fcae..a9beb920aa 100644 --- a/tools/api-pipeline/test_align_service_api.py +++ b/tools/api-pipeline/test_align_service_api.py @@ -98,15 +98,16 @@ def test_existing_key_order_is_stable_and_new_keys_are_appended(self) -> None: aligned = merge_presentation(generated, current) self.assertEqual(list(aligned), ["description", "type", "new"]) - def test_root_operation_receives_docs_metadata(self) -> None: + def test_root_operation_keeps_generated_contract_without_docs_metadata(self) -> None: aligned = align_language(copy.deepcopy(self.generated), self.current, "en") operation = aligned["paths"]["/"]["get"] - self.assertEqual(operation["summary"], "Get API Information") - self.assertEqual(operation["tags"], ["Applications"]) - self.assertEqual(operation["x-mint"]["href"], "/en/api-reference/applications/get-api-information") - example = operation["responses"]["200"]["content"]["application/json"]["examples"]["response"]["value"] - self.assertEqual(example["api_version"], "v1") - self.assertEqual(example["server_version"], "1.17.0") + self.assertEqual(operation["summary"], "Generated root") + self.assertEqual(operation["tags"], ["service_api"]) + self.assertNotIn("x-mint", operation) + self.assertNotIn( + "examples", + operation["responses"]["200"]["content"]["application/json"], + ) def test_new_untranslated_prose_is_removed_but_response_description_is_localized(self) -> None: english = { diff --git a/zh/api-reference/openapi_service.json b/zh/api-reference/openapi_service.json index 2b7e184ebe..e0f3781086 100644 --- a/zh/api-reference/openapi_service.json +++ b/zh/api-reference/openapi_service.json @@ -106,16 +106,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/IndexInfoResponse" - }, - "examples": { - "response": { - "summary": "响应示例", - "value": { - "welcome": "Dify OpenAPI", - "api_version": "v1", - "server_version": "1.17.0" - } - } } } }, @@ -123,18 +113,9 @@ } }, "security": [], - "summary": "获取 API 信息", "tags": [ - "应用配置" - ], - "description": "无需 API 密钥即可获取服务 API 版本和服务器版本。", - "x-mint": { - "href": "/zh/api-reference/applications/get-api-information", - "metadata": { - "title": "获取 API 信息", - "sidebarTitle": "获取 API 信息" - } - } + "service_api" + ] } }, "/chat-messages": { From f5f012c7fd345ff66e5fe3896ab89a206ea57f47 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 26 Aug 2026 08:56:03 +0800 Subject: [PATCH 03/10] fix: preserve existing service api navigation Keep documented deprecated operations in navigation and use x-mint as the publication boundary, avoiding an unrelated docs.json diff. --- docs.json | 6 ++++++ tools/api-pipeline/merge_specs.py | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs.json b/docs.json index eefb5b1a67..f45acf01c6 100644 --- a/docs.json +++ b/docs.json @@ -450,6 +450,7 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", + "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -1171,6 +1172,7 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", + "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -1841,6 +1843,7 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", + "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -2562,6 +2565,7 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", + "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -3232,6 +3236,7 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", + "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] @@ -3953,6 +3958,7 @@ "GET /datasets/{dataset_id}/documents/{document_id}/download", "GET /datasets/{dataset_id}/documents/{batch}/indexing-status", "POST /datasets/{dataset_id}/documents/{document_id}/update-by-text", + "POST /datasets/{dataset_id}/documents/{document_id}/update-by-file", "POST /datasets/{dataset_id}/documents/download-zip", "PATCH /datasets/{dataset_id}/documents/status/{action}" ] diff --git a/tools/api-pipeline/merge_specs.py b/tools/api-pipeline/merge_specs.py index b9b770fdf4..7776e63891 100644 --- a/tools/api-pipeline/merge_specs.py +++ b/tools/api-pipeline/merge_specs.py @@ -42,7 +42,6 @@ def iter_ops(spec: dict): for method, op in item.items(): if ( method in HTTP_METHODS - and op.get("deprecated") is not True and "x-mint" in op ): yield path, method, op From c7639b7693705798d6c9c70cb9caf5a8d22132f6 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 26 Aug 2026 09:29:33 +0800 Subject: [PATCH 04/10] fix: preserve service api presentation --- en/api-reference/openapi_service.json | 2004 +++++++++++------ ja/api-reference/openapi_service.json | 2032 ++++++++++++------ tools/api-pipeline/README.md | 4 + tools/api-pipeline/align_service_api.py | 262 ++- tools/api-pipeline/test_align_service_api.py | 120 ++ zh/api-reference/openapi_service.json | 2032 ++++++++++++------ 6 files changed, 4465 insertions(+), 1989 deletions(-) diff --git a/en/api-reference/openapi_service.json b/en/api-reference/openapi_service.json index 7c067d99dc..919335ee84 100644 --- a/en/api-reference/openapi_service.json +++ b/en/api-reference/openapi_service.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Dify Service API", - "description": "REST API for Dify applications and knowledge bases. Application endpoints authenticate with an app API key; knowledge endpoints authenticate with a dataset API key.", + "description": "REST API for Dify applications and knowledge bases. Create an app API key inside a published app, or create a knowledge API key from **Knowledge > Service API**. Call the API from your backend and send the key in every request as `Authorization: Bearer {API_KEY}`.\n\nDify Cloud uses `https://api.dify.ai/v1`; for a self-hosted deployment, use its Service API base URL. Verify an app key with:\n\n```bash\ncurl https://api.dify.ai/v1/info \\\n -H \"Authorization: Bearer $DIFY_API_KEY\"\n```\n\nFor a knowledge API key, make the same authenticated request to `GET /datasets`. For apps, use the `mode` returned by `GET /info` to choose the primary endpoint: `chat` (Chatbot), `agent-chat` (Agent), `advanced-chat` (Chatflow), and `agent` (New Agent) use `POST /chat-messages`; `completion` (Text Generator) uses `POST /completion-messages`; and `workflow` (Workflow) uses `POST /workflows/run`. Call `GET /parameters` to discover the input variables configured for the app. See [Get Started](/en/api-reference/guides/get-started) for the complete setup flow.", "version": "1.0.0" }, "servers": [ @@ -462,7 +462,7 @@ "/chat-messages/{task_id}/stop": { "post": { "summary": "Stop Chat Message Generation", - "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nStops a chat message generation task. Only supported in `streaming` mode.", + "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nStops a chat message generation task. Only supported in `streaming` mode.\n\nFor Chatbot, Agent, and New Agent apps, `user` must match the identifier that started the task. A mismatch leaves the task running while the endpoint still returns success.", "operationId": "stop_chat_message", "tags": [ "Chat Messages" @@ -503,6 +503,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SimpleResultResponse" + }, + "examples": { + "success": { + "summary": "Response Example", + "value": { + "result": "success" + } + } } } }, @@ -1113,6 +1121,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ResultResponse" + }, + "examples": { + "success": { + "summary": "Response Example", + "value": { + "result": "success" + } + } } } }, @@ -2165,7 +2181,8 @@ "required": [ "file" ], - "type": "object" + "type": "object", + "description": "Request body for audio-to-text conversion." } } } @@ -4615,7 +4632,7 @@ "/workflows/tasks/{task_id}/stop": { "post": { "summary": "Stop Workflow Task", - "description": "**Available for**: Workflow apps.\n\nStop a running workflow task. Only supported in `streaming` mode.", + "description": "**Available for**: Workflow apps.\n\nStops a running workflow task. Only supported in `streaming` mode.", "operationId": "stop_workflow_task", "tags": [ "Workflow Runs" @@ -4656,6 +4673,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SimpleResultResponse" + }, + "examples": { + "success": { + "summary": "Response Example", + "value": { + "result": "success" + } + } } } }, @@ -4946,7 +4971,7 @@ "/completion-messages/{task_id}/stop": { "post": { "summary": "Stop Completion Message Generation", - "description": "**Available for**: Text Generator apps.\n\nStops a completion message generation task. Only supported in `streaming` mode.", + "description": "**Available for**: Text Generator apps.\n\nStops a completion message generation task. Only supported in `streaming` mode.\n\n`user` must match the identifier that started the task. If it differs, the task keeps running, but the endpoint still returns success.", "operationId": "stop_completion", "tags": [ "Completion Messages" @@ -4987,6 +5012,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SimpleResultResponse" + }, + "examples": { + "success": { + "summary": "Response Example", + "value": { + "result": "success" + } + } } } }, @@ -6651,7 +6684,7 @@ "Documents" ], "summary": "Update Document", - "description": "Updates a document by uploading a new file, then re-indexes it. This is the canonical endpoint for file-based document updates. Track progress with the returned `batch` ID via [Get Document Indexing Status](/en/api-reference/documents/get-document-indexing-status).", + "description": "Updates and re-indexes a file-based document. Provide either a replacement `file` or `data` containing a `process_rule`; `data` can accompany `file` to change processing settings. Track progress with the returned `batch` ID via [Get Document Indexing Status](/en/api-reference/documents/get-document-indexing-status).", "operationId": "update_document_by_file", "parameters": [ { @@ -7380,7 +7413,7 @@ "Documents" ], "summary": "Update Document by File", - "description": "Deprecated. Use [Update Document](/en/api-reference/documents/update-document) instead. Updates a document by uploading a new file, then re-indexes it.", + "description": "Deprecated. Use [Update Document](/en/api-reference/documents/update-document) instead. Provide either a replacement `file` or `data` containing a `process_rule`; `data` can accompany `file` to change processing settings. The document is re-indexed after the update.", "operationId": "update_document_by_file_deprecated", "parameters": [ { @@ -12463,9 +12496,17 @@ "title": "Content" }, "summary": { - "type": "string", - "nullable": true, - "description": "Summary of the chunk content." + "description": "Summary of the chunk content.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Summary" }, "created_at": { "description": "Creation timestamp (Unix epoch seconds).", @@ -12591,15 +12632,24 @@ "title": "Name" }, "description": { - "type": "string", - "description": "Application description." + "description": "Application description.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" }, "tags": { "type": "array", "items": { "type": "string" }, - "description": "Application tags." + "description": "Application tags.", + "title": "Tags" }, "mode": { "type": "string", @@ -12967,7 +13017,8 @@ } ], "default": null, - "title": "Chain Id" + "title": "Chain Id", + "description": "Chain ID for this thought." }, "created_at": { "anyOf": [ @@ -12979,22 +13030,26 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Creation timestamp." }, "files": { "items": { "type": "string" }, "title": "Files", - "type": "array" + "type": "array", + "description": "File IDs related to this thought." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Agent thought ID." }, "message_id": { "title": "Message Id", - "type": "string" + "type": "string", + "description": "Unique message ID this thought belongs to." }, "observation": { "anyOf": [ @@ -13006,11 +13061,13 @@ } ], "default": null, - "title": "Observation" + "title": "Observation", + "description": "Response from tool calls." }, "position": { "title": "Position", - "type": "integer" + "type": "integer", + "description": "Position of this thought." }, "thought": { "anyOf": [ @@ -13022,7 +13079,8 @@ } ], "default": null, - "title": "Thought" + "title": "Thought", + "description": "What LLM is thinking." }, "tool": { "anyOf": [ @@ -13034,7 +13092,8 @@ } ], "default": null, - "title": "Tool" + "title": "Tool", + "description": "Tools called, split by `;`." }, "tool_input": { "anyOf": [ @@ -13046,7 +13105,8 @@ } ], "default": null, - "title": "Tool Input" + "title": "Tool Input", + "description": "Input of tools in JSON format." }, "tool_labels": { "$ref": "#/components/schemas/JSONValue" @@ -13060,7 +13120,8 @@ "tool_labels" ], "title": "AgentThought", - "type": "object" + "type": "object", + "description": "An agent thought step in the message." }, "Annotation": { "properties": { @@ -13074,7 +13135,8 @@ } ], "default": null, - "title": "Answer" + "title": "Answer", + "description": "Predefined answer returned when the annotation is matched." }, "created_at": { "anyOf": [ @@ -13087,7 +13149,8 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Creation timestamp (Unix epoch seconds)." }, "hit_count": { "anyOf": [ @@ -13099,12 +13162,14 @@ } ], "default": null, - "title": "Hit Count" + "title": "Hit Count", + "description": "Number of times this annotation has been matched and returned as a reply." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Unique annotation identifier." }, "question": { "anyOf": [ @@ -13116,7 +13181,8 @@ } ], "default": null, - "title": "Question" + "title": "Question", + "description": "Question text that triggers this annotation." } }, "required": [ @@ -13150,16 +13216,19 @@ "error_msg": { "default": "", "title": "Error Msg", - "type": "string" + "type": "string", + "description": "Error message describing why the job failed. Empty string when `job_status` is not `error`." }, "job_id": { "format": "uuid", "title": "Job Id", - "type": "string" + "type": "string", + "description": "Job ID from the [Configure Annotation Reply](/en/api-reference/annotations/configure-annotation-reply) call." }, "job_status": { "title": "Job Status", - "type": "string" + "type": "string", + "description": "Current job status. `waiting` for queued, `processing` for in progress, `completed` when finished, `error` if failed." } }, "required": [ @@ -13174,11 +13243,13 @@ "job_id": { "format": "uuid", "title": "Job Id", - "type": "string" + "type": "string", + "description": "Asynchronous job ID. Use with [Get Annotation Reply Job Status](/en/api-reference/annotations/get-annotation-reply-job-status) to track progress." }, "job_status": { "title": "Job Status", - "type": "string" + "type": "string", + "description": "Current job status: `waiting` (queued) or `processing` (in progress). `completed` and `error` are returned only by [Get Annotation Reply Job Status](/en/api-reference/annotations/get-annotation-reply-job-status)." } }, "required": [ @@ -13195,23 +13266,28 @@ "$ref": "#/components/schemas/Annotation" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of annotation items for the current page." }, "has_more": { "title": "Has More", - "type": "boolean" + "type": "boolean", + "description": "`true` if more pages are available beyond the current result set." }, "limit": { "title": "Limit", - "type": "integer" + "type": "integer", + "description": "Number of items per page." }, "page": { "title": "Page", - "type": "integer" + "type": "integer", + "description": "Current page number." }, "total": { "title": "Total", - "type": "integer" + "type": "integer", + "description": "Total number of annotations matching the query." } }, "required": [ @@ -13275,7 +13351,8 @@ "score_threshold" ], "title": "AnnotationReplyActionPayload", - "type": "object" + "type": "object", + "description": "Request body for configuring annotation reply settings." }, "AppFeedbackListResponse": { "properties": { @@ -13284,7 +13361,8 @@ "$ref": "#/components/schemas/AppFeedbackResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of feedback items." } }, "required": [ @@ -13298,7 +13376,8 @@ "app_id": { "format": "uuid", "title": "App Id", - "type": "string" + "type": "string", + "description": "Application ID." }, "content": { "anyOf": [ @@ -13310,16 +13389,19 @@ } ], "default": null, - "title": "Content" + "title": "Content", + "description": "Optional text feedback." }, "conversation_id": { "format": "uuid", "title": "Conversation Id", - "type": "string" + "type": "string", + "description": "Conversation ID." }, "created_at": { "title": "Created At", - "type": "string" + "type": "string", + "description": "Creation timestamp." }, "from_account_id": { "anyOf": [ @@ -13332,7 +13414,8 @@ } ], "default": null, - "title": "From Account Id" + "title": "From Account Id", + "description": "Account ID who submitted the feedback. Present when `from_source` is `admin`." }, "from_end_user_id": { "anyOf": [ @@ -13345,29 +13428,35 @@ } ], "default": null, - "title": "From End User Id" + "title": "From End User Id", + "description": "End user ID who submitted the feedback. Present when `from_source` is `user`." }, "from_source": { "title": "From Source", - "type": "string" + "type": "string", + "description": "Feedback source. `user` for end-user feedback submitted via API, `admin` for feedback submitted from the console." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Feedback ID." }, "message_id": { "format": "uuid", "title": "Message Id", - "type": "string" + "type": "string", + "description": "Message ID." }, "rating": { "title": "Rating", - "type": "string" + "type": "string", + "description": "Feedback rating. `like` for positive, `dislike` for negative." }, "updated_at": { "title": "Updated At", - "type": "string" + "type": "string", + "description": "Last update timestamp." } }, "required": [ @@ -13381,7 +13470,8 @@ "updated_at" ], "title": "AppFeedbackResponse", - "type": "object" + "type": "object", + "description": "A single feedback item." }, "AudioBinaryResponse": { "format": "binary", @@ -13392,7 +13482,8 @@ "properties": { "text": { "title": "Text", - "type": "string" + "type": "string", + "description": "Output text from speech recognition." } }, "required": [ @@ -13422,7 +13513,8 @@ } ], "default": null, - "title": "Retriever Resources" + "title": "Retriever Resources", + "description": "List of retriever resources used." }, "usage": { "anyOf": [ @@ -13433,7 +13525,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Model usage information." } }, "title": "BlockingMetadataResponse", @@ -13452,7 +13545,8 @@ } ], "default": null, - "title": "Content" + "title": "Content", + "description": "Content snippet from the resource." }, "created_at": { "anyOf": [ @@ -13465,7 +13559,8 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Creation timestamp (Unix epoch seconds)." }, "data_source_type": { "anyOf": [ @@ -13477,7 +13572,8 @@ } ], "default": null, - "title": "Data Source Type" + "title": "Data Source Type", + "description": "Type of the data source." }, "dataset_id": { "anyOf": [ @@ -13490,7 +13586,8 @@ } ], "default": null, - "title": "Dataset Id" + "title": "Dataset Id", + "description": "ID of the knowledge base." }, "dataset_name": { "anyOf": [ @@ -13502,7 +13599,8 @@ } ], "default": null, - "title": "Dataset Name" + "title": "Dataset Name", + "description": "Name of the knowledge base." }, "document_id": { "anyOf": [ @@ -13515,7 +13613,8 @@ } ], "default": null, - "title": "Document Id" + "title": "Document Id", + "description": "ID of the document." }, "document_name": { "anyOf": [ @@ -13527,7 +13626,8 @@ } ], "default": null, - "title": "Document Name" + "title": "Document Name", + "description": "Name of the document." }, "hit_count": { "anyOf": [ @@ -13539,7 +13639,8 @@ } ], "default": null, - "title": "Hit Count" + "title": "Hit Count", + "description": "Number of times this chunk was hit." }, "id": { "anyOf": [ @@ -13552,7 +13653,8 @@ } ], "default": null, - "title": "Id" + "title": "Id", + "description": "Unique ID of the retriever resource." }, "index_node_hash": { "anyOf": [ @@ -13564,7 +13666,8 @@ } ], "default": null, - "title": "Index Node Hash" + "title": "Index Node Hash", + "description": "Hash of the index node." }, "message_id": { "anyOf": [ @@ -13577,11 +13680,13 @@ } ], "default": null, - "title": "Message Id" + "title": "Message Id", + "description": "ID of the message this resource belongs to." }, "position": { "title": "Position", - "type": "integer" + "type": "integer", + "description": "Position of the resource in the list." }, "score": { "anyOf": [ @@ -13594,7 +13699,8 @@ } ], "default": null, - "title": "Score" + "title": "Score", + "description": "Similarity score of the resource." }, "segment_id": { "anyOf": [ @@ -13607,7 +13713,8 @@ } ], "default": null, - "title": "Segment Id" + "title": "Segment Id", + "description": "ID of the specific chunk within the document." }, "segment_position": { "anyOf": [ @@ -13619,7 +13726,8 @@ } ], "default": null, - "title": "Segment Position" + "title": "Segment Position", + "description": "Position of the chunk within the document." }, "summary": { "anyOf": [ @@ -13631,7 +13739,8 @@ } ], "default": null, - "title": "Summary" + "title": "Summary", + "description": "Summary of the chunk content." }, "word_count": { "anyOf": [ @@ -13643,14 +13752,16 @@ } ], "default": null, - "title": "Word Count" + "title": "Word Count", + "description": "Word count of the chunk." } }, "required": [ "position" ], "title": "BlockingRetrieverResourceResponse", - "type": "object" + "type": "object", + "description": "Citation and attribution information for a retriever resource." }, "BlockingUsageResponse": { "additionalProperties": true, @@ -13666,7 +13777,8 @@ } ], "default": null, - "title": "Completion Price" + "title": "Completion Price", + "description": "Total price for completion tokens." }, "completion_price_unit": { "anyOf": [ @@ -13679,7 +13791,8 @@ } ], "default": null, - "title": "Completion Price Unit" + "title": "Completion Price Unit", + "description": "Price unit for completion tokens." }, "completion_tokens": { "anyOf": [ @@ -13691,7 +13804,8 @@ } ], "default": null, - "title": "Completion Tokens" + "title": "Completion Tokens", + "description": "Number of tokens in the completion." }, "completion_unit_price": { "anyOf": [ @@ -13704,7 +13818,8 @@ } ], "default": null, - "title": "Completion Unit Price" + "title": "Completion Unit Price", + "description": "Unit price per completion token." }, "currency": { "anyOf": [ @@ -13716,7 +13831,8 @@ } ], "default": null, - "title": "Currency" + "title": "Currency", + "description": "Currency for pricing." }, "latency": { "anyOf": [ @@ -13729,7 +13845,8 @@ } ], "default": null, - "title": "Latency" + "title": "Latency", + "description": "Latency in seconds." }, "prompt_price": { "anyOf": [ @@ -13742,7 +13859,8 @@ } ], "default": null, - "title": "Prompt Price" + "title": "Prompt Price", + "description": "Total price for prompt tokens." }, "prompt_price_unit": { "anyOf": [ @@ -13755,7 +13873,8 @@ } ], "default": null, - "title": "Prompt Price Unit" + "title": "Prompt Price Unit", + "description": "Price unit for prompt tokens." }, "prompt_tokens": { "anyOf": [ @@ -13767,7 +13886,8 @@ } ], "default": null, - "title": "Prompt Tokens" + "title": "Prompt Tokens", + "description": "Number of tokens in the prompt." }, "prompt_unit_price": { "anyOf": [ @@ -13780,7 +13900,8 @@ } ], "default": null, - "title": "Prompt Unit Price" + "title": "Prompt Unit Price", + "description": "Unit price per prompt token." }, "total_price": { "anyOf": [ @@ -13793,7 +13914,8 @@ } ], "default": null, - "title": "Total Price" + "title": "Total Price", + "description": "Total price for all tokens." }, "total_tokens": { "anyOf": [ @@ -13805,7 +13927,8 @@ } ], "default": null, - "title": "Total Tokens" + "title": "Total Tokens", + "description": "Total number of tokens used." } }, "title": "BlockingUsageResponse", @@ -13846,44 +13969,52 @@ "properties": { "answer": { "title": "Answer", - "type": "string" + "type": "string", + "description": "Complete response content." }, "conversation_id": { "format": "uuid", "title": "Conversation Id", - "type": "string" + "type": "string", + "description": "Conversation ID." }, "created_at": { "format": "int64", "title": "Created At", - "type": "integer" + "type": "integer", + "description": "Message creation timestamp (Unix epoch seconds)." }, "event": { "const": "message", "title": "Event", - "type": "string" + "type": "string", + "description": "Event type, fixed as `message`." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Unique ID of this response event." }, "message_id": { "format": "uuid", "title": "Message Id", - "type": "string" + "type": "string", + "description": "Unique message ID. Use this as the `message_id` parameter when calling feedback or suggested questions endpoints." }, "metadata": { "$ref": "#/components/schemas/BlockingMetadataResponse" }, "mode": { "title": "Mode", - "type": "string" + "type": "string", + "description": "App mode. `chat` for Chatbot apps, `agent-chat` for Agent apps, `advanced-chat` for Chatflow apps." }, "task_id": { "format": "uuid", "title": "Task Id", - "type": "string" + "type": "string", + "description": "Task ID for request tracking and stop response API." } }, "required": [ @@ -14691,7 +14822,7 @@ "title": "Response Mode" }, "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "description": "End-user identifier, defined by your application and unique within it.", "type": "string" }, "workflow_id": { @@ -14782,23 +14913,28 @@ "$ref": "#/components/schemas/ChildChunkResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of child chunks." }, "limit": { "title": "Limit", - "type": "integer" + "type": "integer", + "description": "Number of items per page." }, "page": { "title": "Page", - "type": "integer" + "type": "integer", + "description": "Current page number." }, "total": { "title": "Total", - "type": "integer" + "type": "integer", + "description": "Total number of child chunks." }, "total_pages": { "title": "Total Pages", - "type": "integer" + "type": "integer", + "description": "Total number of pages." } }, "required": [ @@ -14815,35 +14951,43 @@ "properties": { "content": { "title": "Content", - "type": "string" + "type": "string", + "description": "Text content of the child chunk." }, "created_at": { "title": "Created At", - "type": "integer" + "type": "integer", + "description": "Creation timestamp (Unix epoch in seconds)." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Unique identifier of the child chunk." }, "position": { "title": "Position", - "type": "integer" + "type": "integer", + "description": "Position of the child chunk within the parent chunk." }, "segment_id": { "title": "Segment Id", - "type": "string" + "type": "string", + "description": "ID of the parent chunk this child chunk belongs to." }, "type": { "title": "Type", - "type": "string" + "type": "string", + "description": "How the child chunk was created. Child chunks created or updated through the API are always `customized`. System-generated child chunks are `automatic`." }, "updated_at": { "title": "Updated At", - "type": "integer" + "type": "integer", + "description": "Last update timestamp (Unix epoch in seconds)." }, "word_count": { "title": "Word Count", - "type": "integer" + "type": "integer", + "description": "Word count of the child chunk content." } }, "required": [ @@ -14878,38 +15022,45 @@ "properties": { "answer": { "title": "Answer", - "type": "string" + "type": "string", + "description": "Complete response content." }, "created_at": { "format": "int64", "title": "Created At", - "type": "integer" + "type": "integer", + "description": "Message creation timestamp (Unix epoch seconds)." }, "event": { "title": "Event", - "type": "string" + "type": "string", + "description": "Event type, fixed as `message`." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Unique ID of this response event." }, "message_id": { "format": "uuid", "title": "Message Id", - "type": "string" + "type": "string", + "description": "Unique message ID. Use this as the `message_id` parameter when calling feedback or suggested questions endpoints." }, "metadata": { "$ref": "#/components/schemas/BlockingMetadataResponse" }, "mode": { "title": "Mode", - "type": "string" + "type": "string", + "description": "App mode, fixed as `completion`." }, "task_id": { "format": "uuid", "title": "Task Id", - "type": "string" + "type": "string", + "description": "Task ID for request tracking and the [Stop Completion Message Generation](/en/api-reference/completion-messages/stop-completion-message-generation) API." } }, "required": [ @@ -15448,15 +15599,18 @@ "$ref": "#/components/schemas/SimpleConversation" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of conversations." }, "has_more": { "title": "Has More", - "type": "boolean" + "type": "boolean", + "description": "Whether there are more conversations." }, "limit": { "title": "Limit", - "type": "integer" + "type": "integer", + "description": "Number of items per page." } }, "required": [ @@ -15672,7 +15826,8 @@ } }, "title": "ConversationRenamePayload", - "type": "object" + "type": "object", + "description": "Request body for renaming a conversation." }, "ConversationVariableInfiniteScrollPaginationResponse": { "properties": { @@ -15681,15 +15836,18 @@ "$ref": "#/components/schemas/ConversationVariableResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of conversation variables." }, "has_more": { "title": "Has More", - "type": "boolean" + "type": "boolean", + "description": "Whether there is a next page." }, "limit": { "title": "Limit", - "type": "integer" + "type": "integer", + "description": "Number of items per page." } }, "required": [ @@ -15713,7 +15871,8 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Creation timestamp." }, "description": { "anyOf": [ @@ -15725,16 +15884,19 @@ } ], "default": null, - "title": "Description" + "title": "Description", + "description": "Variable description." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Variable ID." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Variable name." }, "updated_at": { "anyOf": [ @@ -15747,7 +15909,8 @@ } ], "default": null, - "title": "Updated At" + "title": "Updated At", + "description": "Last update timestamp." }, "value": { "anyOf": [ @@ -15759,11 +15922,13 @@ } ], "default": null, - "title": "Value" + "title": "Value", + "description": "Variable value (can be a JSON string for complex types)." }, "value_type": { "title": "Value Type", - "type": "string" + "type": "string", + "description": "Variable value type. Possible values: `string`, `number`, `object`, `secret`, `file`, `boolean`, `array[any]`, `array[string]`, `array[number]`, `array[object]`, `array[file]`, `array[boolean]`." } }, "required": [ @@ -15802,7 +15967,8 @@ "value" ], "title": "ConversationVariableUpdatePayload", - "type": "object" + "type": "object", + "description": "Request body for updating a conversation variable." }, "ConversationVariablesQuery": { "properties": { @@ -15862,11 +16028,13 @@ "$ref": "#/components/schemas/DatasetBoundTagResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of tags bound to this knowledge base." }, "total": { "title": "Total", - "type": "integer" + "type": "integer", + "description": "Total number of tags bound to this knowledge base." } }, "required": [ @@ -15880,11 +16048,13 @@ "properties": { "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Tag identifier." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Tag display name." } }, "required": [ @@ -16055,7 +16225,8 @@ "properties": { "app_count": { "title": "App Count", - "type": "integer" + "type": "integer", + "description": "Number of applications currently using this knowledge base." }, "author_name": { "anyOf": [ @@ -16066,11 +16237,13 @@ "type": "null" } ], - "title": "Author Name" + "title": "Author Name", + "description": "Display name of the creator." }, "built_in_field_enabled": { "title": "Built In Field Enabled", - "type": "boolean" + "type": "boolean", + "description": "Whether built-in metadata fields (e.g., `document_name`, `uploader`) are enabled." }, "chunk_structure": { "anyOf": [ @@ -16081,15 +16254,18 @@ "type": "null" } ], - "title": "Chunk Structure" + "title": "Chunk Structure", + "description": "Chunk structure configuration." }, "created_at": { "title": "Created At", - "type": "integer" + "type": "integer", + "description": "Creation timestamp (Unix epoch in seconds)." }, "created_by": { "title": "Created By", - "type": "string" + "type": "string", + "description": "ID of the user who created the knowledge base." }, "data_source_type": { "anyOf": [ @@ -16100,7 +16276,8 @@ "type": "null" } ], - "title": "Data Source Type" + "title": "Data Source Type", + "description": "Data source type of the documents, `null` if not yet configured." }, "description": { "anyOf": [ @@ -16111,7 +16288,8 @@ "type": "null" } ], - "title": "Description" + "title": "Description", + "description": "Optional text describing the purpose or contents of the knowledge base." }, "doc_form": { "anyOf": [ @@ -16122,18 +16300,21 @@ "type": "null" } ], - "title": "Doc Form" + "title": "Doc Form", + "description": "Document chunking mode. `text_model` for standard text chunking, `hierarchical_model` for parent-child structure, `qa_model` for QA pair extraction." }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DatasetDocMetadataResponse" }, "title": "Doc Metadata", - "type": "array" + "type": "array", + "description": "Metadata field definitions for the knowledge base." }, "document_count": { "title": "Document Count", - "type": "integer" + "type": "integer", + "description": "Total number of documents in the knowledge base." }, "embedding_available": { "anyOf": [ @@ -16145,7 +16326,8 @@ } ], "default": null, - "title": "Embedding Available" + "title": "Embedding Available", + "description": "Whether the configured embedding model is currently available." }, "embedding_model": { "anyOf": [ @@ -16156,7 +16338,8 @@ "type": "null" } ], - "title": "Embedding Model" + "title": "Embedding Model", + "description": "Name of the embedding model used for indexing." }, "embedding_model_provider": { "anyOf": [ @@ -16167,11 +16350,13 @@ "type": "null" } ], - "title": "Embedding Model Provider" + "title": "Embedding Model Provider", + "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). Legacy knowledge bases may return the bare short form (e.g. `openai`)." }, "enable_api": { "title": "Enable Api", - "type": "boolean" + "type": "boolean", + "description": "Whether API access is enabled for this knowledge base." }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" @@ -16184,14 +16369,16 @@ { "type": "null" } - ] + ], + "description": "Retrieval settings for external knowledge bases. `null` for internal knowledge bases." }, "icon_info": { "$ref": "#/components/schemas/DatasetIconInfoResponse" }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Unique identifier of the knowledge base." }, "indexing_technique": { "anyOf": [ @@ -16202,15 +16389,18 @@ "type": "null" } ], - "title": "Indexing Technique" + "title": "Indexing Technique", + "description": "`high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing." }, "is_multimodal": { "title": "Is Multimodal", - "type": "boolean" + "type": "boolean", + "description": "Whether multimodal content processing is enabled." }, "is_published": { "title": "Is Published", - "type": "boolean" + "type": "boolean", + "description": "Whether the knowledge base is published." }, "maintainer": { "anyOf": [ @@ -16222,15 +16412,18 @@ } ], "default": null, - "title": "Maintainer" + "title": "Maintainer", + "description": "Display name of the knowledge base maintainer. `null` if not set." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Display name of the knowledge base. Unique within the workspace." }, "permission": { "title": "Permission", - "type": "string" + "type": "string", + "description": "Controls who can access this knowledge base. Possible values: `only_me`, `all_team_members`, `partial_members`." }, "permission_keys": { "items": { @@ -16248,11 +16441,13 @@ "type": "null" } ], - "title": "Pipeline Id" + "title": "Pipeline Id", + "description": "Pipeline ID, if a custom processing pipeline is configured." }, "provider": { "title": "Provider", - "type": "string" + "type": "string", + "description": "Provider type. `vendor` for internally managed, `external` for external knowledge base connections." }, "retrieval_model_dict": { "$ref": "#/components/schemas/DatasetRetrievalModelResponse" @@ -16266,7 +16461,8 @@ "type": "null" } ], - "title": "Runtime Mode" + "title": "Runtime Mode", + "description": "Runtime processing mode." }, "summary_index_setting": { "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" @@ -16276,19 +16472,23 @@ "$ref": "#/components/schemas/DatasetTagResponse" }, "title": "Tags", - "type": "array" + "type": "array", + "description": "Tags associated with this knowledge base." }, "total_available_documents": { "title": "Total Available Documents", - "type": "integer" + "type": "integer", + "description": "Number of documents that are enabled and available." }, "total_documents": { "title": "Total Documents", - "type": "integer" + "type": "integer", + "description": "Total number of documents." }, "updated_at": { "title": "Updated At", - "type": "integer" + "type": "integer", + "description": "Last update timestamp (Unix epoch in seconds)." }, "updated_by": { "anyOf": [ @@ -16299,11 +16499,13 @@ "type": "null" } ], - "title": "Updated By" + "title": "Updated By", + "description": "ID of the user who last updated the knowledge base." }, "word_count": { "title": "Word Count", - "type": "integer" + "type": "integer", + "description": "Total word count across all documents." } }, "required": [ @@ -16346,7 +16548,8 @@ "properties": { "app_count": { "title": "App Count", - "type": "integer" + "type": "integer", + "description": "Number of applications currently using this knowledge base." }, "author_name": { "anyOf": [ @@ -16357,11 +16560,13 @@ "type": "null" } ], - "title": "Author Name" + "title": "Author Name", + "description": "Display name of the creator." }, "built_in_field_enabled": { "title": "Built In Field Enabled", - "type": "boolean" + "type": "boolean", + "description": "Whether built-in metadata fields (e.g., `document_name`, `uploader`) are enabled." }, "chunk_structure": { "anyOf": [ @@ -16372,15 +16577,18 @@ "type": "null" } ], - "title": "Chunk Structure" + "title": "Chunk Structure", + "description": "Chunk structure configuration." }, "created_at": { "title": "Created At", - "type": "integer" + "type": "integer", + "description": "Creation timestamp (Unix epoch in seconds)." }, "created_by": { "title": "Created By", - "type": "string" + "type": "string", + "description": "ID of the user who created the knowledge base." }, "data_source_type": { "anyOf": [ @@ -16391,7 +16599,8 @@ "type": "null" } ], - "title": "Data Source Type" + "title": "Data Source Type", + "description": "Data source type of the documents, `null` if not yet configured." }, "description": { "anyOf": [ @@ -16402,7 +16611,8 @@ "type": "null" } ], - "title": "Description" + "title": "Description", + "description": "Optional text describing the purpose or contents of the knowledge base." }, "doc_form": { "anyOf": [ @@ -16413,18 +16623,21 @@ "type": "null" } ], - "title": "Doc Form" + "title": "Doc Form", + "description": "Document chunking mode. `text_model` for standard text chunking, `hierarchical_model` for parent-child structure, `qa_model` for QA pair extraction." }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DatasetDocMetadataResponse" }, "title": "Doc Metadata", - "type": "array" + "type": "array", + "description": "Metadata field definitions for the knowledge base." }, "document_count": { "title": "Document Count", - "type": "integer" + "type": "integer", + "description": "Total number of documents in the knowledge base." }, "embedding_available": { "anyOf": [ @@ -16436,7 +16649,8 @@ } ], "default": null, - "title": "Embedding Available" + "title": "Embedding Available", + "description": "Whether the configured embedding model is currently available." }, "embedding_model": { "anyOf": [ @@ -16447,7 +16661,8 @@ "type": "null" } ], - "title": "Embedding Model" + "title": "Embedding Model", + "description": "Name of the embedding model used for indexing." }, "embedding_model_provider": { "anyOf": [ @@ -16458,11 +16673,13 @@ "type": "null" } ], - "title": "Embedding Model Provider" + "title": "Embedding Model Provider", + "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). Legacy knowledge bases may return the bare short form (e.g. `openai`)." }, "enable_api": { "title": "Enable Api", - "type": "boolean" + "type": "boolean", + "description": "Whether API access is enabled for this knowledge base." }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" @@ -16475,14 +16692,16 @@ { "type": "null" } - ] + ], + "description": "Retrieval settings for external knowledge bases. `null` for internal knowledge bases." }, "icon_info": { "$ref": "#/components/schemas/DatasetIconInfoResponse" }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Unique identifier of the knowledge base." }, "indexing_technique": { "anyOf": [ @@ -16493,15 +16712,18 @@ "type": "null" } ], - "title": "Indexing Technique" + "title": "Indexing Technique", + "description": "`high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing." }, "is_multimodal": { "title": "Is Multimodal", - "type": "boolean" + "type": "boolean", + "description": "Whether multimodal content processing is enabled." }, "is_published": { "title": "Is Published", - "type": "boolean" + "type": "boolean", + "description": "Whether the knowledge base is published." }, "maintainer": { "anyOf": [ @@ -16513,11 +16735,13 @@ } ], "default": null, - "title": "Maintainer" + "title": "Maintainer", + "description": "Display name of the knowledge base maintainer. `null` if not set." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Display name of the knowledge base. Unique within the workspace." }, "partial_member_list": { "anyOf": [ @@ -16532,11 +16756,13 @@ } ], "default": null, - "title": "Partial Member List" + "title": "Partial Member List", + "description": "Account IDs of members granted access when `permission` is `partial_members`. Always present on the update response; on the detail response, present only when `permission` is `partial_members`." }, "permission": { "title": "Permission", - "type": "string" + "type": "string", + "description": "Controls who can access this knowledge base. Possible values: `only_me`, `all_team_members`, `partial_members`." }, "permission_keys": { "items": { @@ -16554,11 +16780,13 @@ "type": "null" } ], - "title": "Pipeline Id" + "title": "Pipeline Id", + "description": "Pipeline ID, if a custom processing pipeline is configured." }, "provider": { "title": "Provider", - "type": "string" + "type": "string", + "description": "Provider type. `vendor` for internally managed, `external` for external knowledge base connections." }, "retrieval_model_dict": { "$ref": "#/components/schemas/DatasetRetrievalModelResponse" @@ -16572,7 +16800,8 @@ "type": "null" } ], - "title": "Runtime Mode" + "title": "Runtime Mode", + "description": "Runtime processing mode." }, "summary_index_setting": { "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" @@ -16582,19 +16811,23 @@ "$ref": "#/components/schemas/DatasetTagResponse" }, "title": "Tags", - "type": "array" + "type": "array", + "description": "Tags associated with this knowledge base." }, "total_available_documents": { "title": "Total Available Documents", - "type": "integer" + "type": "integer", + "description": "Number of documents that are enabled and available." }, "total_documents": { "title": "Total Documents", - "type": "integer" + "type": "integer", + "description": "Total number of documents." }, "updated_at": { "title": "Updated At", - "type": "integer" + "type": "integer", + "description": "Last update timestamp (Unix epoch in seconds)." }, "updated_by": { "anyOf": [ @@ -16605,11 +16838,13 @@ "type": "null" } ], - "title": "Updated By" + "title": "Updated By", + "description": "ID of the user who last updated the knowledge base." }, "word_count": { "title": "Word Count", - "type": "integer" + "type": "integer", + "description": "Total word count across all documents." } }, "required": [ @@ -16652,15 +16887,18 @@ "properties": { "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Metadata field identifier." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Metadata field name." }, "type": { "title": "Type", - "type": "string" + "type": "string", + "description": "Metadata field value type." } }, "required": [ @@ -16683,7 +16921,8 @@ } ], "default": null, - "title": "External Knowledge Api Endpoint" + "title": "External Knowledge Api Endpoint", + "description": "Endpoint URL of the external knowledge API." }, "external_knowledge_api_id": { "anyOf": [ @@ -16695,7 +16934,8 @@ } ], "default": null, - "title": "External Knowledge Api Id" + "title": "External Knowledge Api Id", + "description": "ID of the external knowledge API connection." }, "external_knowledge_api_name": { "anyOf": [ @@ -16707,7 +16947,8 @@ } ], "default": null, - "title": "External Knowledge Api Name" + "title": "External Knowledge Api Name", + "description": "Display name of the external knowledge API." }, "external_knowledge_id": { "anyOf": [ @@ -16719,7 +16960,8 @@ } ], "default": null, - "title": "External Knowledge Id" + "title": "External Knowledge Id", + "description": "ID of the external knowledge base." } }, "title": "DatasetExternalKnowledgeInfoResponse", @@ -16737,7 +16979,8 @@ } ], "default": null, - "title": "Score Threshold" + "title": "Score Threshold", + "description": "Minimum similarity score threshold." }, "score_threshold_enabled": { "anyOf": [ @@ -16749,11 +16992,13 @@ } ], "default": null, - "title": "Score Threshold Enabled" + "title": "Score Threshold Enabled", + "description": "Whether score threshold filtering is enabled." }, "top_k": { "title": "Top K", - "type": "integer" + "type": "integer", + "description": "Maximum number of results to return from the external knowledge base." } }, "required": [ @@ -16774,7 +17019,8 @@ } ], "default": null, - "title": "Icon" + "title": "Icon", + "description": "Icon identifier or emoji." }, "icon_background": { "anyOf": [ @@ -16786,7 +17032,8 @@ } ], "default": null, - "title": "Icon Background" + "title": "Icon Background", + "description": "Background color for the icon." }, "icon_type": { "anyOf": [ @@ -16798,7 +17045,8 @@ } ], "default": null, - "title": "Icon Type" + "title": "Icon Type", + "description": "Type of icon." }, "icon_url": { "anyOf": [ @@ -16810,7 +17058,8 @@ } ], "default": null, - "title": "Icon Url" + "title": "Icon Url", + "description": "URL of a custom icon image." } }, "title": "DatasetIconInfoResponse", @@ -16828,7 +17077,8 @@ } ], "default": null, - "title": "Keyword Weight" + "title": "Keyword Weight", + "description": "Weight assigned to keyword search results." } }, "title": "DatasetKeywordSettingResponse", @@ -16886,23 +17136,28 @@ "$ref": "#/components/schemas/DatasetDetailResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "Array of knowledge base objects." }, "has_more": { "title": "Has More", - "type": "boolean" + "type": "boolean", + "description": "Whether more items exist on the next page." }, "limit": { "title": "Limit", - "type": "integer" + "type": "integer", + "description": "Number of items per page." }, "page": { "title": "Page", - "type": "integer" + "type": "integer", + "description": "Current page number." }, "total": { "title": "Total", - "type": "integer" + "type": "integer", + "description": "Total number of matching items." } }, "required": [ @@ -16919,7 +17174,8 @@ "properties": { "result": { "title": "Result", - "type": "string" + "type": "string", + "description": "Operation result." } }, "required": [ @@ -16932,11 +17188,13 @@ "properties": { "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Built-in field identifier. `document_name` for the document title, `uploader` for the creator, `upload_date` for creation time, `last_update_date` for last modification time, `source` for the document origin." }, "type": { "title": "Type", - "type": "string" + "type": "string", + "description": "Field data type. `string` for text values, `time` for date/time values." } }, "required": [ @@ -16953,7 +17211,8 @@ "$ref": "#/components/schemas/DatasetMetadataBuiltInFieldResponse" }, "title": "Fields", - "type": "array" + "type": "array", + "description": "List of system-provided metadata fields." } }, "required": [ @@ -16967,19 +17226,23 @@ "count": { "default": 0, "title": "Count", - "type": "integer" + "type": "integer", + "description": "Number of documents using this metadata field." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Metadata field identifier." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Metadata field name." }, "type": { "title": "Type", - "type": "string" + "type": "string", + "description": "Metadata field type." } }, "required": [ @@ -16994,14 +17257,16 @@ "properties": { "built_in_field_enabled": { "title": "Built In Field Enabled", - "type": "boolean" + "type": "boolean", + "description": "Whether built-in metadata fields are enabled for this knowledge base." }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DatasetMetadataListItemResponse" }, "title": "Doc Metadata", - "type": "array" + "type": "array", + "description": "List of metadata field definitions." } }, "required": [ @@ -17015,15 +17280,18 @@ "properties": { "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Metadata field identifier." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Metadata field name." }, "type": { "title": "Type", - "type": "string" + "type": "string", + "description": "Metadata field type." } }, "required": [ @@ -17046,7 +17314,8 @@ } ], "default": null, - "title": "Reranking Model Name" + "title": "Reranking Model Name", + "description": "Name of the reranking model." }, "reranking_provider_name": { "anyOf": [ @@ -17058,7 +17327,8 @@ } ], "default": null, - "title": "Reranking Provider Name" + "title": "Reranking Provider Name", + "description": "Reranking model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/cohere/cohere`). Legacy knowledge bases may return the bare short form (e.g. `cohere`)." } }, "title": "DatasetRerankingModelResponse", @@ -17068,7 +17338,8 @@ "properties": { "reranking_enable": { "title": "Reranking Enable", - "type": "boolean" + "type": "boolean", + "description": "Whether reranking is enabled." }, "reranking_mode": { "anyOf": [ @@ -17080,7 +17351,8 @@ } ], "default": null, - "title": "Reranking Mode" + "title": "Reranking Mode", + "description": "Reranking mode. `reranking_model` for model-based reranking, `weighted_score` for score-based weighting. `null` if reranking is disabled." }, "reranking_model": { "$ref": "#/components/schemas/DatasetRerankingModelResponse" @@ -17095,19 +17367,23 @@ } ], "default": null, - "title": "Score Threshold" + "title": "Score Threshold", + "description": "Minimum similarity score for results. Only effective when `score_threshold_enabled` is `true`." }, "score_threshold_enabled": { "title": "Score Threshold Enabled", - "type": "boolean" + "type": "boolean", + "description": "Whether score threshold filtering is enabled." }, "search_method": { "title": "Search Method", - "type": "string" + "type": "string", + "description": "Search method used for retrieval. `keyword_search` for keyword matching, `semantic_search` for embedding-based similarity, `full_text_search` for full-text indexing, `hybrid_search` for a combination of semantic and keyword approaches." }, "top_k": { "title": "Top K", - "type": "integer" + "type": "integer", + "description": "Maximum number of results to return." }, "weights": { "anyOf": [ @@ -17118,7 +17394,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Weight configuration for hybrid search." } }, "required": [ @@ -17142,7 +17419,8 @@ } ], "default": null, - "title": "Enable" + "title": "Enable", + "description": "Whether summary indexing is enabled." }, "model_name": { "anyOf": [ @@ -17154,7 +17432,8 @@ } ], "default": null, - "title": "Model Name" + "title": "Model Name", + "description": "Name of the model used for generating summaries." }, "model_provider_name": { "anyOf": [ @@ -17166,7 +17445,8 @@ } ], "default": null, - "title": "Model Provider Name" + "title": "Model Provider Name", + "description": "Provider of the summary generation model." }, "summary_prompt": { "anyOf": [ @@ -17178,7 +17458,8 @@ } ], "default": null, - "title": "Summary Prompt" + "title": "Summary Prompt", + "description": "Prompt template used for summary generation." } }, "title": "DatasetSummaryIndexSettingResponse", @@ -17188,15 +17469,18 @@ "properties": { "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Tag identifier." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Tag name." }, "type": { "title": "Type", - "type": "string" + "type": "string", + "description": "Tag type. Always `knowledge` for knowledge base tags." } }, "required": [ @@ -17396,7 +17680,8 @@ } ], "default": null, - "title": "Embedding Model Name" + "title": "Embedding Model Name", + "description": "Name of the embedding model used for vector search." }, "embedding_provider_name": { "anyOf": [ @@ -17408,7 +17693,8 @@ } ], "default": null, - "title": "Embedding Provider Name" + "title": "Embedding Provider Name", + "description": "Provider of the embedding model used for vector search." }, "vector_weight": { "anyOf": [ @@ -17420,7 +17706,8 @@ } ], "default": null, - "title": "Vector Weight" + "title": "Vector Weight", + "description": "Weight assigned to semantic (vector) search results." } }, "title": "DatasetVectorSettingResponse", @@ -17444,7 +17731,8 @@ } ], "default": null, - "title": "Weight Type" + "title": "Weight Type", + "description": "Strategy for balancing semantic and keyword search weights." } }, "title": "DatasetWeightedScoreResponse", @@ -17462,7 +17750,8 @@ } ], "default": null, - "title": "Id" + "title": "Id", + "description": "Credential ID. Pass this as `credential_id` to [Run Datasource Node](/en/api-reference/knowledge-pipeline/run-datasource-node) or in per-item `credential_id` fields of [Run Pipeline](/en/api-reference/knowledge-pipeline/run-pipeline)." }, "is_default": { "anyOf": [ @@ -17474,7 +17763,8 @@ } ], "default": null, - "title": "Is Default" + "title": "Is Default", + "description": "Whether this credential is the default for the provider." }, "name": { "anyOf": [ @@ -17486,7 +17776,8 @@ } ], "default": null, - "title": "Name" + "title": "Name", + "description": "Display name of the credential." }, "type": { "anyOf": [ @@ -17498,7 +17789,8 @@ } ], "default": null, - "title": "Type" + "title": "Type", + "description": "Credential type defined by the datasource plugin." } }, "title": "DatasourceCredentialInfoResponse", @@ -17564,7 +17856,8 @@ "$ref": "#/components/schemas/DatasourceCredentialInfoResponse" }, "title": "Credentials", - "type": "array" + "type": "array", + "description": "Credentials available for authenticating with this datasource." }, "datasource_type": { "anyOf": [ @@ -17576,7 +17869,8 @@ } ], "default": null, - "title": "Datasource Type" + "title": "Datasource Type", + "description": "Type of datasource. One of `local_file`, `online_document`, `online_drive`, `website_crawl`." }, "node_id": { "anyOf": [ @@ -17588,7 +17882,8 @@ } ], "default": null, - "title": "Node Id" + "title": "Node Id", + "description": "ID of the datasource node in the pipeline workflow. Pass this as `node_id` to [Run Datasource Node](/en/api-reference/knowledge-pipeline/run-datasource-node), or as `start_node_id` to [Run Pipeline](/en/api-reference/knowledge-pipeline/run-pipeline)." }, "plugin_id": { "anyOf": [ @@ -17600,7 +17895,8 @@ } ], "default": null, - "title": "Plugin Id" + "title": "Plugin Id", + "description": "ID of the datasource plugin providing this node." }, "provider_name": { "anyOf": [ @@ -17612,7 +17908,8 @@ } ], "default": null, - "title": "Provider Name" + "title": "Provider Name", + "description": "Provider name registered by the datasource plugin." }, "title": { "anyOf": [ @@ -17624,7 +17921,8 @@ } ], "default": null, - "title": "Title" + "title": "Title", + "description": "Display title configured for the node." }, "user_input_variables": { "items": { @@ -17632,7 +17930,8 @@ "type": "object" }, "title": "User Input Variables", - "type": "array" + "type": "array", + "description": "Pipeline input variables the caller must supply for this datasource, derived from `{{#...#}}` references in the node's datasource parameters. Each item follows the pipeline variable schema used by the workflow." } }, "title": "DatasourcePluginResponse", @@ -17654,7 +17953,8 @@ "properties": { "batch": { "title": "Batch", - "type": "string" + "type": "string", + "description": "Batch ID for tracking indexing progress." }, "document": { "$ref": "#/components/schemas/DocumentResponse" @@ -17693,7 +17993,8 @@ "archived": { "default": null, "title": "Archived", - "type": "boolean" + "type": "boolean", + "description": "Whether the document is archived." }, "average_segment_length": { "anyOf": [ @@ -17705,7 +18006,8 @@ } ], "default": null, - "title": "Average Segment Length" + "title": "Average Segment Length", + "description": "Average character length of chunks." }, "completed_at": { "anyOf": [ @@ -17717,39 +18019,46 @@ } ], "default": null, - "title": "Completed At" + "title": "Completed At", + "description": "Unix timestamp when processing completed, `null` if not yet completed." }, "created_at": { "default": null, "title": "Created At", - "type": "integer" + "type": "integer", + "description": "Unix timestamp of document creation." }, "created_by": { "default": null, "title": "Created By", - "type": "string" + "type": "string", + "description": "ID of the user who created the document." }, "created_from": { "default": null, "title": "Created From", - "type": "string" + "type": "string", + "description": "Origin of the document. `api` for API creation, `web` for UI creation." }, "data_source_info": { "additionalProperties": true, "default": null, "title": "Data Source Info", - "type": "object" + "type": "object", + "description": "Data source details. For file uploads, this detail endpoint returns the full file object under `upload_file` (the list endpoint returns only `upload_file_id`)." }, "data_source_type": { "default": null, "title": "Data Source Type", - "type": "string" + "type": "string", + "description": "How the document was uploaded. `upload_file` for file uploads, `notion_import` for Notion imports." }, "dataset_process_rule": { "additionalProperties": true, "default": null, "title": "Dataset Process Rule", - "type": "object" + "type": "object", + "description": "Knowledge-base-level processing rule configuration." }, "dataset_process_rule_id": { "anyOf": [ @@ -17761,7 +18070,8 @@ } ], "default": null, - "title": "Dataset Process Rule Id" + "title": "Dataset Process Rule Id", + "description": "ID of the processing rule applied to this document." }, "disabled_at": { "anyOf": [ @@ -17773,7 +18083,8 @@ } ], "default": null, - "title": "Disabled At" + "title": "Disabled At", + "description": "Unix timestamp when the document was disabled, `null` if enabled." }, "disabled_by": { "anyOf": [ @@ -17785,7 +18096,8 @@ } ], "default": null, - "title": "Disabled By" + "title": "Disabled By", + "description": "ID of the user who disabled the document, `null` if enabled." }, "display_status": { "anyOf": [ @@ -17797,12 +18109,14 @@ } ], "default": null, - "title": "Display Status" + "title": "Display Status", + "description": "Display-friendly indexing status for the UI." }, "doc_form": { "default": null, "title": "Doc Form", - "type": "string" + "type": "string", + "description": "Document chunking mode. `text_model` for standard text, `hierarchical_model` for parent-child, `qa_model` for QA pairs." }, "doc_language": { "anyOf": [ @@ -17814,7 +18128,8 @@ } ], "default": null, - "title": "Doc Language" + "title": "Doc Language", + "description": "Language of the document content." }, "doc_metadata": { "anyOf": [ @@ -17833,7 +18148,8 @@ } ], "default": null, - "title": "Doc Metadata" + "title": "Doc Metadata", + "description": "Custom metadata key-value pairs for this document." }, "doc_type": { "anyOf": [ @@ -17845,18 +18161,21 @@ } ], "default": null, - "title": "Doc Type" + "title": "Doc Type", + "description": "Document type classification, `null` if not set." }, "document_process_rule": { "additionalProperties": true, "default": null, "title": "Document Process Rule", - "type": "object" + "type": "object", + "description": "Document-level processing rule configuration." }, "enabled": { "default": null, "title": "Enabled", - "type": "boolean" + "type": "boolean", + "description": "Whether the document is enabled for retrieval." }, "error": { "anyOf": [ @@ -17868,16 +18187,19 @@ } ], "default": null, - "title": "Error" + "title": "Error", + "description": "Error message if indexing failed, `null` otherwise." }, "hit_count": { "default": null, "title": "Hit Count", - "type": "integer" + "type": "integer", + "description": "Number of times this document has been retrieved." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Document identifier." }, "indexing_latency": { "anyOf": [ @@ -17889,32 +18211,38 @@ } ], "default": null, - "title": "Indexing Latency" + "title": "Indexing Latency", + "description": "Time taken for indexing in seconds, `null` if not completed." }, "indexing_status": { "default": null, "title": "Indexing Status", - "type": "string" + "type": "string", + "description": "Current indexing status, e.g. `waiting`, `parsing`, `cleaning`, `splitting`, `indexing`, `completed`, `error`, `paused`." }, "name": { "default": null, "title": "Name", - "type": "string" + "type": "string", + "description": "Document name." }, "need_summary": { "default": null, "title": "Need Summary", - "type": "boolean" + "type": "boolean", + "description": "Whether the document needs summary generation." }, "position": { "default": null, "title": "Position", - "type": "integer" + "type": "integer", + "description": "Position index within the knowledge base." }, "segment_count": { "default": null, "title": "Segment Count", - "type": "integer" + "type": "integer", + "description": "Number of chunks in the document." }, "summary_index_status": { "anyOf": [ @@ -17926,7 +18254,8 @@ } ], "default": null, - "title": "Summary Index Status" + "title": "Summary Index Status", + "description": "Status of summary indexing, `null` if summary index is not enabled." }, "tokens": { "anyOf": [ @@ -17938,7 +18267,8 @@ } ], "default": null, - "title": "Tokens" + "title": "Tokens", + "description": "Number of tokens in the document." }, "updated_at": { "anyOf": [ @@ -17950,7 +18280,8 @@ } ], "default": null, - "title": "Updated At" + "title": "Updated At", + "description": "Unix timestamp of last update, `null` if never updated." } }, "required": [ @@ -18036,23 +18367,28 @@ "$ref": "#/components/schemas/DocumentResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "Array of document objects." }, "has_more": { "title": "Has More", - "type": "boolean" + "type": "boolean", + "description": "Whether more items exist on the next page." }, "limit": { "title": "Limit", - "type": "integer" + "type": "integer", + "description": "Number of items per page." }, "page": { "title": "Page", - "type": "integer" + "type": "integer", + "description": "Current page number." }, "total": { "title": "Total", - "type": "integer" + "type": "integer", + "description": "Total number of matching items." } }, "required": [ @@ -18099,11 +18435,13 @@ "properties": { "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Metadata field identifier." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Metadata field name." }, "type": { "title": "Type", @@ -18151,7 +18489,8 @@ } ], "default": null, - "title": "Archived" + "title": "Archived", + "description": "Whether the document is archived." }, "created_at": { "anyOf": [ @@ -18163,7 +18502,8 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Creation timestamp (Unix epoch in seconds)." }, "created_by": { "anyOf": [ @@ -18175,7 +18515,8 @@ } ], "default": null, - "title": "Created By" + "title": "Created By", + "description": "ID of the user who created the document." }, "created_from": { "anyOf": [ @@ -18187,12 +18528,14 @@ } ], "default": null, - "title": "Created From" + "title": "Created From", + "description": "Origin of the document. `api` for API creation, `web` for UI creation." }, "data_source_detail_dict": { "additionalProperties": true, "title": "Data Source Detail Dict", - "type": "object" + "type": "object", + "description": "Detailed data source information including file details." }, "data_source_info": { "anyOf": [ @@ -18205,7 +18548,8 @@ } ], "default": null, - "title": "Data Source Info" + "title": "Data Source Info", + "description": "Raw data source information, varies by `data_source_type`." }, "data_source_type": { "anyOf": [ @@ -18217,7 +18561,8 @@ } ], "default": null, - "title": "Data Source Type" + "title": "Data Source Type", + "description": "How the document was created. `upload_file` for file uploads, `notion_import` for Notion imports." }, "dataset_process_rule_id": { "anyOf": [ @@ -18229,7 +18574,8 @@ } ], "default": null, - "title": "Dataset Process Rule Id" + "title": "Dataset Process Rule Id", + "description": "ID of the processing rule applied to this document." }, "disabled_at": { "anyOf": [ @@ -18241,7 +18587,8 @@ } ], "default": null, - "title": "Disabled At" + "title": "Disabled At", + "description": "Timestamp when the document was disabled. `null` if enabled." }, "disabled_by": { "anyOf": [ @@ -18253,7 +18600,8 @@ } ], "default": null, - "title": "Disabled By" + "title": "Disabled By", + "description": "ID of the user who disabled the document. `null` if enabled." }, "display_status": { "anyOf": [ @@ -18265,7 +18613,8 @@ } ], "default": null, - "title": "Display Status" + "title": "Display Status", + "description": "User-facing display status derived from `indexing_status` and `enabled` state." }, "doc_form": { "anyOf": [ @@ -18277,14 +18626,16 @@ } ], "default": null, - "title": "Doc Form" + "title": "Doc Form", + "description": "Document chunking mode. `text_model` for standard text chunking, `hierarchical_model` for parent-child structure, `qa_model` for QA pair extraction." }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DocumentMetadataResponse" }, "title": "Doc Metadata", - "type": "array" + "type": "array", + "description": "Metadata values assigned to this document." }, "enabled": { "anyOf": [ @@ -18296,7 +18647,8 @@ } ], "default": null, - "title": "Enabled" + "title": "Enabled", + "description": "Whether the document is enabled for retrieval." }, "error": { "anyOf": [ @@ -18308,7 +18660,8 @@ } ], "default": null, - "title": "Error" + "title": "Error", + "description": "Error message if indexing failed. `null` when no error." }, "hit_count": { "anyOf": [ @@ -18320,11 +18673,13 @@ } ], "default": null, - "title": "Hit Count" + "title": "Hit Count", + "description": "Number of times the document has been matched in retrieval queries." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Unique identifier of the document." }, "indexing_status": { "anyOf": [ @@ -18336,11 +18691,13 @@ } ], "default": null, - "title": "Indexing Status" + "title": "Indexing Status", + "description": "Current indexing status. `waiting` for queued, `parsing` while extracting content, `cleaning` while removing noise, `splitting` while chunking, `indexing` while building vectors, `completed` when ready, `error` if failed, `paused` if manually paused." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Document name." }, "need_summary": { "anyOf": [ @@ -18352,7 +18709,8 @@ } ], "default": null, - "title": "Need Summary" + "title": "Need Summary", + "description": "Whether a summary needs to be generated for this document." }, "position": { "anyOf": [ @@ -18364,7 +18722,8 @@ } ], "default": null, - "title": "Position" + "title": "Position", + "description": "Display position of the document in the list." }, "summary_index_status": { "anyOf": [ @@ -18376,7 +18735,8 @@ } ], "default": null, - "title": "Summary Index Status" + "title": "Summary Index Status", + "description": "Status of the summary index for this document. `null` if summary indexing is not configured." }, "tokens": { "anyOf": [ @@ -18388,7 +18748,8 @@ } ], "default": null, - "title": "Tokens" + "title": "Tokens", + "description": "Total number of tokens in the document." }, "word_count": { "anyOf": [ @@ -18400,7 +18761,8 @@ } ], "default": null, - "title": "Word Count" + "title": "Word Count", + "description": "Total word count of the document." } }, "required": [ @@ -18418,7 +18780,8 @@ "$ref": "#/components/schemas/DocumentStatusResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of indexing status entries." } }, "required": [ @@ -18452,7 +18815,8 @@ "type": "null" } ], - "title": "Cleaning Completed At" + "title": "Cleaning Completed At", + "description": "Unix timestamp when cleaning completed." }, "completed_at": { "anyOf": [ @@ -18463,7 +18827,8 @@ "type": "null" } ], - "title": "Completed At" + "title": "Completed At", + "description": "Unix timestamp when indexing completed." }, "completed_segments": { "anyOf": [ @@ -18475,7 +18840,8 @@ } ], "default": null, - "title": "Completed Segments" + "title": "Completed Segments", + "description": "Number of chunks that have been indexed." }, "error": { "anyOf": [ @@ -18486,7 +18852,8 @@ "type": "null" } ], - "title": "Error" + "title": "Error", + "description": "Error message if indexing failed. `null` if no error." }, "error_code": { "anyOf": [ @@ -18514,11 +18881,13 @@ }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Document identifier." }, "indexing_status": { "title": "Indexing Status", - "type": "string" + "type": "string", + "description": "Current indexing status: `waiting`, `parsing`, `cleaning`, `splitting`, `indexing`, `completed`, or `error`." }, "parsing_completed_at": { "anyOf": [ @@ -18529,7 +18898,8 @@ "type": "null" } ], - "title": "Parsing Completed At" + "title": "Parsing Completed At", + "description": "Unix timestamp when parsing completed." }, "paused_at": { "anyOf": [ @@ -18540,7 +18910,8 @@ "type": "null" } ], - "title": "Paused At" + "title": "Paused At", + "description": "Timestamp when indexing was paused. `null` if not paused." }, "processing_started_at": { "anyOf": [ @@ -18551,7 +18922,8 @@ "type": "null" } ], - "title": "Processing Started At" + "title": "Processing Started At", + "description": "Unix timestamp when processing started." }, "splitting_completed_at": { "anyOf": [ @@ -18562,7 +18934,8 @@ "type": "null" } ], - "title": "Splitting Completed At" + "title": "Splitting Completed At", + "description": "Unix timestamp when splitting completed." }, "stopped_at": { "anyOf": [ @@ -18573,7 +18946,8 @@ "type": "null" } ], - "title": "Stopped At" + "title": "Stopped At", + "description": "Timestamp when indexing was stopped. `null` if not stopped." }, "total_segments": { "anyOf": [ @@ -18585,7 +18959,8 @@ } ], "default": null, - "title": "Total Segments" + "title": "Total Segments", + "description": "Total number of chunks to be indexed." }, "vector_space_limit_mb": { "anyOf": [ @@ -18980,31 +19355,36 @@ "type": "string" }, "title": "Allowed File Extensions", - "type": "array" + "type": "array", + "description": "Allowed file extensions when `allowed_file_types` includes `custom`. Entries may include or omit the leading `.`, and matching is case-insensitive. The list must contain at least one extension when `custom` is selected." }, "allowed_file_types": { "items": { "$ref": "#/components/schemas/FileType" }, "title": "Allowed File Types", - "type": "array" + "type": "array", + "description": "File categories the recipient may upload: `image`, `document`, `audio`, `video`, or `custom`." }, "allowed_file_upload_methods": { "items": { "$ref": "#/components/schemas/FileTransferMethod" }, "title": "Allowed File Upload Methods", - "type": "array" + "type": "array", + "description": "Upload methods the recipient may use: `local_file` or `remote_url`." }, "output_variable_name": { "title": "Output Variable Name", - "type": "string" + "type": "string", + "description": "Variable name used to reference this input's submitted value inside the workflow." }, "type": { "const": "file", "default": "file", "title": "Type", - "type": "string" + "type": "string", + "description": "`file`, a single-file upload input." } }, "required": [ @@ -19020,37 +19400,43 @@ "type": "string" }, "title": "Allowed File Extensions", - "type": "array" + "type": "array", + "description": "Allowed file extensions when `allowed_file_types` includes `custom`. Entries may include or omit the leading `.`, and matching is case-insensitive. The list must contain at least one extension when `custom` is selected. Present for `file` and `file-list` inputs." }, "allowed_file_types": { "items": { "$ref": "#/components/schemas/FileType" }, "title": "Allowed File Types", - "type": "array" + "type": "array", + "description": "File categories the recipient may upload. Present for `file` and `file-list` inputs. Values: `image`, `document`, `audio`, `video`, `custom`." }, "allowed_file_upload_methods": { "items": { "$ref": "#/components/schemas/FileTransferMethod" }, "title": "Allowed File Upload Methods", - "type": "array" + "type": "array", + "description": "Upload methods the recipient may use. Values: `local_file`, `remote_url`. Present for `file` and `file-list` inputs." }, "number_limits": { "default": 0, "minimum": 0, "title": "Number Limits", - "type": "integer" + "type": "integer", + "description": "Maximum number of files the recipient may upload. Present only for `file-list` inputs." }, "output_variable_name": { "title": "Output Variable Name", - "type": "string" + "type": "string", + "description": "Variable name used to reference this input's submitted value inside the workflow. Corresponds to the key in the submission `inputs` object." }, "type": { "const": "file-list", "default": "file-list", "title": "Type", - "type": "string" + "type": "string", + "description": "`file-list`, a multiple-file upload input." } }, "required": [ @@ -19084,7 +19470,8 @@ } ], "default": null, - "title": "Conversation Id" + "title": "Conversation Id", + "description": "ID of the associated conversation." }, "created_at": { "anyOf": [ @@ -19097,7 +19484,8 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Upload timestamp (Unix epoch seconds)." }, "created_by": { "anyOf": [ @@ -19110,7 +19498,8 @@ } ], "default": null, - "title": "Created By" + "title": "Created By", + "description": "End-user ID of the uploader. Look up details with [Get End User Info](/en/api-reference/end-users/get-end-user-info)." }, "extension": { "anyOf": [ @@ -19122,7 +19511,8 @@ } ], "default": null, - "title": "Extension" + "title": "Extension", + "description": "File extension." }, "file_key": { "anyOf": [ @@ -19134,12 +19524,14 @@ } ], "default": null, - "title": "File Key" + "title": "File Key", + "description": "Unused; always `null`." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Unique file ID." }, "mime_type": { "anyOf": [ @@ -19151,11 +19543,13 @@ } ], "default": null, - "title": "Mime Type" + "title": "Mime Type", + "description": "MIME type of the file." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "File name." }, "original_url": { "anyOf": [ @@ -19167,7 +19561,8 @@ } ], "default": null, - "title": "Original Url" + "title": "Original Url", + "description": "Original URL of the file." }, "preview_url": { "anyOf": [ @@ -19179,7 +19574,8 @@ } ], "default": null, - "title": "Preview Url" + "title": "Preview Url", + "description": "Preview URL for the file." }, "reference": { "anyOf": [ @@ -19191,11 +19587,13 @@ } ], "default": null, - "title": "Reference" + "title": "Reference", + "description": "Opaque file reference used internally when attaching files in agent and tool contexts. Always `null` for files uploaded through this endpoint." }, "size": { "title": "Size", - "type": "integer" + "type": "integer", + "description": "File size in bytes." }, "source_url": { "anyOf": [ @@ -19207,7 +19605,8 @@ } ], "default": null, - "title": "Source Url" + "title": "Source Url", + "description": "Signed URL for downloading the file." }, "tenant_id": { "anyOf": [ @@ -19220,7 +19619,8 @@ } ], "default": null, - "title": "Tenant Id" + "title": "Tenant Id", + "description": "ID of the associated tenant." }, "user_id": { "anyOf": [ @@ -19233,7 +19633,8 @@ } ], "default": null, - "title": "User Id" + "title": "User Id", + "description": "Unused; always `null`." } }, "required": [ @@ -19288,25 +19689,30 @@ { "$ref": "#/components/schemas/FileListInputConfig" } - ] + ], + "description": "A form input field definition." }, "HitTestingChildChunk": { "properties": { "content": { "title": "Content", - "type": "string" + "type": "string", + "description": "Text content of the child chunk." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Unique identifier of the child chunk." }, "position": { "title": "Position", - "type": "integer" + "type": "integer", + "description": "Position of the child chunk within the parent chunk." }, "score": { "title": "Score", - "type": "number" + "type": "number", + "description": "Similarity score of the child chunk." } }, "required": [ @@ -19322,7 +19728,8 @@ "properties": { "data_source_type": { "title": "Data Source Type", - "type": "string" + "type": "string", + "description": "How the document was created." }, "doc_metadata": { "anyOf": [ @@ -19331,7 +19738,8 @@ "type": "null" } ], - "title": "Doc Metadata" + "title": "Doc Metadata", + "description": "Metadata values for the document. `null` if no metadata is configured." }, "doc_type": { "anyOf": [ @@ -19342,15 +19750,18 @@ "type": "null" } ], - "title": "Doc Type" + "title": "Doc Type", + "description": "Document type classification. `null` if not set." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Unique identifier of the document." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Document name." } }, "required": [ @@ -19367,27 +19778,33 @@ "properties": { "extension": { "title": "Extension", - "type": "string" + "type": "string", + "description": "File extension." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Attachment file identifier." }, "mime_type": { "title": "Mime Type", - "type": "string" + "type": "string", + "description": "MIME type of the file." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Original file name." }, "size": { "title": "Size", - "type": "integer" + "type": "integer", + "description": "File size in bytes." }, "source_url": { "title": "Source Url", - "type": "string" + "type": "string", + "description": "URL to access the attachment." } }, "required": [ @@ -19475,7 +19892,8 @@ "properties": { "content": { "title": "Content", - "type": "string" + "type": "string", + "description": "The query text." } }, "required": [ @@ -19491,14 +19909,16 @@ "$ref": "#/components/schemas/HitTestingChildChunk" }, "title": "Child Chunks", - "type": "array" + "type": "array", + "description": "Matched child chunks within the chunk, if using hierarchical indexing." }, "files": { "items": { "$ref": "#/components/schemas/HitTestingFile" }, "title": "Files", - "type": "array" + "type": "array", + "description": "Files attached to this chunk." }, "score": { "anyOf": [ @@ -19509,7 +19929,8 @@ "type": "null" } ], - "title": "Score" + "title": "Score", + "description": "Similarity score." }, "segment": { "$ref": "#/components/schemas/HitTestingSegment" @@ -19523,7 +19944,8 @@ "type": "null" } ], - "title": "Summary" + "title": "Summary", + "description": "Summary content if retrieved via summary index." }, "tsne_position": { "anyOf": [ @@ -19532,7 +19954,8 @@ "type": "null" } ], - "title": "Tsne Position" + "title": "Tsne Position", + "description": "t-SNE visualization position." } }, "required": [ @@ -19556,7 +19979,8 @@ "$ref": "#/components/schemas/HitTestingRecord" }, "title": "Records", - "type": "array" + "type": "array", + "description": "List of matched retrieval records." } }, "required": [ @@ -19577,7 +20001,8 @@ "type": "null" } ], - "title": "Answer" + "title": "Answer", + "description": "Answer content, used in Q&A mode documents." }, "completed_at": { "anyOf": [ @@ -19588,19 +20013,23 @@ "type": "null" } ], - "title": "Completed At" + "title": "Completed At", + "description": "Timestamp when indexing completed. `null` if not yet completed." }, "content": { "title": "Content", - "type": "string" + "type": "string", + "description": "Text content of the chunk." }, "created_at": { "title": "Created At", - "type": "integer" + "type": "integer", + "description": "Creation timestamp (Unix epoch in seconds)." }, "created_by": { "title": "Created By", - "type": "string" + "type": "string", + "description": "ID of the user who created the chunk." }, "disabled_at": { "anyOf": [ @@ -19611,7 +20040,8 @@ "type": "null" } ], - "title": "Disabled At" + "title": "Disabled At", + "description": "Timestamp when the chunk was disabled. `null` if enabled." }, "disabled_by": { "anyOf": [ @@ -19622,18 +20052,21 @@ "type": "null" } ], - "title": "Disabled By" + "title": "Disabled By", + "description": "ID of the user who disabled the chunk. `null` if enabled." }, "document": { "$ref": "#/components/schemas/HitTestingDocument" }, "document_id": { "title": "Document Id", - "type": "string" + "type": "string", + "description": "ID of the document this chunk belongs to." }, "enabled": { "title": "Enabled", - "type": "boolean" + "type": "boolean", + "description": "Whether the chunk is enabled for retrieval." }, "error": { "anyOf": [ @@ -19644,15 +20077,18 @@ "type": "null" } ], - "title": "Error" + "title": "Error", + "description": "Error message if indexing failed. `null` when no error." }, "hit_count": { "title": "Hit Count", - "type": "integer" + "type": "integer", + "description": "Number of times this chunk has been matched in retrieval queries." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Unique identifier of the chunk." }, "index_node_hash": { "anyOf": [ @@ -19663,7 +20099,8 @@ "type": "null" } ], - "title": "Index Node Hash" + "title": "Index Node Hash", + "description": "Hash of the indexed content, used to detect changes." }, "index_node_id": { "anyOf": [ @@ -19674,7 +20111,8 @@ "type": "null" } ], - "title": "Index Node Id" + "title": "Index Node Id", + "description": "ID of the index node in the vector store." }, "indexing_at": { "anyOf": [ @@ -19685,18 +20123,21 @@ "type": "null" } ], - "title": "Indexing At" + "title": "Indexing At", + "description": "Timestamp when indexing started. `null` if not yet started." }, "keywords": { "items": { "type": "string" }, "title": "Keywords", - "type": "array" + "type": "array", + "description": "Keywords associated with this chunk for keyword-based retrieval." }, "position": { "title": "Position", - "type": "integer" + "type": "integer", + "description": "Position of the chunk within the document." }, "sign_content": { "anyOf": [ @@ -19707,11 +20148,13 @@ "type": "null" } ], - "title": "Sign Content" + "title": "Sign Content", + "description": "Signed content hash for integrity verification." }, "status": { "title": "Status", - "type": "string" + "type": "string", + "description": "Indexing status of the chunk." }, "stopped_at": { "anyOf": [ @@ -19722,15 +20165,18 @@ "type": "null" } ], - "title": "Stopped At" + "title": "Stopped At", + "description": "Timestamp when indexing was stopped. `null` if not stopped." }, "tokens": { "title": "Tokens", - "type": "integer" + "type": "integer", + "description": "Token count of the chunk content." }, "word_count": { "title": "Word Count", - "type": "integer" + "type": "integer", + "description": "Word count of the chunk content." } }, "required": [ @@ -19774,32 +20220,37 @@ } ], "default": null, - "title": "Expiration Time" + "title": "Expiration Time", + "description": "Unix timestamp (seconds) after which this form can no longer be submitted." }, "form_content": { "title": "Form Content", - "type": "string" + "type": "string", + "description": "Pre-rendered form body with workflow variables substituted." }, "inputs": { "items": { "$ref": "#/components/schemas/FormInputConfig" }, "title": "Inputs", - "type": "array" + "type": "array", + "description": "Form input field definitions." }, "resolved_default_values": { "additionalProperties": { "type": "string" }, "title": "Resolved Default Values", - "type": "object" + "type": "object", + "description": "Pre-rendered values to display in the form. Keyed by input `output_variable_name`. Populated for `paragraph` inputs whose default resolves from a workflow variable; empty for inputs with no resolvable default. Display these values; do not re-resolve `default` on the client. All values are stringified." }, "user_actions": { "items": { "$ref": "#/components/schemas/UserActionConfig" }, "title": "User Actions", - "type": "array" + "type": "array", + "description": "Available submission actions." } }, "required": [ @@ -19987,19 +20438,23 @@ } ], "default": null, - "title": "Binding Count" + "title": "Binding Count", + "description": "Number of knowledge bases bound to this tag." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Tag identifier." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Tag display name." }, "type": { "title": "Type", - "type": "string" + "type": "string", + "description": "Tag type. Always `knowledge` for knowledge base tags." } }, "required": [ @@ -20087,7 +20542,8 @@ "user" ], "title": "MessageFeedbackPayload", - "type": "object" + "type": "object", + "description": "Request body for submitting message feedback." }, "MessageFile": { "properties": { @@ -20101,16 +20557,19 @@ } ], "default": null, - "title": "Belongs To" + "title": "Belongs To", + "description": "Who this file belongs to. `user` for user-uploaded files, `assistant` for assistant-generated files." }, "filename": { "title": "Filename", - "type": "string" + "type": "string", + "description": "Original filename." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "File ID." }, "mime_type": { "anyOf": [ @@ -20122,7 +20581,8 @@ } ], "default": null, - "title": "Mime Type" + "title": "Mime Type", + "description": "MIME type of the file." }, "size": { "anyOf": [ @@ -20134,15 +20594,18 @@ } ], "default": null, - "title": "Size" + "title": "Size", + "description": "File size in bytes." }, "transfer_method": { "title": "Transfer Method", - "type": "string" + "type": "string", + "description": "Transfer method used. `remote_url` for URL-based files, `local_file` for uploaded files, `tool_file` for tool-generated files." }, "type": { "title": "Type", - "type": "string" + "type": "string", + "description": "File type, e.g., `image`." }, "upload_file_id": { "anyOf": [ @@ -20155,7 +20618,8 @@ } ], "default": null, - "title": "Upload File Id" + "title": "Upload File Id", + "description": "Upload file ID if transferred via `local_file`." }, "url": { "anyOf": [ @@ -20168,7 +20632,8 @@ } ], "default": null, - "title": "Url" + "title": "Url", + "description": "Preview URL for the file." } }, "required": [ @@ -20178,7 +20643,8 @@ "type" ], "title": "MessageFile", - "type": "object" + "type": "object", + "description": "A file attached to a message." }, "MessageInfiniteScrollPagination": { "properties": { @@ -20187,15 +20653,18 @@ "$ref": "#/components/schemas/MessageListItem" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of messages." }, "has_more": { "title": "Has More", - "type": "boolean" + "type": "boolean", + "description": "Whether there are more messages." }, "limit": { "title": "Limit", - "type": "integer" + "type": "integer", + "description": "Number of items per page." } }, "required": [ @@ -20213,21 +20682,25 @@ "$ref": "#/components/schemas/AgentThought" }, "title": "Agent Thoughts", - "type": "array" + "type": "array", + "description": "Agent thoughts for this message." }, "answer": { "title": "Answer", - "type": "string" + "type": "string", + "description": "Assistant answer text." }, "answer_tokens": { "default": 0, "title": "Answer Tokens", - "type": "integer" + "type": "integer", + "description": "Number of tokens in the generated answer." }, "conversation_id": { "format": "uuid", "title": "Conversation Id", - "type": "string" + "type": "string", + "description": "Conversation ID." }, "created_at": { "anyOf": [ @@ -20240,7 +20713,8 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Creation timestamp (Unix epoch seconds)." }, "currency": { "anyOf": [ @@ -20252,7 +20726,8 @@ } ], "default": null, - "title": "Currency" + "title": "Currency", + "description": "Currency for `total_price` (for example, `USD`), or `null` when pricing is unavailable." }, "error": { "anyOf": [ @@ -20264,14 +20739,16 @@ } ], "default": null, - "title": "Error" + "title": "Error", + "description": "Error message if `status` is `error`." }, "extra_contents": { "items": { "$ref": "#/components/schemas/HumanInputContent" }, "title": "Extra Contents", - "type": "array" + "type": "array", + "description": "Additional execution content associated with this message, such as human input form data from Human Input nodes in Chatflow workflows." }, "feedback": { "anyOf": [ @@ -20282,31 +20759,36 @@ "type": "null" } ], - "default": null + "default": null, + "description": "User feedback for this message." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Message ID." }, "inputs": { "additionalProperties": { "$ref": "#/components/schemas/JSONValueType" }, "title": "Inputs", - "type": "object" + "type": "object", + "description": "Input variables for this message." }, "message_files": { "items": { "$ref": "#/components/schemas/MessageFile" }, "title": "Message Files", - "type": "array" + "type": "array", + "description": "Files attached to this message." }, "message_tokens": { "default": 0, "title": "Message Tokens", - "type": "integer" + "type": "integer", + "description": "Number of tokens in the input message." }, "parent_message_id": { "anyOf": [ @@ -20319,28 +20801,33 @@ } ], "default": null, - "title": "Parent Message Id" + "title": "Parent Message Id", + "description": "Parent message ID for threaded conversations." }, "provider_response_latency": { "default": 0, "format": "float", "title": "Provider Response Latency", - "type": "number" + "type": "number", + "description": "Model provider response latency in seconds." }, "query": { "title": "Query", - "type": "string" + "type": "string", + "description": "User query text." }, "retriever_resources": { "items": { "$ref": "#/components/schemas/RetrieverResource" }, "title": "Retriever Resources", - "type": "array" + "type": "array", + "description": "Retriever resources used for this message." }, "status": { "title": "Status", - "type": "string" + "type": "string", + "description": "Message status. `normal` for successful messages, `error` when generation failed." }, "total_price": { "anyOf": [ @@ -20353,12 +20840,14 @@ } ], "default": null, - "title": "Total Price" + "title": "Total Price", + "description": "Total price for the tokens used, or `null` when pricing is unavailable." }, "total_tokens": { "readOnly": true, "title": "Total Tokens", - "type": "integer" + "type": "integer", + "description": "Total tokens used, the sum of `message_tokens` and `answer_tokens`." } }, "required": [ @@ -20633,17 +21122,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Default value configuration for a form input." }, "output_variable_name": { "title": "Output Variable Name", - "type": "string" + "type": "string", + "description": "Variable name where the input value is stored." }, "type": { "const": "paragraph", "default": "paragraph", "title": "Type", - "type": "string" + "type": "string", + "description": "`paragraph`, a multi-line text input." } }, "required": [ @@ -20657,10 +21149,12 @@ "annotation_reply": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "Whether this feature is enabled." } }, - "type": "object" + "type": "object", + "description": "Annotation reply feature configuration." }, "file_upload": { "properties": { @@ -20699,19 +21193,23 @@ "image": { "properties": { "detail": { - "type": "string" + "type": "string", + "description": "Image detail level for vision models." }, "enabled": { - "type": "boolean" + "type": "boolean", + "description": "Whether image upload is enabled." }, "number_limits": { - "type": "integer" + "type": "integer", + "description": "Maximum number of images that can be uploaded." }, "transfer_methods": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "Allowed transfer methods for image upload. `remote_url` for file URL, `local_file` for uploaded file." } }, "type": "object" @@ -20720,15 +21218,18 @@ "type": "integer" } }, - "type": "object" + "type": "object", + "description": "File upload configuration." }, "more_like_this": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "Whether this feature is enabled." } }, - "type": "object" + "type": "object", + "description": "More-like-this feature configuration." }, "opening_statement": { "anyOf": [ @@ -20740,46 +21241,56 @@ } ], "default": null, - "title": "Opening Statement" + "title": "Opening Statement", + "description": "Opening statement text." }, "retriever_resource": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "Whether this feature is enabled." } }, - "type": "object" + "type": "object", + "description": "Knowledge retrieval citation resource configuration." }, "sensitive_word_avoidance": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "Whether this feature is enabled." } }, - "type": "object" + "type": "object", + "description": "Content moderation feature configuration." }, "speech_to_text": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "Whether this feature is enabled." } }, - "type": "object" + "type": "object", + "description": "Speech-to-text feature configuration." }, "suggested_questions": { "items": { "type": "string" }, "title": "Suggested Questions", - "type": "array" + "type": "array", + "description": "List of suggested questions." }, "suggested_questions_after_answer": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "Whether this feature is enabled." } }, - "type": "object" + "type": "object", + "description": "Configuration for suggested questions after an answer." }, "system_parameters": { "$ref": "#/components/schemas/SystemParameters" @@ -20787,19 +21298,24 @@ "text_to_speech": { "properties": { "autoPlay": { - "type": "string" + "type": "string", + "description": "Auto-play setting. `enabled` to auto-play audio, `disabled` to require manual play." }, "enabled": { - "type": "boolean" + "type": "boolean", + "description": "Whether this feature is enabled." }, "language": { - "type": "string" + "type": "string", + "description": "Language for TTS." }, "voice": { - "type": "string" + "type": "string", + "description": "Voice identifier for TTS." } }, - "type": "object" + "type": "object", + "description": "Text-to-speech feature configuration." }, "user_input_form": { "items": { @@ -20852,7 +21368,9 @@ "additionalProperties": true, "type": "object" }, - "default": {}, + "default": { + "description": "Default value for the input field." + }, "description": { "type": "string" }, @@ -20871,7 +21389,8 @@ ] }, "label": { - "type": "string" + "type": "string", + "description": "Display label for the input field." }, "max_length": { "anyOf": [ @@ -20890,7 +21409,8 @@ "type": "array" }, "required": { - "type": "boolean" + "type": "boolean", + "description": "Whether this field is required." }, "type": { "enum": [ @@ -20907,7 +21427,8 @@ "type": "string" }, "variable": { - "type": "string" + "type": "string", + "description": "Variable name used in the workflow." } }, "required": [ @@ -20920,7 +21441,8 @@ "required": [ "text-input" ], - "type": "object" + "type": "object", + "title": "Text Input" }, { "additionalProperties": false, @@ -20970,7 +21492,9 @@ "additionalProperties": true, "type": "object" }, - "default": {}, + "default": { + "description": "Default selected value." + }, "description": { "type": "string" }, @@ -20989,7 +21513,8 @@ ] }, "label": { - "type": "string" + "type": "string", + "description": "Display label for the select field." }, "max_length": { "anyOf": [ @@ -21005,10 +21530,12 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "List of selectable values for this form control." }, "required": { - "type": "boolean" + "type": "boolean", + "description": "Whether this field is required." }, "type": { "enum": [ @@ -21025,7 +21552,8 @@ "type": "string" }, "variable": { - "type": "string" + "type": "string", + "description": "Variable name used in the workflow." } }, "required": [ @@ -21038,7 +21566,8 @@ "required": [ "select" ], - "type": "object" + "type": "object", + "title": "Select" }, { "additionalProperties": false, @@ -21088,7 +21617,9 @@ "additionalProperties": true, "type": "object" }, - "default": {}, + "default": { + "description": "Default value for the paragraph field." + }, "description": { "type": "string" }, @@ -21107,7 +21638,8 @@ ] }, "label": { - "type": "string" + "type": "string", + "description": "Display label for the paragraph field." }, "max_length": { "anyOf": [ @@ -21126,7 +21658,8 @@ "type": "array" }, "required": { - "type": "boolean" + "type": "boolean", + "description": "Whether this field is required." }, "type": { "enum": [ @@ -21143,7 +21676,8 @@ "type": "string" }, "variable": { - "type": "string" + "type": "string", + "description": "Variable name used in the workflow." } }, "required": [ @@ -21156,7 +21690,8 @@ "required": [ "paragraph" ], - "type": "object" + "type": "object", + "title": "Paragraph" }, { "additionalProperties": false, @@ -21870,7 +22405,8 @@ "type": "object" }, "title": "User Input Form", - "type": "array" + "type": "array", + "description": "User input form configuration." } }, "required": [ @@ -22178,19 +22714,23 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Upload timestamp in ISO 8601 format. May be `null` while the record is being created." }, "created_by": { "title": "Created By", - "type": "string" + "type": "string", + "description": "ID of the user who uploaded the file." }, "extension": { "title": "Extension", - "type": "string" + "type": "string", + "description": "File extension." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Unique identifier of the uploaded file." }, "mime_type": { "anyOf": [ @@ -22202,15 +22742,18 @@ } ], "default": null, - "title": "Mime Type" + "title": "Mime Type", + "description": "MIME type of the file. May be `null` if the upload did not include one." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Original file name." }, "size": { "title": "Size", - "type": "integer" + "type": "integer", + "description": "File size in bytes." } }, "required": [ @@ -22289,7 +22832,8 @@ "deprecated": { "default": false, "title": "Deprecated", - "type": "boolean" + "type": "boolean", + "description": "Whether the model is deprecated." }, "features": { "anyOf": [ @@ -22304,7 +22848,8 @@ } ], "default": null, - "title": "Features" + "title": "Features", + "description": "Supported features of the model, `null` if none." }, "fetch_from": { "$ref": "#/components/schemas/FetchFrom" @@ -22312,7 +22857,8 @@ "has_invalid_load_balancing_configs": { "default": false, "title": "Has Invalid Load Balancing Configs", - "type": "boolean" + "type": "boolean", + "description": "Whether the model has invalid load-balancing configurations." }, "label": { "$ref": "#/components/schemas/I18nObject" @@ -22320,11 +22866,13 @@ "load_balancing_enabled": { "default": false, "title": "Load Balancing Enabled", - "type": "boolean" + "type": "boolean", + "description": "Whether load balancing is enabled for the model." }, "model": { "title": "Model", - "type": "string" + "type": "string", + "description": "Model identifier. Use this as the `embedding_model` value when creating or updating a knowledge base." }, "model_properties": { "additionalProperties": true, @@ -22332,7 +22880,8 @@ "$ref": "#/components/schemas/ModelPropertyKey" }, "title": "Model Properties", - "type": "object" + "type": "object", + "description": "Model-specific properties such as `context_size`." }, "model_type": { "$ref": "#/components/schemas/ModelType" @@ -22359,7 +22908,8 @@ "$ref": "#/components/schemas/ProviderWithModelsResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of model providers with their available models." } }, "required": [ @@ -22380,7 +22930,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "URL of the provider's small icon." }, "icon_small_dark": { "anyOf": [ @@ -22391,7 +22942,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Dark-mode icon URLs; `null` when the provider has none." }, "label": { "$ref": "#/components/schemas/I18nObject" @@ -22401,18 +22953,21 @@ "$ref": "#/components/schemas/ProviderModelWithStatusEntity" }, "title": "Models", - "type": "array" + "type": "array", + "description": "List of available models from this provider." }, "provider": { "title": "Provider", - "type": "string" + "type": "string", + "description": "Model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). Legacy providers may return the bare short form (e.g. `openai`)." }, "status": { "$ref": "#/components/schemas/CustomConfigurationStatus" }, "tenant_id": { "title": "Tenant Id", - "type": "string" + "type": "string", + "description": "Workspace ID the provider configuration belongs to." } }, "required": [ @@ -22499,7 +23054,8 @@ "properties": { "result": { "title": "Result", - "type": "string" + "type": "string", + "description": "Operation result. Always `success`." } }, "required": [ @@ -22585,11 +23141,13 @@ "properties": { "extension": { "title": "Extension", - "type": "string" + "type": "string", + "description": "File extension." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Attachment file identifier." }, "mime_type": { "anyOf": [ @@ -22600,19 +23158,23 @@ "type": "null" } ], - "title": "Mime Type" + "title": "Mime Type", + "description": "MIME type of the file." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Original file name." }, "size": { "title": "Size", - "type": "integer" + "type": "integer", + "description": "File size in bytes." }, "source_url": { "title": "Source Url", - "type": "string" + "type": "string", + "description": "URL to access the attachment." } }, "required": [ @@ -22693,11 +23255,13 @@ "$ref": "#/components/schemas/SegmentResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of created chunks." }, "doc_form": { "title": "Doc Form", - "type": "string" + "type": "string", + "description": "Document chunking mode used by this document." } }, "required": [ @@ -22732,7 +23296,8 @@ }, "doc_form": { "title": "Doc Form", - "type": "string" + "type": "string", + "description": "Document chunking mode used by this document." } }, "required": [ @@ -22790,27 +23355,33 @@ "$ref": "#/components/schemas/SegmentResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of chunks." }, "doc_form": { "title": "Doc Form", - "type": "string" + "type": "string", + "description": "Document chunking mode used by this document." }, "has_more": { "title": "Has More", - "type": "boolean" + "type": "boolean", + "description": "Whether more items exist on the next page." }, "limit": { "title": "Limit", - "type": "integer" + "type": "integer", + "description": "Number of items per page." }, "page": { "title": "Page", - "type": "integer" + "type": "integer", + "description": "Current page number." }, "total": { "title": "Total", - "type": "integer" + "type": "integer", + "description": "Total number of matching chunks." } }, "required": [ @@ -22835,21 +23406,24 @@ "type": "null" } ], - "title": "Answer" + "title": "Answer", + "description": "Answer content, used in Q&A mode documents." }, "attachments": { "items": { "$ref": "#/components/schemas/SegmentAttachmentResponse" }, "title": "Attachments", - "type": "array" + "type": "array", + "description": "Files attached to this chunk." }, "child_chunks": { "items": { "$ref": "#/components/schemas/ChildChunkResponse" }, "title": "Child Chunks", - "type": "array" + "type": "array", + "description": "Child chunks belonging to this chunk. Only present for hierarchical mode documents." }, "completed_at": { "anyOf": [ @@ -22860,19 +23434,23 @@ "type": "null" } ], - "title": "Completed At" + "title": "Completed At", + "description": "Timestamp when indexing completed. `null` if not yet completed." }, "content": { "title": "Content", - "type": "string" + "type": "string", + "description": "Text content of the chunk." }, "created_at": { "title": "Created At", - "type": "integer" + "type": "integer", + "description": "Creation timestamp (Unix epoch in seconds)." }, "created_by": { "title": "Created By", - "type": "string" + "type": "string", + "description": "ID of the user who created the chunk." }, "disabled_at": { "anyOf": [ @@ -22883,7 +23461,8 @@ "type": "null" } ], - "title": "Disabled At" + "title": "Disabled At", + "description": "Timestamp when the chunk was disabled. `null` if enabled." }, "disabled_by": { "anyOf": [ @@ -22894,15 +23473,18 @@ "type": "null" } ], - "title": "Disabled By" + "title": "Disabled By", + "description": "ID of the user who disabled the chunk. `null` if enabled." }, "document_id": { "title": "Document Id", - "type": "string" + "type": "string", + "description": "ID of the document this chunk belongs to." }, "enabled": { "title": "Enabled", - "type": "boolean" + "type": "boolean", + "description": "Whether the chunk is enabled for retrieval." }, "error": { "anyOf": [ @@ -22913,15 +23495,18 @@ "type": "null" } ], - "title": "Error" + "title": "Error", + "description": "Error message if indexing failed. `null` when no error." }, "hit_count": { "title": "Hit Count", - "type": "integer" + "type": "integer", + "description": "Number of times this chunk has been matched in retrieval queries." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Unique identifier of the chunk." }, "index_node_hash": { "anyOf": [ @@ -22932,7 +23517,8 @@ "type": "null" } ], - "title": "Index Node Hash" + "title": "Index Node Hash", + "description": "Hash of the indexed content, used to detect changes." }, "index_node_id": { "anyOf": [ @@ -22943,7 +23529,8 @@ "type": "null" } ], - "title": "Index Node Id" + "title": "Index Node Id", + "description": "ID of the index node in the vector store." }, "indexing_at": { "anyOf": [ @@ -22954,7 +23541,8 @@ "type": "null" } ], - "title": "Indexing At" + "title": "Indexing At", + "description": "Timestamp when indexing started. `null` if not yet started." }, "keywords": { "anyOf": [ @@ -22968,19 +23556,23 @@ "type": "null" } ], - "title": "Keywords" + "title": "Keywords", + "description": "Keywords associated with this chunk for keyword-based retrieval." }, "position": { "title": "Position", - "type": "integer" + "type": "integer", + "description": "Position of the chunk within the document." }, "sign_content": { "title": "Sign Content", - "type": "string" + "type": "string", + "description": "Signed content hash for integrity verification." }, "status": { "title": "Status", - "type": "string" + "type": "string", + "description": "Current indexing status of the chunk, e.g. `completed`, `indexing`, `error`." }, "stopped_at": { "anyOf": [ @@ -22991,7 +23583,8 @@ "type": "null" } ], - "title": "Stopped At" + "title": "Stopped At", + "description": "Timestamp when indexing was stopped. `null` if not stopped." }, "summary": { "anyOf": [ @@ -23002,15 +23595,18 @@ "type": "null" } ], - "title": "Summary" + "title": "Summary", + "description": "AI-generated summary of the chunk content. `null` if summary indexing is not enabled." }, "tokens": { "title": "Tokens", - "type": "integer" + "type": "integer", + "description": "Token count of the chunk content." }, "updated_at": { "title": "Updated At", - "type": "integer" + "type": "integer", + "description": "Last update timestamp (Unix epoch in seconds)." }, "updated_by": { "anyOf": [ @@ -23021,11 +23617,13 @@ "type": "null" } ], - "title": "Updated By" + "title": "Updated By", + "description": "ID of the user who last updated the chunk." }, "word_count": { "title": "Word Count", - "type": "integer" + "type": "integer", + "description": "Word count of the chunk content." } }, "required": [ @@ -23198,17 +23796,20 @@ "SelectInputConfig": { "properties": { "option_source": { - "$ref": "#/components/schemas/StringListSource" + "$ref": "#/components/schemas/StringListSource", + "description": "Options for this select input. `constant` uses `value`; `variable` uses the workflow variable referenced by `selector`." }, "output_variable_name": { "title": "Output Variable Name", - "type": "string" + "type": "string", + "description": "Variable name used to reference this input's submitted value inside the workflow." }, "type": { "const": "select", "default": "select", "title": "Type", - "type": "string" + "type": "string", + "description": "`select`, a single-choice input." } }, "required": [ @@ -23222,15 +23823,18 @@ "properties": { "email": { "title": "Email", - "type": "string" + "type": "string", + "description": "Account email address." }, "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "Account ID." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Account display name." } }, "required": [ @@ -23254,19 +23858,22 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Creation timestamp." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Conversation ID." }, "inputs": { "additionalProperties": { "$ref": "#/components/schemas/JSONValue" }, "title": "Inputs", - "type": "object" + "type": "object", + "description": "Input variables for the conversation." }, "introduction": { "anyOf": [ @@ -23278,15 +23885,18 @@ } ], "default": null, - "title": "Introduction" + "title": "Introduction", + "description": "Conversation introduction." }, "name": { "title": "Name", - "type": "string" + "type": "string", + "description": "Conversation name." }, "status": { "title": "Status", - "type": "string" + "type": "string", + "description": "Conversation status. `normal` for active conversations." }, "updated_at": { "anyOf": [ @@ -23299,7 +23909,8 @@ } ], "default": null, - "title": "Updated At" + "title": "Updated At", + "description": "Last update timestamp." } }, "required": [ @@ -23315,11 +23926,13 @@ "properties": { "id": { "title": "Id", - "type": "string" + "type": "string", + "description": "End user ID." }, "is_anonymous": { "title": "Is Anonymous", - "type": "boolean" + "type": "boolean", + "description": "Whether the end user is anonymous." }, "session_id": { "anyOf": [ @@ -23331,11 +23944,13 @@ } ], "default": null, - "title": "Session Id" + "title": "Session Id", + "description": "Session identifier." }, "type": { "title": "Type", - "type": "string" + "type": "string", + "description": "End user type." } }, "required": [ @@ -23358,7 +23973,8 @@ } ], "default": null, - "title": "Rating" + "title": "Rating", + "description": "Feedback rating. `like` for positive, `dislike` for negative." } }, "title": "SimpleFeedback", @@ -23384,11 +24000,13 @@ "type": "string" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of suggested questions." }, "result": { "title": "Result", - "type": "string" + "type": "string", + "description": "Result status." } }, "required": [ @@ -23410,11 +24028,13 @@ } ], "default": null, - "title": "Chat Color Theme" + "title": "Chat Color Theme", + "description": "Chat color theme." }, "chat_color_theme_inverted": { "title": "Chat Color Theme Inverted", - "type": "boolean" + "type": "boolean", + "description": "Whether the chat color theme is inverted." }, "copyright": { "anyOf": [ @@ -23426,7 +24046,8 @@ } ], "default": null, - "title": "Copyright" + "title": "Copyright", + "description": "Copyright text." }, "custom_disclaimer": { "anyOf": [ @@ -23438,11 +24059,13 @@ } ], "default": null, - "title": "Custom Disclaimer" + "title": "Custom Disclaimer", + "description": "Custom disclaimer text." }, "default_language": { "title": "Default Language", - "type": "string" + "type": "string", + "description": "Default language code." }, "description": { "anyOf": [ @@ -23454,7 +24077,8 @@ } ], "default": null, - "title": "Description" + "title": "Description", + "description": "Web app description." }, "icon": { "anyOf": [ @@ -23466,7 +24090,8 @@ } ], "default": null, - "title": "Icon" + "title": "Icon", + "description": "Icon content (emoji or image ID)." }, "icon_background": { "anyOf": [ @@ -23478,7 +24103,8 @@ } ], "default": null, - "title": "Icon Background" + "title": "Icon Background", + "description": "Icon background color." }, "icon_type": { "anyOf": [ @@ -23490,7 +24116,8 @@ } ], "default": null, - "title": "Icon Type" + "title": "Icon Type", + "description": "Type of icon used. `emoji` for emoji icons, `image` for uploaded image icons." }, "icon_url": { "anyOf": [ @@ -23503,7 +24130,8 @@ } ], "readOnly": true, - "title": "Icon Url" + "title": "Icon Url", + "description": "URL of the icon image." }, "input_placeholder": { "anyOf": [ @@ -23515,7 +24143,8 @@ } ], "default": null, - "title": "Input Placeholder" + "title": "Input Placeholder", + "description": "Placeholder text shown in the web app message input box. `null` when not configured." }, "privacy_policy": { "anyOf": [ @@ -23527,19 +24156,23 @@ } ], "default": null, - "title": "Privacy Policy" + "title": "Privacy Policy", + "description": "Privacy policy URL." }, "show_workflow_steps": { "title": "Show Workflow Steps", - "type": "boolean" + "type": "boolean", + "description": "Whether to show workflow steps." }, "title": { "title": "Title", - "type": "string" + "type": "string", + "description": "Web app title." }, "use_icon_as_answer_icon": { "title": "Use Icon As Answer Icon", - "type": "boolean" + "type": "boolean", + "description": "Whether to use the app icon as the answer icon." } }, "required": [ @@ -23560,17 +24193,20 @@ "type": "string" }, "title": "Selector", - "type": "array" + "type": "array", + "description": "Workflow variable selector used when `type` is `variable`." }, "type": { - "$ref": "#/components/schemas/ValueSourceType" + "$ref": "#/components/schemas/ValueSourceType", + "description": "`constant` uses `value`; `variable` uses the workflow variable referenced by `selector`." }, "value": { "items": { "type": "string" }, "title": "Value", - "type": "array" + "type": "array", + "description": "Static option list used when `type` is `constant`." } }, "required": [ @@ -23587,15 +24223,18 @@ "type": "string" }, "title": "Selector", - "type": "array" + "type": "array", + "description": "Variable selector path when `type` is `variable`." }, "type": { - "$ref": "#/components/schemas/ValueSourceType" + "$ref": "#/components/schemas/ValueSourceType", + "description": "`constant` uses `value`; `variable` uses the workflow variable referenced by `selector`." }, "value": { "default": "", "title": "Value", - "type": "string" + "type": "string", + "description": "Static value when `type` is `constant`." } }, "required": [ @@ -23608,23 +24247,28 @@ "properties": { "audio_file_size_limit": { "title": "Audio File Size Limit", - "type": "integer" + "type": "integer", + "description": "Maximum audio file size in MB." }, "file_size_limit": { "title": "File Size Limit", - "type": "integer" + "type": "integer", + "description": "Maximum general file size in MB." }, "image_file_size_limit": { "title": "Image File Size Limit", - "type": "integer" + "type": "integer", + "description": "Maximum image file size in MB." }, "video_file_size_limit": { "title": "Video File Size Limit", - "type": "integer" + "type": "integer", + "description": "Maximum video file size in MB." }, "workflow_file_upload_limit": { "title": "Workflow File Upload Limit", - "type": "integer" + "type": "integer", + "description": "Maximum number of files per workflow execution." } }, "required": [ @@ -23900,7 +24544,8 @@ } }, "title": "TextToAudioPayload", - "type": "object" + "type": "object", + "description": "Request body for text-to-audio conversion. Provide either `message_id` or `text`." }, "ToolIcon": { "properties": { @@ -23924,7 +24569,8 @@ "properties": { "url": { "title": "Url", - "type": "string" + "type": "string", + "description": "Signed URL to download the original uploaded file." } }, "required": [ @@ -23938,18 +24584,21 @@ "properties": { "button_style": { "$ref": "#/components/schemas/ButtonStyle", - "default": "default" + "default": "default", + "description": "Button style: `primary`, `default`, `accent`, or `ghost`." }, "id": { "maxLength": 20, "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "title": "Id", - "type": "string" + "type": "string", + "description": "Action button identifier. Send it as `action` when submitting the form." }, "title": { "maxLength": 100, "title": "Title", - "type": "string" + "type": "string", + "description": "Button text shown to the recipient." } }, "required": [ @@ -24063,23 +24712,28 @@ "$ref": "#/components/schemas/WorkflowAppLogPartialResponse" }, "title": "Data", - "type": "array" + "type": "array", + "description": "List of workflow log entries." }, "has_more": { "title": "Has More", - "type": "boolean" + "type": "boolean", + "description": "Whether more pages are available." }, "limit": { "title": "Limit", - "type": "integer" + "type": "integer", + "description": "Number of items per page." }, "page": { "title": "Page", - "type": "integer" + "type": "integer", + "description": "Current page number." }, "total": { "title": "Total", - "type": "integer" + "type": "integer", + "description": "Total number of log entries." } }, "required": [ @@ -24105,7 +24759,8 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Unix timestamp of when the log entry was created." }, "created_by_account": { "anyOf": [ @@ -24116,7 +24771,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Account details if created by an admin user." }, "created_by_end_user": { "anyOf": [ @@ -24139,7 +24795,8 @@ } ], "default": null, - "title": "Created By Role" + "title": "Created By Role", + "description": "Role of the creator (e.g., `end_user`, `account`)." }, "created_from": { "anyOf": [ @@ -24151,7 +24808,8 @@ } ], "default": null, - "title": "Created From" + "title": "Created From", + "description": "Source of the workflow run (e.g., `service-api`)." }, "details": { "anyOf": [ @@ -24180,12 +24838,14 @@ } ], "default": null, - "title": "Details" + "title": "Details", + "description": "Additional details for the log entry." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Log entry ID." }, "workflow_run": { "anyOf": [ @@ -24237,12 +24897,14 @@ "created_at": { "format": "int64", "title": "Created At", - "type": "integer" + "type": "integer", + "description": "Unix timestamp of when the workflow run was created." }, "elapsed_time": { "format": "float", "title": "Elapsed Time", - "type": "number" + "type": "number", + "description": "Total time elapsed in seconds." }, "error": { "anyOf": [ @@ -24253,7 +24915,8 @@ "type": "null" } ], - "title": "Error" + "title": "Error", + "description": "Error message if the workflow failed." }, "finished_at": { "anyOf": [ @@ -24265,12 +24928,14 @@ "type": "null" } ], - "title": "Finished At" + "title": "Finished At", + "description": "Unix timestamp of when the workflow run finished." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Workflow run ID." }, "outputs": { "anyOf": [ @@ -24282,7 +24947,8 @@ "type": "null" } ], - "title": "Outputs" + "title": "Outputs", + "description": "Output data from the workflow." }, "status": { "enum": [ @@ -24292,20 +24958,24 @@ "succeeded" ], "title": "Status", - "type": "string" + "type": "string", + "description": "Workflow execution status. `running` for in-progress executions, `succeeded` when completed successfully, `failed` when execution encountered an error, `stopped` when manually halted, `partial-succeeded` when some nodes succeeded but others failed, `paused` when awaiting human input." }, "total_steps": { "title": "Total Steps", - "type": "integer" + "type": "integer", + "description": "Total number of workflow steps executed." }, "total_tokens": { "title": "Total Tokens", - "type": "integer" + "type": "integer", + "description": "Total tokens consumed across all nodes." }, "workflow_id": { "format": "uuid", "title": "Workflow Id", - "type": "string" + "type": "string", + "description": "Workflow ID." } }, "required": [ @@ -24332,12 +25002,14 @@ "task_id": { "format": "uuid", "title": "Task Id", - "type": "string" + "type": "string", + "description": "Task ID for the in-progress execution. Use this with [Stop Workflow Task](/en/api-reference/workflow-runs/stop-workflow-task) to cancel a running workflow. Only valid during execution." }, "workflow_run_id": { "format": "uuid", "title": "Workflow Run Id", - "type": "string" + "type": "string", + "description": "Persistent identifier for this workflow run record. Use this with [Get Workflow Run Detail](/en/api-reference/workflow-runs/get-workflow-run-detail) to retrieve results after execution." } }, "required": [ @@ -24735,7 +25407,8 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Unix timestamp of when the workflow run was created." }, "elapsed_time": { "anyOf": [ @@ -24751,7 +25424,8 @@ } ], "default": null, - "title": "Elapsed Time" + "title": "Elapsed Time", + "description": "Total time elapsed in seconds." }, "error": { "anyOf": [ @@ -24763,7 +25437,8 @@ } ], "default": null, - "title": "Error" + "title": "Error", + "description": "Error message if the workflow failed." }, "exceptions_count": { "anyOf": [ @@ -24775,7 +25450,8 @@ } ], "default": null, - "title": "Exceptions Count" + "title": "Exceptions Count", + "description": "Number of exceptions that occurred during execution." }, "finished_at": { "anyOf": [ @@ -24788,12 +25464,14 @@ } ], "default": null, - "title": "Finished At" + "title": "Finished At", + "description": "Unix timestamp of when the workflow run finished." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Workflow run ID." }, "status": { "anyOf": [ @@ -24805,7 +25483,8 @@ } ], "default": null, - "title": "Status" + "title": "Status", + "description": "Workflow execution status. `running` for in-progress executions, `succeeded` when completed successfully, `failed` when execution encountered an error, `stopped` when manually halted, `partial-succeeded` when some nodes succeeded but others failed, `paused` when awaiting human input." }, "total_steps": { "anyOf": [ @@ -24817,7 +25496,8 @@ } ], "default": null, - "title": "Total Steps" + "title": "Total Steps", + "description": "Total number of workflow steps executed." }, "total_tokens": { "anyOf": [ @@ -24829,7 +25509,8 @@ } ], "default": null, - "title": "Total Tokens" + "title": "Total Tokens", + "description": "Total tokens consumed." }, "triggered_from": { "anyOf": [ @@ -24841,7 +25522,8 @@ } ], "default": null, - "title": "Triggered From" + "title": "Triggered From", + "description": "Source that triggered the workflow run. `app-run` for runs started from the app or API, `webhook` for runs started by a webhook trigger, `schedule` for runs started by a schedule trigger, `plugin` for runs started by an integration trigger." }, "version": { "anyOf": [ @@ -24853,7 +25535,8 @@ } ], "default": null, - "title": "Version" + "title": "Version", + "description": "Workflow version identifier." } }, "required": [ @@ -25316,7 +25999,8 @@ } ], "default": null, - "title": "Created At" + "title": "Created At", + "description": "Unix timestamp of when the workflow run was created." }, "elapsed_time": { "anyOf": [ @@ -25332,7 +26016,8 @@ } ], "default": null, - "title": "Elapsed Time" + "title": "Elapsed Time", + "description": "Total time elapsed in seconds." }, "error": { "anyOf": [ @@ -25344,7 +26029,8 @@ } ], "default": null, - "title": "Error" + "title": "Error", + "description": "Error message if the workflow failed." }, "finished_at": { "anyOf": [ @@ -25357,12 +26043,14 @@ } ], "default": null, - "title": "Finished At" + "title": "Finished At", + "description": "Unix timestamp of when the workflow run finished." }, "id": { "format": "uuid", "title": "Id", - "type": "string" + "type": "string", + "description": "Workflow run ID." }, "inputs": { "anyOf": [ @@ -25391,16 +26079,19 @@ } ], "default": null, - "title": "Inputs" + "title": "Inputs", + "description": "Input variables of the workflow run. Depending on the storage backend, the value can be decoded JSON or a JSON-encoded string such as `{\"query\": \"...\"}`; parse it when it is a string. May be `null`." }, "outputs": { "additionalProperties": true, "title": "Outputs", - "type": "object" + "type": "object", + "description": "Output data from the workflow. An empty object until outputs are available." }, "status": { "title": "Status", - "type": "string" + "type": "string", + "description": "Workflow execution status. `running` for in-progress executions, `succeeded` when completed successfully, `failed` when execution encountered an error, `stopped` when manually halted, `partial-succeeded` when some nodes succeeded but others failed, `paused` when awaiting human input." }, "total_steps": { "anyOf": [ @@ -25412,7 +26103,8 @@ } ], "default": null, - "title": "Total Steps" + "title": "Total Steps", + "description": "Total number of workflow steps executed." }, "total_tokens": { "anyOf": [ @@ -25424,12 +26116,14 @@ } ], "default": null, - "title": "Total Tokens" + "title": "Total Tokens", + "description": "Total tokens consumed." }, "workflow_id": { "format": "uuid", "title": "Workflow Id", - "type": "string" + "type": "string", + "description": "Workflow ID." } }, "required": [ diff --git a/ja/api-reference/openapi_service.json b/ja/api-reference/openapi_service.json index c883ffceea..f619865f5e 100644 --- a/ja/api-reference/openapi_service.json +++ b/ja/api-reference/openapi_service.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Dify サービス API", - "description": "Dify アプリケーションとナレッジベースのための REST API です。アプリケーション系エンドポイントはアプリの API キーで、ナレッジ系エンドポイントはナレッジベースの API キーで認証します。", + "description": "Dify アプリケーションとナレッジベースのための REST API です。公開済みアプリ内でアプリ API キーを作成するか、**ナレッジ > サービス API** からナレッジベース API キーを作成します。API はバックエンドから呼び出し、すべてのリクエストで `Authorization: Bearer {API_KEY}` としてキーを送信してください。\n\nDify Cloud のベース URL は `https://api.dify.ai/v1` です。セルフホスト環境では、そのデプロイのサービス API ベース URL を使用します。次のコマンドでアプリ API キーを確認できます。\n\n```bash\ncurl https://api.dify.ai/v1/info \\\n -H \"Authorization: Bearer $DIFY_API_KEY\"\n```\n\nナレッジベース API キーの場合は、同じ認証方法で `GET /datasets` を呼び出します。アプリの場合は、`GET /info` が返す `mode` から主要エンドポイントを選択します。`chat`(チャットボット)、`agent-chat`(Agent)、`advanced-chat`(Chatflow)、`agent`(新しい Agent)は `POST /chat-messages`、`completion`(テキストジェネレーター)は `POST /completion-messages`、`workflow`(Workflow)は `POST /workflows/run` を使用します。`GET /parameters` を呼び出すと、アプリに設定された入力変数を確認できます。完全な設定手順は [クイックスタート](/ja/api-reference/guides/get-started) を参照してください。", "version": "1.0.0" }, "servers": [ @@ -461,7 +461,7 @@ "/chat-messages/{task_id}/stop": { "post": { "summary": "生成を停止", - "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\nチャットメッセージ生成タスクを停止します。`streaming` モードでのみサポートされます。", + "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\nチャットメッセージ生成タスクを停止します。`streaming` モードでのみサポートされます。\n\nチャットボット、Agent、新しい Agent では、`user` をタスク開始時に使用した識別子と一致させる必要があります。一致しない場合、タスクは実行を続けますが、エンドポイントは成功を返します。", "operationId": "stop_chat_message", "tags": [ "チャットメッセージ" @@ -501,6 +501,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SimpleResultResponse" + }, + "examples": { + "success": { + "summary": "レスポンス例", + "value": { + "result": "success" + } + } } } }, @@ -1105,6 +1113,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ResultResponse" + }, + "examples": { + "success": { + "summary": "レスポンス例", + "value": { + "result": "success" + } + } } } }, @@ -2140,13 +2156,15 @@ "type": "string" }, "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" } }, "required": [ "file" ], - "type": "object" + "type": "object", + "description": "音声からテキストへの変換のリクエストボディ。" } } } @@ -4621,6 +4639,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SimpleResultResponse" + }, + "examples": { + "success": { + "summary": "レスポンス例", + "value": { + "result": "success" + } + } } } }, @@ -4911,7 +4937,7 @@ "/completion-messages/{task_id}/stop": { "post": { "summary": "生成を停止", - "description": "**対象アプリ**:テキストジェネレーター。\n\nテキスト生成メッセージ生成タスクを停止します。`streaming` モードでのみサポートされています。", + "description": "**対象アプリ**:テキストジェネレーター。\n\nテキスト生成メッセージ生成タスクを停止します。`streaming` モードでのみサポートされています。\n\n`user` は、タスク開始時に使用した識別子と一致する必要があります。一致しない場合、タスクは実行を続けますが、エンドポイントは成功を返します。", "operationId": "stop_completion", "tags": [ "完了メッセージ" @@ -4951,6 +4977,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SimpleResultResponse" + }, + "examples": { + "success": { + "summary": "レスポンス例", + "value": { + "result": "success" + } + } } } }, @@ -6602,7 +6636,7 @@ "ドキュメント" ], "summary": "ドキュメントを更新", - "description": "新しいファイルをアップロードしてドキュメントを更新し、再インデックスします。これはファイルベースのドキュメント更新の正規エンドポイントです。返された `batch` ID を使って [ドキュメント埋め込みステータス(進捗)を取得](/ja/api-reference/documents/get-document-indexing-status) で進捗を追跡します。", + "description": "ファイルベースのドキュメントを更新し、再インデックスします。置換用の `file`、または `process_rule` を含む `data` のどちらかが必要です。処理設定も変更する場合は、`file` と `data` を同時に指定できます。返された `batch` ID を使って [ドキュメント埋め込みステータス(進捗)を取得](/ja/api-reference/documents/get-document-indexing-status) で進捗を追跡します。", "operationId": "update_document_by_file", "parameters": [ { @@ -7323,7 +7357,7 @@ "ドキュメント" ], "summary": "ファイルでドキュメントを更新", - "description": "非推奨です。代わりに [ドキュメントを更新](/ja/api-reference/documents/update-document) を使用してください。新しいファイルをアップロードしてドキュメントを更新し、再インデックスします。", + "description": "非推奨です。代わりに [ドキュメントを更新](/ja/api-reference/documents/update-document) を使用してください。置換用の `file`、または `process_rule` を含む `data` のどちらかが必要です。処理設定も変更する場合は、`file` と `data` を同時に指定できます。更新後にドキュメントが再インデックスされます。", "operationId": "update_document_by_file_deprecated", "parameters": [ { @@ -12323,9 +12357,16 @@ "default": null }, "summary": { - "type": "string", - "nullable": true, - "description": "チャンクコンテンツの要約。" + "description": "チャンクコンテンツの要約。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "created_at": { "description": "作成タイムスタンプ(Unix エポック秒)。", @@ -12436,8 +12477,15 @@ "description": "アプリケーション名。" }, "description": { - "type": "string", - "description": "アプリケーションの説明。" + "description": "アプリケーションの説明。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "tags": { "type": "array", @@ -12776,7 +12824,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "この思考のチェーン ID です。" }, "created_at": { "anyOf": [ @@ -12787,19 +12836,23 @@ "type": "null" } ], - "default": null + "default": null, + "description": "作成タイムスタンプ。" }, "files": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "この思考に関連するファイル ID です。" }, "id": { - "type": "string" + "type": "string", + "description": "エージェント思考 ID です。" }, "message_id": { - "type": "string" + "type": "string", + "description": "この思考が属する一意のメッセージ ID です。" }, "observation": { "anyOf": [ @@ -12810,10 +12863,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ツール呼び出しからのレスポンスです。" }, "position": { - "type": "integer" + "type": "integer", + "description": "この思考の位置です。" }, "thought": { "anyOf": [ @@ -12824,7 +12879,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "LLM が思考している内容です。" }, "tool": { "anyOf": [ @@ -12835,7 +12891,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "呼び出されたツール(`;` で区切り)です。" }, "tool_input": { "anyOf": [ @@ -12846,7 +12903,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ツールの入力(JSON 形式)です。" }, "tool_labels": { "$ref": "#/components/schemas/JSONValue" @@ -12859,7 +12917,8 @@ "position", "tool_labels" ], - "type": "object" + "type": "object", + "description": "メッセージ内のエージェント思考ステップです。" }, "Annotation": { "properties": { @@ -12872,7 +12931,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "アノテーションがマッチした際に返される定義済みの回答です。" }, "created_at": { "anyOf": [ @@ -12884,7 +12944,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "作成タイムスタンプ(Unix エポック秒)。" }, "hit_count": { "anyOf": [ @@ -12895,11 +12956,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このアノテーションがマッチして返信として返された回数です。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "アノテーションの一意識別子です。" }, "question": { "anyOf": [ @@ -12910,7 +12973,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このアノテーションをトリガーする質問テキストです。" } }, "required": [ @@ -12937,14 +13001,17 @@ "properties": { "error_msg": { "default": "", - "type": "string" + "type": "string", + "description": "ジョブが失敗した理由を説明するエラーメッセージです。`job_status` が `error` でない場合は空文字列です。" }, "job_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "[アノテーション返信を設定](/ja/api-reference/annotations/configure-annotation-reply) 呼び出しから取得したジョブ ID です。" }, "job_status": { - "type": "string" + "type": "string", + "description": "現在のジョブステータスです。`waiting` はキュー待ち、`processing` は処理中、`completed` は完了、`error` は失敗を示します。" } }, "required": [ @@ -12957,10 +13024,12 @@ "properties": { "job_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "非同期ジョブ ID です。[アノテーション返信の初期設定タスクステータスを取得](/ja/api-reference/annotations/get-annotation-reply-job-status) と組み合わせて進捗を追跡します。" }, "job_status": { - "type": "string" + "type": "string", + "description": "現在のジョブステータスです。このエンドポイントが返すのは `waiting`(キュー待ち)または `processing`(処理中)のみです。`completed` と `error` は [アノテーション返信の初期設定タスクステータスを取得](/ja/api-reference/annotations/get-annotation-reply-job-status) からのみ返されます。" } }, "required": [ @@ -12975,19 +13044,24 @@ "items": { "$ref": "#/components/schemas/Annotation" }, - "type": "array" + "type": "array", + "description": "現在のページのアノテーション項目のリストです。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "現在の結果セットの後にさらにページがある場合は `true` です。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "1 ページあたりの件数です。" }, "page": { - "type": "integer" + "type": "integer", + "description": "現在のページ番号です。" }, "total": { - "type": "integer" + "type": "integer", + "description": "クエリに一致するアノテーションの合計数です。" } }, "required": [ @@ -13039,7 +13113,8 @@ "embedding_provider_name", "score_threshold" ], - "type": "object" + "type": "object", + "description": "アノテーション返信設定を構成するためのリクエストボディです。" }, "AppFeedbackListResponse": { "properties": { @@ -13047,7 +13122,8 @@ "items": { "$ref": "#/components/schemas/AppFeedbackResponse" }, - "type": "array" + "type": "array", + "description": "フィードバック項目のリスト。" } }, "required": [ @@ -13059,7 +13135,8 @@ "properties": { "app_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "アプリケーション ID。" }, "content": { "anyOf": [ @@ -13070,14 +13147,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "任意のテキストフィードバック。" }, "conversation_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "会話 ID。" }, "created_at": { - "type": "string" + "type": "string", + "description": "作成タイムスタンプ。" }, "from_account_id": { "anyOf": [ @@ -13089,7 +13169,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "フィードバックを送信したアカウント ID。`from_source` が `admin` の場合に存在します。" }, "from_end_user_id": { "anyOf": [ @@ -13101,24 +13182,30 @@ "type": "null" } ], - "default": null + "default": null, + "description": "フィードバックを送信したエンドユーザー ID。`from_source` が `user` の場合に存在します。" }, "from_source": { - "type": "string" + "type": "string", + "description": "フィードバックのソース。API 経由でエンドユーザーが送信したフィードバックの場合は `user`、コンソールから送信されたフィードバックの場合は `admin`。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "フィードバック ID。" }, "message_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "メッセージ ID。" }, "rating": { - "type": "string" + "type": "string", + "description": "フィードバック評価。肯定的な場合は `like`、否定的な場合は `dislike`。" }, "updated_at": { - "type": "string" + "type": "string", + "description": "最終更新タイムスタンプ。" } }, "required": [ @@ -13131,7 +13218,8 @@ "rating", "updated_at" ], - "type": "object" + "type": "object", + "description": "単一のフィードバック項目。" }, "AudioBinaryResponse": { "format": "binary", @@ -13140,7 +13228,8 @@ "AudioTranscriptResponse": { "properties": { "text": { - "type": "string" + "type": "string", + "description": "音声認識からの出力テキスト。" } }, "required": [ @@ -13167,7 +13256,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "使用された検索リソースのリスト。" }, "usage": { "anyOf": [ @@ -13178,7 +13268,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "モデルの使用情報です。" } }, "type": "object" @@ -13195,7 +13286,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "リソースからのコンテンツスニペット。" }, "created_at": { "anyOf": [ @@ -13207,7 +13299,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "作成タイムスタンプ(Unix エポック秒)。" }, "data_source_type": { "anyOf": [ @@ -13218,7 +13311,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "データソースのタイプ。" }, "dataset_id": { "anyOf": [ @@ -13230,7 +13324,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ナレッジベース ID。" }, "dataset_name": { "anyOf": [ @@ -13241,7 +13336,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ナレッジベース名。" }, "document_id": { "anyOf": [ @@ -13253,7 +13349,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメント ID。" }, "document_name": { "anyOf": [ @@ -13264,7 +13361,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメント名。" }, "hit_count": { "anyOf": [ @@ -13275,7 +13373,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このチャンクがヒットした回数。" }, "id": { "anyOf": [ @@ -13287,7 +13386,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "検索リソースの一意の ID。" }, "index_node_hash": { "anyOf": [ @@ -13298,7 +13398,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "インデックスノードのハッシュ。" }, "message_id": { "anyOf": [ @@ -13310,10 +13411,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このリソースが属するメッセージの ID。" }, "position": { - "type": "integer" + "type": "integer", + "description": "リスト内のリソースの位置。" }, "score": { "anyOf": [ @@ -13325,7 +13428,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "リソースの関連性スコア。" }, "segment_id": { "anyOf": [ @@ -13337,7 +13441,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメント内の特定のチャンクの ID。" }, "segment_position": { "anyOf": [ @@ -13348,7 +13453,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメント内のチャンクの位置。" }, "summary": { "anyOf": [ @@ -13359,7 +13465,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "チャンクコンテンツの要約。" }, "word_count": { "anyOf": [ @@ -13370,13 +13477,15 @@ "type": "null" } ], - "default": null + "default": null, + "description": "チャンクの単語数。" } }, "required": [ "position" ], - "type": "object" + "type": "object", + "description": "検索リソースの引用および帰属情報です。" }, "BlockingUsageResponse": { "additionalProperties": true, @@ -13391,7 +13500,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "補完トークンの合計価格。" }, "completion_price_unit": { "anyOf": [ @@ -13403,7 +13513,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "補完トークンの価格単位。" }, "completion_tokens": { "anyOf": [ @@ -13414,7 +13525,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "補完のトークン数。" }, "completion_unit_price": { "anyOf": [ @@ -13426,7 +13538,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "補完トークンあたりの単価。" }, "currency": { "anyOf": [ @@ -13437,7 +13550,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "課金通貨。" }, "latency": { "anyOf": [ @@ -13449,7 +13563,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "レイテンシ(秒)。" }, "prompt_price": { "anyOf": [ @@ -13461,7 +13576,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "プロンプトトークンの合計価格。" }, "prompt_price_unit": { "anyOf": [ @@ -13473,7 +13589,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "プロンプトトークンの価格単位。" }, "prompt_tokens": { "anyOf": [ @@ -13484,7 +13601,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "プロンプト内のトークン数。" }, "prompt_unit_price": { "anyOf": [ @@ -13496,7 +13614,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "プロンプトトークンあたりの単価。" }, "total_price": { "anyOf": [ @@ -13508,7 +13627,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "すべてのトークンの合計価格。" }, "total_tokens": { "anyOf": [ @@ -13519,7 +13639,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "使用されたトークンの合計数。" } }, "type": "object" @@ -13554,37 +13675,45 @@ "additionalProperties": true, "properties": { "answer": { - "type": "string" + "type": "string", + "description": "完全なレスポンスコンテンツ。" }, "conversation_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "会話 ID。" }, "created_at": { "format": "int64", - "type": "integer" + "type": "integer", + "description": "メッセージ作成タイムスタンプ(Unix エポック秒)。" }, "event": { "const": "message", - "type": "string" + "type": "string", + "description": "イベントタイプ。`message` に固定されています。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "このレスポンスイベントの一意 ID です。" }, "message_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "一意のメッセージ ID です。フィードバックや推奨質問のエンドポイントを呼び出す際に `message_id` パラメータとして使用します。" }, "metadata": { "$ref": "#/components/schemas/BlockingMetadataResponse" }, "mode": { - "type": "string" + "type": "string", + "description": "アプリモード。`chat` はチャットボットアプリ、`agent-chat` は Agent アプリ、`advanced-chat` は Chatflow アプリです。" }, "task_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "リクエスト追跡およびレスポンス停止 API 用のタスク ID です。" } }, "required": [ @@ -14293,7 +14422,8 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value." }, "workflow_id": { "anyOf": [ @@ -14371,19 +14501,24 @@ "items": { "$ref": "#/components/schemas/ChildChunkResponse" }, - "type": "array" + "type": "array", + "description": "子チャンクのリスト。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "1 ページあたりの件数です。" }, "page": { - "type": "integer" + "type": "integer", + "description": "現在のページ番号です。" }, "total": { - "type": "integer" + "type": "integer", + "description": "子チャンクの合計数です。" }, "total_pages": { - "type": "integer" + "type": "integer", + "description": "合計ページ数です。" } }, "required": [ @@ -14398,28 +14533,36 @@ "ChildChunkResponse": { "properties": { "content": { - "type": "string" + "type": "string", + "description": "子チャンクのテキスト内容です。" }, "created_at": { - "type": "integer" + "type": "integer", + "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" }, "id": { - "type": "string" + "type": "string", + "description": "子チャンクの一意識別子です。" }, "position": { - "type": "integer" + "type": "integer", + "description": "親チャンク内の子チャンクの位置です。" }, "segment_id": { - "type": "string" + "type": "string", + "description": "この子チャンクが属する親チャンクの ID です。" }, "type": { - "type": "string" + "type": "string", + "description": "子チャンクの作成方法です。API から作成または更新された子チャンクは常に `customized` です。システム生成の子チャンクは `automatic` です。" }, "updated_at": { - "type": "integer" + "type": "integer", + "description": "最終更新タイムスタンプ(Unix エポック、秒単位)です。" }, "word_count": { - "type": "integer" + "type": "integer", + "description": "子チャンク内容の単語数です。" } }, "required": [ @@ -14450,32 +14593,39 @@ "additionalProperties": true, "properties": { "answer": { - "type": "string" + "type": "string", + "description": "完全なレスポンスコンテンツ。" }, "created_at": { "format": "int64", - "type": "integer" + "type": "integer", + "description": "メッセージ作成タイムスタンプ(Unix エポック秒)。" }, "event": { - "type": "string" + "type": "string", + "description": "イベントタイプ。`message` に固定されています。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "このレスポンスイベントの一意 ID です。" }, "message_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "一意のメッセージ ID です。フィードバックや推奨質問のエンドポイントを呼び出す際に `message_id` パラメータとして使用します。" }, "metadata": { "$ref": "#/components/schemas/BlockingMetadataResponse" }, "mode": { - "type": "string" + "type": "string", + "description": "アプリモード、`completion` 固定です。" }, "task_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "リクエスト追跡および [生成を停止](/ja/api-reference/completion-messages/stop-completion-message-generation) API 用のタスク ID です。" } }, "required": [ @@ -14883,7 +15033,8 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" } }, "required": [ @@ -14954,13 +15105,16 @@ "items": { "$ref": "#/components/schemas/SimpleConversation" }, - "type": "array" + "type": "array", + "description": "会話のリストです。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "さらに会話があるかどうかです。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "1 ページあたりの件数です。" } }, "required": [ @@ -15095,7 +15249,8 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" } }, "required": [ @@ -15118,7 +15273,8 @@ "type": "string" }, "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" } }, "required": [ @@ -15145,10 +15301,12 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" } }, - "type": "object" + "type": "object", + "description": "会話の名前変更用リクエストボディです。" }, "ConversationVariableInfiniteScrollPaginationResponse": { "properties": { @@ -15156,13 +15314,16 @@ "items": { "$ref": "#/components/schemas/ConversationVariableResponse" }, - "type": "array" + "type": "array", + "description": "会話変数のリストです。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "次のページがあるかどうかです。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "1 ページあたりの件数です。" } }, "required": [ @@ -15184,7 +15345,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "作成タイムスタンプ。" }, "description": { "anyOf": [ @@ -15195,14 +15357,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "変数の説明です。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "Variable ID." }, "name": { - "type": "string" + "type": "string", + "description": "変数名です。" }, "updated_at": { "anyOf": [ @@ -15214,7 +15379,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "最終更新タイムスタンプ。" }, "value": { "anyOf": [ @@ -15225,10 +15391,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "変数値(複雑な型の場合は JSON 文字列)。" }, "value_type": { - "type": "string" + "type": "string", + "description": "変数の値の型です。指定可能な値:`string`、`number`、`object`、`secret`、`file`、`boolean`、`array[any]`、`array[string]`、`array[number]`、`array[object]`、`array[file]`、`array[boolean]`。" } }, "required": [ @@ -15252,7 +15420,8 @@ "ConversationVariableUpdatePayloadWithUser": { "properties": { "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" }, "value": { "description": "変数の新しい値。変数の期待される型と一致する必要があります。" @@ -15261,7 +15430,8 @@ "required": [ "value" ], - "type": "object" + "type": "object", + "description": "会話変数を更新するためのリクエストボディです。" }, "ConversationVariablesQuery": { "properties": { @@ -15313,10 +15483,12 @@ "items": { "$ref": "#/components/schemas/DatasetBoundTagResponse" }, - "type": "array" + "type": "array", + "description": "このナレッジベースにバインドされたタグのリスト。" }, "total": { - "type": "integer" + "type": "integer", + "description": "このナレッジベースにバインドされたタグの合計数です。" } }, "required": [ @@ -15328,10 +15500,12 @@ "DatasetBoundTagResponse": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "タグ識別子です。" }, "name": { - "type": "string" + "type": "string", + "description": "タグの表示名です。" } }, "required": [ @@ -15484,7 +15658,8 @@ "DatasetDetailResponse": { "properties": { "app_count": { - "type": "integer" + "type": "integer", + "description": "現在このナレッジベースを使用しているアプリケーションの数です。" }, "author_name": { "anyOf": [ @@ -15494,10 +15669,12 @@ { "type": "null" } - ] + ], + "description": "作成者の表示名です。" }, "built_in_field_enabled": { - "type": "boolean" + "type": "boolean", + "description": "組み込みメタデータフィールド(例:`document_name`、`uploader`)が有効かどうかです。" }, "chunk_structure": { "anyOf": [ @@ -15507,13 +15684,16 @@ { "type": "null" } - ] + ], + "description": "チャンク構造の設定です。" }, "created_at": { - "type": "integer" + "type": "integer", + "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" }, "created_by": { - "type": "string" + "type": "string", + "description": "ナレッジベースを作成したユーザーの ID です。" }, "data_source_type": { "anyOf": [ @@ -15523,7 +15703,8 @@ { "type": "null" } - ] + ], + "description": "ドキュメントのデータソースタイプです。まだ設定されていない場合は `null` です。" }, "description": { "anyOf": [ @@ -15533,7 +15714,8 @@ { "type": "null" } - ] + ], + "description": "ナレッジベースの目的または内容を説明するオプションのテキストです。" }, "doc_form": { "anyOf": [ @@ -15543,16 +15725,19 @@ { "type": "null" } - ] + ], + "description": "ドキュメントのチャンキングモードです。`text_model` は標準テキストチャンキング、`hierarchical_model` は親子構造、`qa_model` は QA ペア抽出を示します。" }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DatasetDocMetadataResponse" }, - "type": "array" + "type": "array", + "description": "ナレッジベースのメタデータフィールド定義です。" }, "document_count": { - "type": "integer" + "type": "integer", + "description": "ナレッジベース内のドキュメント総数です。" }, "embedding_available": { "anyOf": [ @@ -15563,7 +15748,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "設定された埋め込みモデルが現在利用可能かどうかです。" }, "embedding_model": { "anyOf": [ @@ -15573,7 +15759,8 @@ { "type": "null" } - ] + ], + "description": "インデックス作成に使用される埋め込みモデルの名前です。" }, "embedding_model_provider": { "anyOf": [ @@ -15583,10 +15770,12 @@ { "type": "null" } - ] + ], + "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。以前のナレッジベースでは短縮形(例:`openai`)が返される場合があります。" }, "enable_api": { - "type": "boolean" + "type": "boolean", + "description": "このナレッジベースで API アクセスが有効かどうかです。" }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" @@ -15599,13 +15788,15 @@ { "type": "null" } - ] + ], + "description": "外部ナレッジベースの検索設定です。内部ナレッジベースの場合は `null` です。" }, "icon_info": { "$ref": "#/components/schemas/DatasetIconInfoResponse" }, "id": { - "type": "string" + "type": "string", + "description": "ナレッジベースの一意識別子です。" }, "indexing_technique": { "anyOf": [ @@ -15615,13 +15806,16 @@ { "type": "null" } - ] + ], + "description": "`high_quality` は埋め込みモデルを使用した精密検索、`economy` はキーワードベースのインデキシングです。" }, "is_multimodal": { - "type": "boolean" + "type": "boolean", + "description": "マルチモーダルコンテンツ処理が有効かどうかです。" }, "is_published": { - "type": "boolean" + "type": "boolean", + "description": "ナレッジベースが公開済みかどうかです。" }, "maintainer": { "anyOf": [ @@ -15632,13 +15826,16 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ナレッジベースのメンテナーの表示名です。設定されていない場合は `null` です。" }, "name": { - "type": "string" + "type": "string", + "description": "ナレッジベースの表示名です。ワークスペース内で一意です。" }, "permission": { - "type": "string" + "type": "string", + "description": "このナレッジベースにアクセスできるユーザーを制御します。指定可能な値:`only_me`、`all_team_members`、`partial_members`。" }, "permission_keys": { "items": { @@ -15654,10 +15851,12 @@ { "type": "null" } - ] + ], + "description": "カスタム処理パイプラインが設定されている場合のパイプライン ID です。" }, "provider": { - "type": "string" + "type": "string", + "description": "プロバイダータイプです。内部管理の場合は `vendor`、外部ナレッジベース接続の場合は `external` です。" }, "retrieval_model_dict": { "$ref": "#/components/schemas/DatasetRetrievalModelResponse" @@ -15670,7 +15869,8 @@ { "type": "null" } - ] + ], + "description": "ランタイム処理モードです。" }, "summary_index_setting": { "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" @@ -15679,16 +15879,20 @@ "items": { "$ref": "#/components/schemas/DatasetTagResponse" }, - "type": "array" + "type": "array", + "description": "このナレッジベースに関連付けられたタグです。" }, "total_available_documents": { - "type": "integer" + "type": "integer", + "description": "有効で利用可能なドキュメントの数です。" }, "total_documents": { - "type": "integer" + "type": "integer", + "description": "ドキュメントの合計数です。" }, "updated_at": { - "type": "integer" + "type": "integer", + "description": "最終更新タイムスタンプ(Unix エポック、秒単位)です。" }, "updated_by": { "anyOf": [ @@ -15698,10 +15902,12 @@ { "type": "null" } - ] + ], + "description": "ナレッジベースを最後に更新したユーザーの ID です。" }, "word_count": { - "type": "integer" + "type": "integer", + "description": "全ドキュメントの合計単語数です。" } }, "required": [ @@ -15742,7 +15948,8 @@ "DatasetDetailWithPartialMembersResponse": { "properties": { "app_count": { - "type": "integer" + "type": "integer", + "description": "現在このナレッジベースを使用しているアプリケーションの数です。" }, "author_name": { "anyOf": [ @@ -15752,10 +15959,12 @@ { "type": "null" } - ] + ], + "description": "作成者の表示名です。" }, "built_in_field_enabled": { - "type": "boolean" + "type": "boolean", + "description": "組み込みメタデータフィールド(例:`document_name`、`uploader`)が有効かどうかです。" }, "chunk_structure": { "anyOf": [ @@ -15765,13 +15974,16 @@ { "type": "null" } - ] + ], + "description": "チャンク構造の設定です。" }, "created_at": { - "type": "integer" + "type": "integer", + "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" }, "created_by": { - "type": "string" + "type": "string", + "description": "ナレッジベースを作成したユーザーの ID です。" }, "data_source_type": { "anyOf": [ @@ -15781,7 +15993,8 @@ { "type": "null" } - ] + ], + "description": "ドキュメントのデータソースタイプです。まだ設定されていない場合は `null` です。" }, "description": { "anyOf": [ @@ -15791,7 +16004,8 @@ { "type": "null" } - ] + ], + "description": "ナレッジベースの目的または内容を説明するオプションのテキストです。" }, "doc_form": { "anyOf": [ @@ -15801,16 +16015,19 @@ { "type": "null" } - ] + ], + "description": "ドキュメントのチャンキングモードです。`text_model` は標準テキストチャンキング、`hierarchical_model` は親子構造、`qa_model` は QA ペア抽出を示します。" }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DatasetDocMetadataResponse" }, - "type": "array" + "type": "array", + "description": "ナレッジベースのメタデータフィールド定義です。" }, "document_count": { - "type": "integer" + "type": "integer", + "description": "ナレッジベース内のドキュメント総数です。" }, "embedding_available": { "anyOf": [ @@ -15821,7 +16038,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "設定された埋め込みモデルが現在利用可能かどうかです。" }, "embedding_model": { "anyOf": [ @@ -15831,7 +16049,8 @@ { "type": "null" } - ] + ], + "description": "インデックス作成に使用される埋め込みモデルの名前です。" }, "embedding_model_provider": { "anyOf": [ @@ -15841,10 +16060,12 @@ { "type": "null" } - ] + ], + "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。以前のナレッジベースでは短縮形(例:`openai`)が返される場合があります。" }, "enable_api": { - "type": "boolean" + "type": "boolean", + "description": "このナレッジベースで API アクセスが有効かどうかです。" }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" @@ -15857,13 +16078,15 @@ { "type": "null" } - ] + ], + "description": "外部ナレッジベースの検索設定です。内部ナレッジベースの場合は `null` です。" }, "icon_info": { "$ref": "#/components/schemas/DatasetIconInfoResponse" }, "id": { - "type": "string" + "type": "string", + "description": "ナレッジベースの一意識別子です。" }, "indexing_technique": { "anyOf": [ @@ -15873,13 +16096,16 @@ { "type": "null" } - ] + ], + "description": "`high_quality` は埋め込みモデルを使用した精密検索、`economy` はキーワードベースのインデキシングです。" }, "is_multimodal": { - "type": "boolean" + "type": "boolean", + "description": "マルチモーダルコンテンツ処理が有効かどうかです。" }, "is_published": { - "type": "boolean" + "type": "boolean", + "description": "ナレッジベースが公開済みかどうかです。" }, "maintainer": { "anyOf": [ @@ -15890,10 +16116,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ナレッジベースのメンテナーの表示名です。設定されていない場合は `null` です。" }, "name": { - "type": "string" + "type": "string", + "description": "ナレッジベースの表示名です。ワークスペース内で一意です。" }, "partial_member_list": { "anyOf": [ @@ -15907,10 +16135,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "`permission` が `partial_members` の場合にアクセスを許可されたメンバーのアカウント ID です。更新レスポンスでは常に含まれ、詳細レスポンスでは `permission` が `partial_members` の場合にのみ含まれます。" }, "permission": { - "type": "string" + "type": "string", + "description": "このナレッジベースにアクセスできるユーザーを制御します。指定可能な値:`only_me`、`all_team_members`、`partial_members`。" }, "permission_keys": { "items": { @@ -15926,10 +16156,12 @@ { "type": "null" } - ] + ], + "description": "カスタム処理パイプラインが設定されている場合のパイプライン ID です。" }, "provider": { - "type": "string" + "type": "string", + "description": "プロバイダータイプです。内部管理の場合は `vendor`、外部ナレッジベース接続の場合は `external` です。" }, "retrieval_model_dict": { "$ref": "#/components/schemas/DatasetRetrievalModelResponse" @@ -15942,7 +16174,8 @@ { "type": "null" } - ] + ], + "description": "ランタイム処理モードです。" }, "summary_index_setting": { "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" @@ -15951,16 +16184,20 @@ "items": { "$ref": "#/components/schemas/DatasetTagResponse" }, - "type": "array" + "type": "array", + "description": "このナレッジベースに関連付けられたタグです。" }, "total_available_documents": { - "type": "integer" + "type": "integer", + "description": "有効で利用可能なドキュメントの数です。" }, "total_documents": { - "type": "integer" + "type": "integer", + "description": "ドキュメントの合計数です。" }, "updated_at": { - "type": "integer" + "type": "integer", + "description": "最終更新タイムスタンプ(Unix エポック、秒単位)です。" }, "updated_by": { "anyOf": [ @@ -15970,10 +16207,12 @@ { "type": "null" } - ] + ], + "description": "ナレッジベースを最後に更新したユーザーの ID です。" }, "word_count": { - "type": "integer" + "type": "integer", + "description": "全ドキュメントの合計単語数です。" } }, "required": [ @@ -16014,13 +16253,16 @@ "DatasetDocMetadataResponse": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "メタデータフィールドの識別子です。" }, "name": { - "type": "string" + "type": "string", + "description": "メタデータフィールド名です。" }, "type": { - "type": "string" + "type": "string", + "description": "メタデータフィールドの値の種類です。" } }, "required": [ @@ -16041,7 +16283,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部ナレッジ API のエンドポイント URL です。" }, "external_knowledge_api_id": { "anyOf": [ @@ -16052,7 +16295,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部ナレッジ API 接続の ID です。" }, "external_knowledge_api_name": { "anyOf": [ @@ -16063,7 +16307,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部ナレッジ API の表示名です。" }, "external_knowledge_id": { "anyOf": [ @@ -16074,7 +16319,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部ナレッジベースの ID です。" } }, "type": "object" @@ -16090,7 +16336,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "最小関連性スコアのしきい値です。" }, "score_threshold_enabled": { "anyOf": [ @@ -16101,10 +16348,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "スコア閾値フィルタリングが有効かどうかです。" }, "top_k": { - "type": "integer" + "type": "integer", + "description": "外部ナレッジベースから返す結果の最大数です。" } }, "required": [ @@ -16123,7 +16372,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "アイコン識別子または絵文字です。" }, "icon_background": { "anyOf": [ @@ -16134,7 +16384,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "アイコンの背景色です。" }, "icon_type": { "anyOf": [ @@ -16145,7 +16396,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "アイコンの種類です。" }, "icon_url": { "anyOf": [ @@ -16156,7 +16408,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "カスタムアイコン画像の URL です。" } }, "type": "object" @@ -16172,7 +16425,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "キーワード検索結果に割り当てられた重みです。" } }, "type": "object" @@ -16220,19 +16474,24 @@ "items": { "$ref": "#/components/schemas/DatasetDetailResponse" }, - "type": "array" + "type": "array", + "description": "ナレッジベースオブジェクトの配列です。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "次のページにさらに項目が存在するかどうかです。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "1 ページあたりの件数です。" }, "page": { - "type": "integer" + "type": "integer", + "description": "現在のページ番号です。" }, "total": { - "type": "integer" + "type": "integer", + "description": "一致する項目の合計数です。" } }, "required": [ @@ -16247,7 +16506,8 @@ "DatasetMetadataActionResponse": { "properties": { "result": { - "type": "string" + "type": "string", + "description": "操作結果です。" } }, "required": [ @@ -16258,10 +16518,12 @@ "DatasetMetadataBuiltInFieldResponse": { "properties": { "name": { - "type": "string" + "type": "string", + "description": "組み込みフィールド識別子です。`document_name` はドキュメントタイトル、`uploader` は作成者、`upload_date` は作成日時、`last_update_date` は最終更新日時、`source` はドキュメントの出典を示します。" }, "type": { - "type": "string" + "type": "string", + "description": "フィールドのデータ型です。テキスト値の場合は `string`、日時値の場合は `time` です。" } }, "required": [ @@ -16276,7 +16538,8 @@ "items": { "$ref": "#/components/schemas/DatasetMetadataBuiltInFieldResponse" }, - "type": "array" + "type": "array", + "description": "システム提供のメタデータフィールドのリストです。" } }, "required": [ @@ -16288,16 +16551,20 @@ "properties": { "count": { "default": 0, - "type": "integer" + "type": "integer", + "description": "このメタデータフィールドを使用しているドキュメント数です。" }, "id": { - "type": "string" + "type": "string", + "description": "メタデータフィールドの識別子です。" }, "name": { - "type": "string" + "type": "string", + "description": "メタデータフィールド名です。" }, "type": { - "type": "string" + "type": "string", + "description": "メタデータフィールドの種類です。" } }, "required": [ @@ -16310,13 +16577,15 @@ "DatasetMetadataListResponse": { "properties": { "built_in_field_enabled": { - "type": "boolean" + "type": "boolean", + "description": "このナレッジベースで組み込みメタデータフィールドが有効かどうかです。" }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DatasetMetadataListItemResponse" }, - "type": "array" + "type": "array", + "description": "メタデータフィールド定義のリスト。" } }, "required": [ @@ -16328,13 +16597,16 @@ "DatasetMetadataResponse": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "メタデータフィールドの識別子です。" }, "name": { - "type": "string" + "type": "string", + "description": "メタデータフィールド名です。" }, "type": { - "type": "string" + "type": "string", + "description": "メタデータフィールドの種類です。" } }, "required": [ @@ -16355,7 +16627,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "リランキングモデル名です。" }, "reranking_provider_name": { "anyOf": [ @@ -16366,7 +16639,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "リランクモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/cohere/cohere`)。以前のナレッジベースでは短縮形(例:`cohere`)が返される場合があります。" } }, "type": "object" @@ -16374,7 +16648,8 @@ "DatasetRetrievalModelResponse": { "properties": { "reranking_enable": { - "type": "boolean" + "type": "boolean", + "description": "リランキングが有効かどうかです。" }, "reranking_mode": { "anyOf": [ @@ -16385,7 +16660,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "リランキングモードです。`reranking_model` はモデルベースのリランキング、`weighted_score` はスコアベースの重み付けを示します。リランキングが無効の場合は `null` です。" }, "reranking_model": { "$ref": "#/components/schemas/DatasetRerankingModelResponse" @@ -16399,16 +16675,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "結果の最小関連性スコアです。`score_threshold_enabled` が `true` の場合にのみ有効です。" }, "score_threshold_enabled": { - "type": "boolean" + "type": "boolean", + "description": "スコア閾値フィルタリングが有効かどうかです。" }, "search_method": { - "type": "string" + "type": "string", + "description": "検索に使用する検索方法です。`keyword_search` はキーワードマッチング、`semantic_search` は埋め込みベースの類似度検索、`full_text_search` は全文インデックス検索、`hybrid_search` はセマンティックとキーワードの組み合わせ検索を示します。" }, "top_k": { - "type": "integer" + "type": "integer", + "description": "返す結果の最大数です。" }, "weights": { "anyOf": [ @@ -16419,7 +16699,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ハイブリッド検索の重み設定です。" } }, "required": [ @@ -16441,7 +16722,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "サマリーインデックスが有効かどうかです。" }, "model_name": { "anyOf": [ @@ -16452,7 +16734,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "要約生成に使用されるモデルの名前です。" }, "model_provider_name": { "anyOf": [ @@ -16463,7 +16746,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "要約生成モデルのプロバイダーです。" }, "summary_prompt": { "anyOf": [ @@ -16474,7 +16758,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "要約生成に使用されるプロンプトテンプレートです。" } }, "type": "object" @@ -16482,13 +16767,16 @@ "DatasetTagResponse": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "タグ識別子です。" }, "name": { - "type": "string" + "type": "string", + "description": "Tag name." }, "type": { - "type": "string" + "type": "string", + "description": "タグタイプです。ナレッジベースタグの場合は常に `knowledge` です。" } }, "required": [ @@ -16670,7 +16958,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ベクトル検索に使用される埋め込みモデルの名前です。" }, "embedding_provider_name": { "anyOf": [ @@ -16681,7 +16970,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ベクトル検索に使用される埋め込みモデルのプロバイダーです。" }, "vector_weight": { "anyOf": [ @@ -16692,7 +16982,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "セマンティック(ベクトル)検索結果に割り当てられた重みです。" } }, "type": "object" @@ -16714,7 +17005,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "セマンティック検索とキーワード検索の重みを調整するための戦略です。" } }, "type": "object" @@ -16730,7 +17022,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "資格情報の ID です。 [データソースノードを実行](/ja/api-reference/knowledge-pipeline/run-datasource-node) では `credential_id` として、 [パイプラインを実行](/ja/api-reference/knowledge-pipeline/run-pipeline) の各データソース項目の `credential_id` フィールドとして渡します。" }, "is_default": { "anyOf": [ @@ -16741,7 +17034,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "この資格情報がプロバイダーのデフォルトかどうかを示します。" }, "name": { "anyOf": [ @@ -16752,7 +17046,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "資格情報の表示名です。" }, "type": { "anyOf": [ @@ -16763,7 +17058,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "データソースプラグインが定義する資格情報のタイプです。" } }, "type": "object" @@ -16819,7 +17115,8 @@ "items": { "$ref": "#/components/schemas/DatasourceCredentialInfoResponse" }, - "type": "array" + "type": "array", + "description": "このデータソースの認証に利用できる資格情報のリストです。" }, "datasource_type": { "anyOf": [ @@ -16830,7 +17127,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "データソースのタイプです。`local_file`、`online_document`、`online_drive`、`website_crawl` のいずれかです。" }, "node_id": { "anyOf": [ @@ -16841,7 +17139,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "パイプラインワークフロー内のデータソースノードの ID です。 [データソースノードを実行](/ja/api-reference/knowledge-pipeline/run-datasource-node) では `node_id` として、 [パイプラインを実行](/ja/api-reference/knowledge-pipeline/run-pipeline) では `start_node_id` として渡します。" }, "plugin_id": { "anyOf": [ @@ -16852,7 +17151,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このノードを提供するデータソースプラグインの ID です。" }, "provider_name": { "anyOf": [ @@ -16863,7 +17163,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "データソースプラグインが登録するプロバイダー名です。" }, "title": { "anyOf": [ @@ -16874,14 +17175,16 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ノードに設定されている表示タイトルです。" }, "user_input_variables": { "items": { "additionalProperties": true, "type": "object" }, - "type": "array" + "type": "array", + "description": "このデータソースに対して呼び出し元が指定するパイプライン入力変数です。ノードのデータソースパラメータ内の `{{#...#}}` 参照から導出されます。各要素はワークフローが使用するパイプライン変数のスキーマに従います。" } }, "type": "object" @@ -16898,7 +17201,8 @@ "DocumentAndBatchResponse": { "properties": { "batch": { - "type": "string" + "type": "string", + "description": "インデックス進捗を追跡するためのバッチ ID です。" }, "document": { "$ref": "#/components/schemas/DocumentResponse" @@ -16931,7 +17235,8 @@ "properties": { "archived": { "default": null, - "type": "boolean" + "type": "boolean", + "description": "ドキュメントがアーカイブ済みかどうかです。" }, "average_segment_length": { "anyOf": [ @@ -16942,7 +17247,8 @@ "type": "number" } ], - "default": null + "default": null, + "description": "チャンクの平均文字長です。" }, "completed_at": { "anyOf": [ @@ -16953,33 +17259,40 @@ "type": "null" } ], - "default": null + "default": null, + "description": "処理が完了した Unix タイムスタンプです。まだ完了していない場合は `null` です。" }, "created_at": { "default": null, - "type": "integer" + "type": "integer", + "description": "ドキュメント作成の Unix タイムスタンプです。" }, "created_by": { "default": null, - "type": "string" + "type": "string", + "description": "ドキュメントを作成したユーザーの ID です。" }, "created_from": { "default": null, - "type": "string" + "type": "string", + "description": "ドキュメントの作成元です。API で作成した場合は `api`、UI で作成した場合は `web` です。" }, "data_source_info": { "additionalProperties": true, "default": null, - "type": "object" + "type": "object", + "description": "データソースの詳細です。ファイルアップロードの場合、この詳細エンドポイントは `upload_file` 配下に完全なファイルオブジェクトを返します(リストエンドポイントは `upload_file_id` のみを返します)。" }, "data_source_type": { "default": null, - "type": "string" + "type": "string", + "description": "ドキュメントのアップロード方法です。ファイルアップロードの場合は `upload_file`、Notion インポートの場合は `notion_import` です。" }, "dataset_process_rule": { "additionalProperties": true, "default": null, - "type": "object" + "type": "object", + "description": "ナレッジベースレベルの処理ルール設定です。" }, "dataset_process_rule_id": { "anyOf": [ @@ -16990,7 +17303,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このドキュメントに適用された処理ルールの ID です。" }, "disabled_at": { "anyOf": [ @@ -17001,7 +17315,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントが無効化された Unix タイムスタンプです。有効な場合は `null` です。" }, "disabled_by": { "anyOf": [ @@ -17012,7 +17327,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントを無効化したユーザーの ID です。有効な場合は `null` です。" }, "display_status": { "anyOf": [ @@ -17023,11 +17339,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "UI 向けの表示用インデックスステータスです。" }, "doc_form": { "default": null, - "type": "string" + "type": "string", + "description": "ドキュメントのチャンキングモードです。`text_model` は標準テキスト、`hierarchical_model` は親子構造、`qa_model` は QA ペアを示します。" }, "doc_language": { "anyOf": [ @@ -17038,7 +17356,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメント内容の言語です。" }, "doc_metadata": { "anyOf": [ @@ -17056,7 +17375,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このドキュメントのカスタムメタデータキーバリューペア。" }, "doc_type": { "anyOf": [ @@ -17067,16 +17387,19 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントタイプの分類です。未設定の場合は `null` です。" }, "document_process_rule": { "additionalProperties": true, "default": null, - "type": "object" + "type": "object", + "description": "ドキュメントレベルの処理ルール設定です。" }, "enabled": { "default": null, - "type": "boolean" + "type": "boolean", + "description": "このドキュメントが検索に対して有効かどうかです。" }, "error": { "anyOf": [ @@ -17087,14 +17410,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "インデックス作成が失敗した場合のエラーメッセージです。それ以外は `null` です。" }, "hit_count": { "default": null, - "type": "integer" + "type": "integer", + "description": "このドキュメントが検索された回数です。" }, "id": { - "type": "string" + "type": "string", + "description": "ドキュメント識別子です。" }, "indexing_latency": { "anyOf": [ @@ -17105,27 +17431,33 @@ "type": "null" } ], - "default": null + "default": null, + "description": "インデックス作成にかかった時間(秒)です。未完了の場合は `null` です。" }, "indexing_status": { "default": null, - "type": "string" + "type": "string", + "description": "現在のインデックスステータスです(例:`waiting`、`parsing`、`cleaning`、`splitting`、`indexing`、`completed`、`error`、`paused`)。" }, "name": { "default": null, - "type": "string" + "type": "string", + "description": "ドキュメント名です。" }, "need_summary": { "default": null, - "type": "boolean" + "type": "boolean", + "description": "このドキュメントが要約生成を必要とするかどうかです。" }, "position": { "default": null, - "type": "integer" + "type": "integer", + "description": "ナレッジベース内の位置インデックスです。" }, "segment_count": { "default": null, - "type": "integer" + "type": "integer", + "description": "ドキュメント内のチャンク数です。" }, "summary_index_status": { "anyOf": [ @@ -17136,7 +17468,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "要約インデックスのステータスです。要約インデックスが有効でない場合は `null` です。" }, "tokens": { "anyOf": [ @@ -17147,7 +17480,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメント内のトークン数です。" }, "updated_at": { "anyOf": [ @@ -17158,7 +17492,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "最終更新の Unix タイムスタンプです。更新されたことがない場合は `null` です。" } }, "required": [ @@ -17234,19 +17569,24 @@ "items": { "$ref": "#/components/schemas/DocumentResponse" }, - "type": "array" + "type": "array", + "description": "ドキュメントオブジェクトの配列です。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "次のページにさらに項目が存在するかどうかです。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "1 ページあたりの件数です。" }, "page": { - "type": "integer" + "type": "integer", + "description": "現在のページ番号です。" }, "total": { - "type": "integer" + "type": "integer", + "description": "一致する項目の合計数です。" } }, "required": [ @@ -17285,10 +17625,12 @@ "DocumentMetadataResponse": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "メタデータフィールドの識別子です。" }, "name": { - "type": "string" + "type": "string", + "description": "メタデータフィールド名です。" }, "type": { "type": "string" @@ -17332,7 +17674,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントがアーカイブ済みかどうかです。" }, "created_at": { "anyOf": [ @@ -17343,7 +17686,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" }, "created_by": { "anyOf": [ @@ -17354,7 +17698,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントを作成したユーザーの ID です。" }, "created_from": { "anyOf": [ @@ -17365,11 +17710,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントの作成元です。API で作成した場合は `api`、UI で作成した場合は `web` です。" }, "data_source_detail_dict": { "additionalProperties": true, - "type": "object" + "type": "object", + "description": "ファイル詳細を含む詳細なデータソース情報です。" }, "data_source_info": { "anyOf": [ @@ -17381,7 +17728,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "生のデータソース情報です。`data_source_type` によって異なります。" }, "data_source_type": { "anyOf": [ @@ -17392,7 +17740,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントの作成方法です。ファイルアップロードの場合は `upload_file`、Notion インポートの場合は `notion_import` です。" }, "dataset_process_rule_id": { "anyOf": [ @@ -17403,7 +17752,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このドキュメントに適用された処理ルールの ID です。" }, "disabled_at": { "anyOf": [ @@ -17414,7 +17764,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントが無効化されたタイムスタンプです。有効な場合は `null` です。" }, "disabled_by": { "anyOf": [ @@ -17425,7 +17776,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントを無効化したユーザーの ID です。有効な場合は `null` です。" }, "display_status": { "anyOf": [ @@ -17436,7 +17788,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "`indexing_status` と `enabled` 状態から導出されたユーザー向け表示ステータスです。" }, "doc_form": { "anyOf": [ @@ -17447,13 +17800,15 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントのチャンキングモードです。`text_model` は標準テキストチャンキング、`hierarchical_model` は親子構造、`qa_model` は QA ペア抽出を示します。" }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DocumentMetadataResponse" }, - "type": "array" + "type": "array", + "description": "このドキュメントに割り当てられたメタデータ値です。" }, "enabled": { "anyOf": [ @@ -17464,7 +17819,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このドキュメントが検索に対して有効かどうかです。" }, "error": { "anyOf": [ @@ -17475,7 +17831,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "インデックス作成が失敗した場合のエラーメッセージです。エラーなしの場合は `null` です。" }, "hit_count": { "anyOf": [ @@ -17486,10 +17843,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントが検索クエリでマッチした回数です。" }, "id": { - "type": "string" + "type": "string", + "description": "ドキュメントの一意識別子です。" }, "indexing_status": { "anyOf": [ @@ -17500,10 +17859,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "現在のインデックスステータスです。`waiting` はキュー待ち、`parsing` はコンテンツ抽出中、`cleaning` はノイズ除去中、`splitting` はチャンキング中、`indexing` はベクトル構築中、`completed` は準備完了、`error` は失敗、`paused` は手動一時停止を示します。" }, "name": { - "type": "string" + "type": "string", + "description": "ドキュメント名です。" }, "need_summary": { "anyOf": [ @@ -17514,7 +17875,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このドキュメントに要約を生成する必要があるかどうかです。" }, "position": { "anyOf": [ @@ -17525,7 +17887,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "リスト内のドキュメントの表示位置です。" }, "summary_index_status": { "anyOf": [ @@ -17536,7 +17899,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このドキュメントの要約インデックスのステータスです。要約インデックスが設定されていない場合は `null` です。" }, "tokens": { "anyOf": [ @@ -17547,7 +17911,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメント内の合計トークン数です。" }, "word_count": { "anyOf": [ @@ -17558,7 +17923,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ドキュメントの合計単語数です。" } }, "required": [ @@ -17574,7 +17940,8 @@ "items": { "$ref": "#/components/schemas/DocumentStatusResponse" }, - "type": "array" + "type": "array", + "description": "インデキシングステータスエントリのリスト。" } }, "required": [ @@ -17603,7 +17970,8 @@ { "type": "null" } - ] + ], + "description": "クリーニング完了時の Unix タイムスタンプです。" }, "completed_at": { "anyOf": [ @@ -17613,7 +17981,8 @@ { "type": "null" } - ] + ], + "description": "インデックス完了時の Unix タイムスタンプです。" }, "completed_segments": { "anyOf": [ @@ -17624,7 +17993,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "インデックス済みのチャンク数です。" }, "error": { "anyOf": [ @@ -17634,7 +18004,8 @@ { "type": "null" } - ] + ], + "description": "インデキシングが失敗した場合のエラーメッセージ。エラーがない場合は `null`。" }, "error_code": { "anyOf": [ @@ -17659,10 +18030,12 @@ "default": null }, "id": { - "type": "string" + "type": "string", + "description": "ドキュメント識別子です。" }, "indexing_status": { - "type": "string" + "type": "string", + "description": "現在のインデックスステータスです:`waiting`、`parsing`、`cleaning`、`splitting`、`indexing`、`completed`、または `error`。" }, "parsing_completed_at": { "anyOf": [ @@ -17672,7 +18045,8 @@ { "type": "null" } - ] + ], + "description": "解析完了時の Unix タイムスタンプです。" }, "paused_at": { "anyOf": [ @@ -17682,7 +18056,8 @@ { "type": "null" } - ] + ], + "description": "インデキシングが一時停止されたタイムスタンプ。一時停止されていない場合は `null`。" }, "processing_started_at": { "anyOf": [ @@ -17692,7 +18067,8 @@ { "type": "null" } - ] + ], + "description": "処理開始時の Unix タイムスタンプです。" }, "splitting_completed_at": { "anyOf": [ @@ -17702,7 +18078,8 @@ { "type": "null" } - ] + ], + "description": "分割完了時の Unix タイムスタンプです。" }, "stopped_at": { "anyOf": [ @@ -17712,7 +18089,8 @@ { "type": "null" } - ] + ], + "description": "インデキシングが停止されたタイムスタンプ。停止されていない場合は `null`。" }, "total_segments": { "anyOf": [ @@ -17723,7 +18101,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "インデックス対象のチャンクの合計数です。" }, "vector_space_limit_mb": { "anyOf": [ @@ -18077,27 +18456,32 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "`allowed_file_types` に `custom` が含まれる場合に許可されるファイル拡張子です。先頭の `.` は付けても省略してもよく、大文字と小文字は区別されません。`custom` を選択した場合、このリストには少なくとも 1 つの拡張子が必要です。" }, "allowed_file_types": { "items": { "$ref": "#/components/schemas/FileType" }, - "type": "array" + "type": "array", + "description": "受信者がアップロードできるファイルカテゴリです。`image`、`document`、`audio`、`video`、`custom` を指定できます。" }, "allowed_file_upload_methods": { "items": { "$ref": "#/components/schemas/FileTransferMethod" }, - "type": "array" + "type": "array", + "description": "受信者が使用できるアップロード方法です。`local_file` または `remote_url` を指定できます。" }, "output_variable_name": { - "type": "string" + "type": "string", + "description": "ワークフロー内で送信値を参照するための変数名です。" }, "type": { "const": "file", "default": "file", - "type": "string" + "type": "string", + "description": "`file` は、単一ファイルのアップロード入力です。" } }, "required": [ @@ -18111,32 +18495,38 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "`allowed_file_types` に `custom` が含まれる場合に許可されるファイル拡張子です。先頭の `.` は付けても省略してもよく、大文字と小文字は区別されません。`custom` を選択した場合、このリストには少なくとも 1 つの拡張子が必要です。`file` および `file-list` 入力に含まれます。" }, "allowed_file_types": { "items": { "$ref": "#/components/schemas/FileType" }, - "type": "array" + "type": "array", + "description": "受信者がアップロード可能なファイルカテゴリ。 `file` および `file-list` 入力に含まれます。値: `image`、 `document`、 `audio`、 `video`、 `custom`。" }, "allowed_file_upload_methods": { "items": { "$ref": "#/components/schemas/FileTransferMethod" }, - "type": "array" + "type": "array", + "description": "受信者が使用できるアップロード方法。値: `local_file`、 `remote_url`。 `file` および `file-list` 入力に含まれます。" }, "number_limits": { "default": 0, "minimum": 0, - "type": "integer" + "type": "integer", + "description": "受信者がアップロードできるファイルの最大数。 `file-list` 入力のみに含まれます。" }, "output_variable_name": { - "type": "string" + "type": "string", + "description": "ワークフロー内でこの入力の送信値を参照する際の変数名。送信リクエストの `inputs` オブジェクトのキーに対応します。" }, "type": { "const": "file-list", "default": "file-list", - "type": "string" + "type": "string", + "description": "`file-list` は、複数ファイルのアップロード入力です。" } }, "required": [ @@ -18165,7 +18555,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "関連付けられた会話の ID。" }, "created_at": { "anyOf": [ @@ -18177,7 +18568,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "アップロードタイムスタンプ(Unix エポック秒)。" }, "created_by": { "anyOf": [ @@ -18189,7 +18581,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "アップロードしたエンドユーザーの ID。[エンドユーザー取得](/ja/api-reference/end-users/get-end-user-info) で詳細を確認できます。" }, "extension": { "anyOf": [ @@ -18200,7 +18593,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ファイル拡張子。" }, "file_key": { "anyOf": [ @@ -18211,11 +18605,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "未使用です。常に `null` になります。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "一意のファイル ID。" }, "mime_type": { "anyOf": [ @@ -18226,10 +18622,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ファイルの MIME タイプ。" }, "name": { - "type": "string" + "type": "string", + "description": "ファイル名。" }, "original_url": { "anyOf": [ @@ -18240,7 +18638,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ファイルの元の URL。" }, "preview_url": { "anyOf": [ @@ -18251,7 +18650,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ファイルのプレビュー URL。" }, "reference": { "anyOf": [ @@ -18262,10 +18662,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Agent やツールのコンテキストでファイルを添付する際に内部的に使用される不透明なファイル参照です。このエンドポイントでアップロードされたファイルでは常に `null` です。" }, "size": { - "type": "integer" + "type": "integer", + "description": "ファイルサイズ(バイト)。" }, "source_url": { "anyOf": [ @@ -18276,7 +18678,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ファイルの署名付きダウンロード URL です。" }, "tenant_id": { "anyOf": [ @@ -18288,7 +18691,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "関連付けられたテナントの ID。" }, "user_id": { "anyOf": [ @@ -18300,7 +18704,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "未使用です。常に `null` になります。" } }, "required": [ @@ -18352,21 +18757,26 @@ { "$ref": "#/components/schemas/FileListInputConfig" } - ] + ], + "description": "フォーム入力フィールドの定義です。" }, "HitTestingChildChunk": { "properties": { "content": { - "type": "string" + "type": "string", + "description": "子チャンクのテキスト内容です。" }, "id": { - "type": "string" + "type": "string", + "description": "子チャンクの一意識別子です。" }, "position": { - "type": "integer" + "type": "integer", + "description": "親チャンク内の子チャンクの位置です。" }, "score": { - "type": "number" + "type": "number", + "description": "子チャンクの関連性スコアです。" } }, "required": [ @@ -18380,7 +18790,8 @@ "HitTestingDocument": { "properties": { "data_source_type": { - "type": "string" + "type": "string", + "description": "ドキュメントの作成方法です。" }, "doc_metadata": { "anyOf": [ @@ -18388,7 +18799,8 @@ { "type": "null" } - ] + ], + "description": "ドキュメントのメタデータ値です。メタデータが設定されていない場合は `null` です。" }, "doc_type": { "anyOf": [ @@ -18398,13 +18810,16 @@ { "type": "null" } - ] + ], + "description": "ドキュメントタイプの分類です。未設定の場合は `null` です。" }, "id": { - "type": "string" + "type": "string", + "description": "ドキュメントの一意識別子です。" }, "name": { - "type": "string" + "type": "string", + "description": "ドキュメント名です。" } }, "required": [ @@ -18419,22 +18834,28 @@ "HitTestingFile": { "properties": { "extension": { - "type": "string" + "type": "string", + "description": "ファイル拡張子。" }, "id": { - "type": "string" + "type": "string", + "description": "添付ファイルの識別子です。" }, "mime_type": { - "type": "string" + "type": "string", + "description": "ファイルの MIME タイプ。" }, "name": { - "type": "string" + "type": "string", + "description": "元のファイル名です。" }, "size": { - "type": "integer" + "type": "integer", + "description": "ファイルサイズ(バイト)。" }, "source_url": { - "type": "string" + "type": "string", + "description": "添付ファイルにアクセスする URL です。" } }, "required": [ @@ -18514,7 +18935,8 @@ "HitTestingQuery": { "properties": { "content": { - "type": "string" + "type": "string", + "description": "クエリテキストです。" } }, "required": [ @@ -18528,13 +18950,15 @@ "items": { "$ref": "#/components/schemas/HitTestingChildChunk" }, - "type": "array" + "type": "array", + "description": "階層インデックスを使用している場合、チャンク内でマッチした子チャンクです。" }, "files": { "items": { "$ref": "#/components/schemas/HitTestingFile" }, - "type": "array" + "type": "array", + "description": "このチャンクに添付されたファイルです。" }, "score": { "anyOf": [ @@ -18544,7 +18968,8 @@ { "type": "null" } - ] + ], + "description": "関連性スコアです。" }, "segment": { "$ref": "#/components/schemas/HitTestingSegment" @@ -18557,7 +18982,8 @@ { "type": "null" } - ] + ], + "description": "要約インデックス経由で取得された場合の要約コンテンツです。" }, "tsne_position": { "anyOf": [ @@ -18565,7 +18991,8 @@ { "type": "null" } - ] + ], + "description": "t-SNE 可視化の位置です。" } }, "required": [ @@ -18587,7 +19014,8 @@ "items": { "$ref": "#/components/schemas/HitTestingRecord" }, - "type": "array" + "type": "array", + "description": "一致した検索レコードのリスト。" } }, "required": [ @@ -18606,7 +19034,8 @@ { "type": "null" } - ] + ], + "description": "回答コンテンツです。Q&A モードのドキュメントで使用されます。" }, "completed_at": { "anyOf": [ @@ -18616,16 +19045,20 @@ { "type": "null" } - ] + ], + "description": "インデックス作成が完了したタイムスタンプです。まだ完了していない場合は `null` です。" }, "content": { - "type": "string" + "type": "string", + "description": "チャンクのテキスト内容です。" }, "created_at": { - "type": "integer" + "type": "integer", + "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" }, "created_by": { - "type": "string" + "type": "string", + "description": "チャンクを作成したユーザーの ID です。" }, "disabled_at": { "anyOf": [ @@ -18635,7 +19068,8 @@ { "type": "null" } - ] + ], + "description": "チャンクが無効化されたタイムスタンプです。有効な場合は `null` です。" }, "disabled_by": { "anyOf": [ @@ -18645,16 +19079,19 @@ { "type": "null" } - ] + ], + "description": "チャンクを無効化したユーザーの ID です。有効な場合は `null` です。" }, "document": { "$ref": "#/components/schemas/HitTestingDocument" }, "document_id": { - "type": "string" + "type": "string", + "description": "このチャンクが属するドキュメントの ID です。" }, "enabled": { - "type": "boolean" + "type": "boolean", + "description": "このチャンクが検索に対して有効かどうかです。" }, "error": { "anyOf": [ @@ -18664,13 +19101,16 @@ { "type": "null" } - ] + ], + "description": "インデックス作成が失敗した場合のエラーメッセージです。エラーなしの場合は `null` です。" }, "hit_count": { - "type": "integer" + "type": "integer", + "description": "このチャンクが検索クエリでマッチした回数です。" }, "id": { - "type": "string" + "type": "string", + "description": "チャンクの一意識別子です。" }, "index_node_hash": { "anyOf": [ @@ -18680,7 +19120,8 @@ { "type": "null" } - ] + ], + "description": "インデックスされたコンテンツのハッシュです。変更の検出に使用されます。" }, "index_node_id": { "anyOf": [ @@ -18690,7 +19131,8 @@ { "type": "null" } - ] + ], + "description": "ベクトルストア内のインデックスノードの ID です。" }, "indexing_at": { "anyOf": [ @@ -18700,16 +19142,19 @@ { "type": "null" } - ] + ], + "description": "インデックス作成が開始されたタイムスタンプです。まだ開始されていない場合は `null` です。" }, "keywords": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "キーワードベースの検索のためにこのチャンクに関連付けられたキーワードです。" }, "position": { - "type": "integer" + "type": "integer", + "description": "ドキュメント内のチャンクの位置。" }, "sign_content": { "anyOf": [ @@ -18719,10 +19164,12 @@ { "type": "null" } - ] + ], + "description": "整合性検証用の署名付きコンテンツハッシュです。" }, "status": { - "type": "string" + "type": "string", + "description": "チャンクのインデックスステータスです。" }, "stopped_at": { "anyOf": [ @@ -18732,13 +19179,16 @@ { "type": "null" } - ] + ], + "description": "インデックス作成が停止されたタイムスタンプです。停止されていない場合は `null` です。" }, "tokens": { - "type": "integer" + "type": "integer", + "description": "チャンク内容のトークン数です。" }, "word_count": { - "type": "integer" + "type": "integer", + "description": "チャンク内容の単語数です。" } }, "required": [ @@ -18780,28 +19230,33 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Unix タイムスタンプ(秒)。この時刻以降、フォームは送信できなくなります。" }, "form_content": { - "type": "string" + "type": "string", + "description": "ワークフロー変数を埋め込んだ、事前レンダリング済みのフォーム本文。" }, "inputs": { "items": { "$ref": "#/components/schemas/FormInputConfig" }, - "type": "array" + "type": "array", + "description": "フォーム入力フィールドの定義。" }, "resolved_default_values": { "additionalProperties": { "type": "string" }, - "type": "object" + "type": "object", + "description": "フォームに表示するための事前計算済みデフォルト値。入力の `output_variable_name` をキーとします。デフォルト値がワークフロー変数から解決可能な `paragraph` 入力にのみ設定されます。解決可能なデフォルトがない入力では空になります。クライアントはこれらの値をそのまま表示してください。 `default` をクライアント側で再解決する必要はありません。すべての値は文字列化されています。" }, "user_actions": { "items": { "$ref": "#/components/schemas/UserActionConfig" }, - "type": "array" + "type": "array", + "description": "利用可能な送信アクション。" } }, "required": [ @@ -18886,7 +19341,8 @@ "type": "object" }, "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" } }, "required": [ @@ -18966,16 +19422,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このタグにバインドされたナレッジベースの数です。" }, "id": { - "type": "string" + "type": "string", + "description": "タグ識別子です。" }, "name": { - "type": "string" + "type": "string", + "description": "タグの表示名です。" }, "type": { - "type": "string" + "type": "string", + "description": "タグタイプです。ナレッジベースタグの場合は常に `knowledge` です。" } }, "required": [ @@ -19049,13 +19509,15 @@ "description": "フィードバック評価。以前送信したフィードバックを取り消すには `null` に設定します。" }, "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" } }, "required": [ "user" ], - "type": "object" + "type": "object", + "description": "メッセージフィードバックを送信するためのリクエストボディ。" }, "MessageFile": { "properties": { @@ -19068,14 +19530,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このファイルの所有者です。ユーザーがアップロードしたファイルの場合は `user`、アシスタントが生成したファイルの場合は `assistant` です。" }, "filename": { - "type": "string" + "type": "string", + "description": "元のファイル名です。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "File ID." }, "mime_type": { "anyOf": [ @@ -19086,7 +19551,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ファイルの MIME タイプ。" }, "size": { "anyOf": [ @@ -19097,13 +19563,16 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ファイルサイズ(バイト)。" }, "transfer_method": { - "type": "string" + "type": "string", + "description": "使用された転送方法です。`remote_url` は URL ベースのファイル、`local_file` はアップロード済みファイル、`tool_file` はツール生成ファイルを示します。" }, "type": { - "type": "string" + "type": "string", + "description": "ファイルの種類(例: `image`)です。" }, "upload_file_id": { "anyOf": [ @@ -19115,7 +19584,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "`local_file` で転送された場合のアップロードファイル ID です。" }, "url": { "anyOf": [ @@ -19127,7 +19597,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ファイルのプレビュー URL。" } }, "required": [ @@ -19136,7 +19607,8 @@ "transfer_method", "type" ], - "type": "object" + "type": "object", + "description": "メッセージに添付されたファイルです。" }, "MessageInfiniteScrollPagination": { "properties": { @@ -19144,13 +19616,16 @@ "items": { "$ref": "#/components/schemas/MessageListItem" }, - "type": "array" + "type": "array", + "description": "メッセージのリストです。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "さらにメッセージがあるかどうかです。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "1 ページあたりの件数です。" } }, "required": [ @@ -19166,18 +19641,22 @@ "items": { "$ref": "#/components/schemas/AgentThought" }, - "type": "array" + "type": "array", + "description": "このメッセージのエージェント思考です。" }, "answer": { - "type": "string" + "type": "string", + "description": "アシスタントの回答テキストです。" }, "answer_tokens": { "default": 0, - "type": "integer" + "type": "integer", + "description": "生成された回答のトークン数です。" }, "conversation_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "会話 ID。" }, "created_at": { "anyOf": [ @@ -19189,7 +19668,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "作成タイムスタンプ(Unix エポック秒)。" }, "currency": { "anyOf": [ @@ -19200,7 +19680,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "`total_price` の通貨(例:`USD`)です。価格情報が利用できない場合は `null` です。" }, "error": { "anyOf": [ @@ -19211,13 +19692,15 @@ "type": "null" } ], - "default": null + "default": null, + "description": "`status` が `error` の場合のエラーメッセージです。" }, "extra_contents": { "items": { "$ref": "#/components/schemas/HumanInputContent" }, - "type": "array" + "type": "array", + "description": "このメッセージに関連する追加の実行コンテンツです。chatflow ワークフローの人間の入力ノードからのフォームデータなどが含まれます。" }, "feedback": { "anyOf": [ @@ -19228,27 +19711,32 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このメッセージのユーザーフィードバックです。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "メッセージ ID。" }, "inputs": { "additionalProperties": { "$ref": "#/components/schemas/JSONValueType" }, - "type": "object" + "type": "object", + "description": "このメッセージの入力変数です。" }, "message_files": { "items": { "$ref": "#/components/schemas/MessageFile" }, - "type": "array" + "type": "array", + "description": "このメッセージに添付されたファイルです。" }, "message_tokens": { "default": 0, - "type": "integer" + "type": "integer", + "description": "入力メッセージのトークン数です。" }, "parent_message_id": { "anyOf": [ @@ -19260,24 +19748,29 @@ "type": "null" } ], - "default": null + "default": null, + "description": "スレッド会話の親メッセージ ID です。" }, "provider_response_latency": { "default": 0, "format": "float", - "type": "number" + "type": "number", + "description": "モデルプロバイダーの応答レイテンシ(秒)です。" }, "query": { - "type": "string" + "type": "string", + "description": "ユーザークエリテキストです。" }, "retriever_resources": { "items": { "$ref": "#/components/schemas/RetrieverResource" }, - "type": "array" + "type": "array", + "description": "このメッセージに使用された検索リソースです。" }, "status": { - "type": "string" + "type": "string", + "description": "メッセージステータスです。成功したメッセージの場合は `normal`、生成に失敗した場合は `error` です。" }, "total_price": { "anyOf": [ @@ -19289,11 +19782,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "使用されたトークンの合計金額です。価格情報が利用できない場合は `null` です。" }, "total_tokens": { "readOnly": true, - "type": "integer" + "type": "integer", + "description": "使用されたトークンの合計。`message_tokens` と `answer_tokens` の合計です。" } }, "required": [ @@ -19516,7 +20011,8 @@ "OptionalServiceApiUserPayload": { "properties": { "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" } }, "type": "object" @@ -19532,15 +20028,18 @@ "type": "null" } ], - "default": null + "default": null, + "description": "フォーム入力のデフォルト値設定です。" }, "output_variable_name": { - "type": "string" + "type": "string", + "description": "入力値が格納される変数名です。" }, "type": { "const": "paragraph", "default": "paragraph", - "type": "string" + "type": "string", + "description": "`paragraph` は、複数行テキスト入力です。" } }, "required": [ @@ -19553,10 +20052,12 @@ "annotation_reply": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "この機能が有効かどうか。" } }, - "type": "object" + "type": "object", + "description": "アノテーション返信機能の設定です。" }, "file_upload": { "properties": { @@ -19595,19 +20096,23 @@ "image": { "properties": { "detail": { - "type": "string" + "type": "string", + "description": "ビジョンモデルの画像詳細レベルです。" }, "enabled": { - "type": "boolean" + "type": "boolean", + "description": "画像アップロードが有効かどうか。" }, "number_limits": { - "type": "integer" + "type": "integer", + "description": "アップロード可能な画像の最大数です。" }, "transfer_methods": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "画像アップロードで許可される転送方法です。`remote_url` はファイル URL 経由、`local_file` はアップロード済みファイルを示します。" } }, "type": "object" @@ -19616,15 +20121,18 @@ "type": "integer" } }, - "type": "object" + "type": "object", + "description": "ファイルアップロードの設定。" }, "more_like_this": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "この機能が有効かどうか。" } }, - "type": "object" + "type": "object", + "description": "類似コンテンツ機能の設定です。" }, "opening_statement": { "anyOf": [ @@ -19635,45 +20143,55 @@ "type": "null" } ], - "default": null + "default": null, + "description": "オープニングステートメントのテキストです。" }, "retriever_resource": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "この機能が有効かどうか。" } }, - "type": "object" + "type": "object", + "description": "ナレッジ検索の引用リソース設定です。" }, "sensitive_word_avoidance": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "この機能が有効かどうか。" } }, - "type": "object" + "type": "object", + "description": "コンテンツモデレーション機能の設定です。" }, "speech_to_text": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "この機能が有効かどうか。" } }, - "type": "object" + "type": "object", + "description": "音声テキスト変換機能の設定です。" }, "suggested_questions": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "提案された質問のリストです。" }, "suggested_questions_after_answer": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "この機能が有効かどうか。" } }, - "type": "object" + "type": "object", + "description": "回答後の提案質問の設定です。" }, "system_parameters": { "$ref": "#/components/schemas/SystemParameters" @@ -19681,19 +20199,24 @@ "text_to_speech": { "properties": { "autoPlay": { - "type": "string" + "type": "string", + "description": "自動再生設定です。音声を自動再生するには `enabled`、手動再生を要求するには `disabled` を指定します。" }, "enabled": { - "type": "boolean" + "type": "boolean", + "description": "この機能が有効かどうか。" }, "language": { - "type": "string" + "type": "string", + "description": "TTS 言語。" }, "voice": { - "type": "string" + "type": "string", + "description": "TTS 音声識別子。" } }, - "type": "object" + "type": "object", + "description": "テキスト音声変換機能の設定です。" }, "user_input_form": { "items": { @@ -19746,7 +20269,9 @@ "additionalProperties": true, "type": "object" }, - "default": {}, + "default": { + "description": "入力フィールドのデフォルト値です。" + }, "description": { "type": "string" }, @@ -19765,7 +20290,8 @@ ] }, "label": { - "type": "string" + "type": "string", + "description": "入力フィールドの表示ラベルです。" }, "max_length": { "anyOf": [ @@ -19784,7 +20310,8 @@ "type": "array" }, "required": { - "type": "boolean" + "type": "boolean", + "description": "このフィールドが必須かどうかです。" }, "type": { "enum": [ @@ -19801,7 +20328,8 @@ "type": "string" }, "variable": { - "type": "string" + "type": "string", + "description": "ワークフローで使用される変数名です。" } }, "required": [ @@ -19814,7 +20342,8 @@ "required": [ "text-input" ], - "type": "object" + "type": "object", + "title": "Text Input" }, { "additionalProperties": false, @@ -19864,7 +20393,9 @@ "additionalProperties": true, "type": "object" }, - "default": {}, + "default": { + "description": "デフォルトで選択される値。" + }, "description": { "type": "string" }, @@ -19883,7 +20414,8 @@ ] }, "label": { - "type": "string" + "type": "string", + "description": "セレクトフィールドの表示ラベルです。" }, "max_length": { "anyOf": [ @@ -19899,10 +20431,12 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "このフォームコントロールの選択可能な値のリスト。" }, "required": { - "type": "boolean" + "type": "boolean", + "description": "このフィールドが必須かどうかです。" }, "type": { "enum": [ @@ -19919,7 +20453,8 @@ "type": "string" }, "variable": { - "type": "string" + "type": "string", + "description": "ワークフローで使用される変数名です。" } }, "required": [ @@ -19932,7 +20467,8 @@ "required": [ "select" ], - "type": "object" + "type": "object", + "title": "Select" }, { "additionalProperties": false, @@ -19982,7 +20518,9 @@ "additionalProperties": true, "type": "object" }, - "default": {}, + "default": { + "description": "段落フィールドのデフォルト値です。" + }, "description": { "type": "string" }, @@ -20001,7 +20539,8 @@ ] }, "label": { - "type": "string" + "type": "string", + "description": "段落フィールドの表示ラベルです。" }, "max_length": { "anyOf": [ @@ -20020,7 +20559,8 @@ "type": "array" }, "required": { - "type": "boolean" + "type": "boolean", + "description": "このフィールドが必須かどうかです。" }, "type": { "enum": [ @@ -20037,7 +20577,8 @@ "type": "string" }, "variable": { - "type": "string" + "type": "string", + "description": "ワークフローで使用される変数名です。" } }, "required": [ @@ -20050,7 +20591,8 @@ "required": [ "paragraph" ], - "type": "object" + "type": "object", + "title": "Paragraph" }, { "additionalProperties": false, @@ -20763,7 +21305,8 @@ ], "type": "object" }, - "type": "array" + "type": "array", + "description": "ユーザー入力フォームの設定です。" } }, "required": [ @@ -21031,16 +21574,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "アップロードのタイムスタンプ(ISO 8601 形式)です。レコード作成中は `null` となることがあります。" }, "created_by": { - "type": "string" + "type": "string", + "description": "ファイルをアップロードしたユーザーの ID。" }, "extension": { - "type": "string" + "type": "string", + "description": "ファイル拡張子。" }, "id": { - "type": "string" + "type": "string", + "description": "アップロードされたファイルの一意識別子です。" }, "mime_type": { "anyOf": [ @@ -21051,13 +21598,16 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ファイルの MIME タイプです。アップロードに MIME タイプが含まれない場合、`null` となることがあります。" }, "name": { - "type": "string" + "type": "string", + "description": "元のファイル名です。" }, "size": { - "type": "integer" + "type": "integer", + "description": "ファイルサイズ(バイト)。" } }, "required": [ @@ -21125,7 +21675,8 @@ "properties": { "deprecated": { "default": false, - "type": "boolean" + "type": "boolean", + "description": "モデルが非推奨かどうか。" }, "features": { "anyOf": [ @@ -21139,31 +21690,36 @@ "type": "null" } ], - "default": null + "default": null, + "description": "モデルがサポートする機能です。なしの場合は `null` です。" }, "fetch_from": { "$ref": "#/components/schemas/FetchFrom" }, "has_invalid_load_balancing_configs": { "default": false, - "type": "boolean" + "type": "boolean", + "description": "モデルに無効なロードバランシング設定があるかどうか。" }, "label": { "$ref": "#/components/schemas/I18nObject" }, "load_balancing_enabled": { "default": false, - "type": "boolean" + "type": "boolean", + "description": "モデルのロードバランシングが有効かどうか。" }, "model": { - "type": "string" + "type": "string", + "description": "モデル識別子です。ナレッジベースの作成または更新時に `embedding_model` の値として使用します。" }, "model_properties": { "additionalProperties": true, "propertyNames": { "$ref": "#/components/schemas/ModelPropertyKey" }, - "type": "object" + "type": "object", + "description": "`context_size` などのモデル固有のプロパティです。" }, "model_type": { "$ref": "#/components/schemas/ModelType" @@ -21188,7 +21744,8 @@ "items": { "$ref": "#/components/schemas/ProviderWithModelsResponse" }, - "type": "array" + "type": "array", + "description": "利用可能なモデルを持つモデルプロバイダーのリストです。" } }, "required": [ @@ -21207,7 +21764,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "プロバイダーの小アイコンの URL です。" }, "icon_small_dark": { "anyOf": [ @@ -21218,7 +21776,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ダークモード用アイコンの URL。プロバイダーにない場合は `null`。" }, "label": { "$ref": "#/components/schemas/I18nObject" @@ -21227,16 +21786,19 @@ "items": { "$ref": "#/components/schemas/ProviderModelWithStatusEntity" }, - "type": "array" + "type": "array", + "description": "このプロバイダーから利用可能なモデルのリストです。" }, "provider": { - "type": "string" + "type": "string", + "description": "モデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。以前のプロバイダーでは短縮形(例:`openai`)が返される場合があります。" }, "status": { "$ref": "#/components/schemas/CustomConfigurationStatus" }, "tenant_id": { - "type": "string" + "type": "string", + "description": "このプロバイダー設定が属するワークスペース ID。" } }, "required": [ @@ -21273,6 +21835,7 @@ "RequiredServiceApiUserPayload": { "properties": { "user": { + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。", "type": "string" } }, @@ -21312,7 +21875,8 @@ "ResultResponse": { "properties": { "result": { - "type": "string" + "type": "string", + "description": "操作結果。常に `success` です。" } }, "required": [ @@ -21388,10 +21952,12 @@ "SegmentAttachmentResponse": { "properties": { "extension": { - "type": "string" + "type": "string", + "description": "ファイル拡張子。" }, "id": { - "type": "string" + "type": "string", + "description": "添付ファイルの識別子です。" }, "mime_type": { "anyOf": [ @@ -21401,16 +21967,20 @@ { "type": "null" } - ] + ], + "description": "ファイルの MIME タイプ。" }, "name": { - "type": "string" + "type": "string", + "description": "元のファイル名です。" }, "size": { - "type": "integer" + "type": "integer", + "description": "ファイルサイズ(バイト)。" }, "source_url": { - "type": "string" + "type": "string", + "description": "添付ファイルにアクセスする URL です。" } }, "required": [ @@ -21483,10 +22053,12 @@ "items": { "$ref": "#/components/schemas/SegmentResponse" }, - "type": "array" + "type": "array", + "description": "作成されたチャンクのリスト。" }, "doc_form": { - "type": "string" + "type": "string", + "description": "このドキュメントが使用するドキュメントチャンキングモードです。" } }, "required": [ @@ -21517,7 +22089,8 @@ "$ref": "#/components/schemas/SegmentResponse" }, "doc_form": { - "type": "string" + "type": "string", + "description": "このドキュメントが使用するドキュメントチャンキングモードです。" } }, "required": [ @@ -21566,22 +22139,28 @@ "items": { "$ref": "#/components/schemas/SegmentResponse" }, - "type": "array" + "type": "array", + "description": "チャンクのリスト。" }, "doc_form": { - "type": "string" + "type": "string", + "description": "このドキュメントが使用するドキュメントチャンキングモードです。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "次のページにさらに項目が存在するかどうかです。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "1 ページあたりの件数です。" }, "page": { - "type": "integer" + "type": "integer", + "description": "現在のページ番号です。" }, "total": { - "type": "integer" + "type": "integer", + "description": "一致するチャンクの合計数です。" } }, "required": [ @@ -21604,19 +22183,22 @@ { "type": "null" } - ] + ], + "description": "回答コンテンツです。Q&A モードのドキュメントで使用されます。" }, "attachments": { "items": { "$ref": "#/components/schemas/SegmentAttachmentResponse" }, - "type": "array" + "type": "array", + "description": "このチャンクに添付されたファイルです。" }, "child_chunks": { "items": { "$ref": "#/components/schemas/ChildChunkResponse" }, - "type": "array" + "type": "array", + "description": "このチャンクに属する子チャンクです。階層モードのドキュメントにのみ存在します。" }, "completed_at": { "anyOf": [ @@ -21626,16 +22208,20 @@ { "type": "null" } - ] + ], + "description": "インデックス作成が完了したタイムスタンプです。まだ完了していない場合は `null` です。" }, "content": { - "type": "string" + "type": "string", + "description": "チャンクのテキスト内容です。" }, "created_at": { - "type": "integer" + "type": "integer", + "description": "作成タイムスタンプ(Unix エポック、秒単位)です。" }, "created_by": { - "type": "string" + "type": "string", + "description": "チャンクを作成したユーザーの ID です。" }, "disabled_at": { "anyOf": [ @@ -21645,7 +22231,8 @@ { "type": "null" } - ] + ], + "description": "チャンクが無効化されたタイムスタンプです。有効な場合は `null` です。" }, "disabled_by": { "anyOf": [ @@ -21655,13 +22242,16 @@ { "type": "null" } - ] + ], + "description": "チャンクを無効化したユーザーの ID です。有効な場合は `null` です。" }, "document_id": { - "type": "string" + "type": "string", + "description": "このチャンクが属するドキュメントの ID です。" }, "enabled": { - "type": "boolean" + "type": "boolean", + "description": "このチャンクが検索に対して有効かどうかです。" }, "error": { "anyOf": [ @@ -21671,13 +22261,16 @@ { "type": "null" } - ] + ], + "description": "インデックス作成が失敗した場合のエラーメッセージです。エラーなしの場合は `null` です。" }, "hit_count": { - "type": "integer" + "type": "integer", + "description": "このチャンクが検索クエリでマッチした回数です。" }, "id": { - "type": "string" + "type": "string", + "description": "チャンクの一意識別子です。" }, "index_node_hash": { "anyOf": [ @@ -21687,7 +22280,8 @@ { "type": "null" } - ] + ], + "description": "インデックスされたコンテンツのハッシュです。変更の検出に使用されます。" }, "index_node_id": { "anyOf": [ @@ -21697,7 +22291,8 @@ { "type": "null" } - ] + ], + "description": "ベクトルストア内のインデックスノードの ID です。" }, "indexing_at": { "anyOf": [ @@ -21707,7 +22302,8 @@ { "type": "null" } - ] + ], + "description": "インデックス作成が開始されたタイムスタンプです。まだ開始されていない場合は `null` です。" }, "keywords": { "anyOf": [ @@ -21720,16 +22316,20 @@ { "type": "null" } - ] + ], + "description": "キーワードベースの検索のためにこのチャンクに関連付けられたキーワードです。" }, "position": { - "type": "integer" + "type": "integer", + "description": "ドキュメント内のチャンクの位置。" }, "sign_content": { - "type": "string" + "type": "string", + "description": "整合性検証用の署名付きコンテンツハッシュです。" }, "status": { - "type": "string" + "type": "string", + "description": "チャンクの現在のインデックスステータスです(例:`completed`、`indexing`、`error`)。" }, "stopped_at": { "anyOf": [ @@ -21739,7 +22339,8 @@ { "type": "null" } - ] + ], + "description": "インデックス作成が停止されたタイムスタンプです。停止されていない場合は `null` です。" }, "summary": { "anyOf": [ @@ -21749,13 +22350,16 @@ { "type": "null" } - ] + ], + "description": "AI が生成したチャンクコンテンツの要約です。要約インデックスが有効でない場合は `null` です。" }, "tokens": { - "type": "integer" + "type": "integer", + "description": "チャンク内容のトークン数です。" }, "updated_at": { - "type": "integer" + "type": "integer", + "description": "最終更新タイムスタンプ(Unix エポック、秒単位)です。" }, "updated_by": { "anyOf": [ @@ -21765,10 +22369,12 @@ { "type": "null" } - ] + ], + "description": "このチャンクを最後に更新したユーザーの ID です。" }, "word_count": { - "type": "integer" + "type": "integer", + "description": "チャンク内容の単語数です。" } }, "required": [ @@ -21922,15 +22528,18 @@ "SelectInputConfig": { "properties": { "option_source": { - "$ref": "#/components/schemas/StringListSource" + "$ref": "#/components/schemas/StringListSource", + "description": "この選択入力の選択肢です。`constant` は `value` を使用し、`variable` は `selector` が参照するワークフロー変数を使用します。" }, "output_variable_name": { - "type": "string" + "type": "string", + "description": "ワークフロー内で送信値を参照するための変数名です。" }, "type": { "const": "select", "default": "select", - "type": "string" + "type": "string", + "description": "`select` は、リストからの単一選択入力です。" } }, "required": [ @@ -21942,13 +22551,16 @@ "SimpleAccountResponse": { "properties": { "email": { - "type": "string" + "type": "string", + "description": "アカウントメールアドレス。" }, "id": { - "type": "string" + "type": "string", + "description": "アカウント ID。" }, "name": { - "type": "string" + "type": "string", + "description": "アカウント表示名。" } }, "required": [ @@ -21970,17 +22582,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "作成タイムスタンプ。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "会話 ID。" }, "inputs": { "additionalProperties": { "$ref": "#/components/schemas/JSONValue" }, - "type": "object" + "type": "object", + "description": "会話の入力変数です。" }, "introduction": { "anyOf": [ @@ -21991,13 +22606,16 @@ "type": "null" } ], - "default": null + "default": null, + "description": "会話の紹介文です。" }, "name": { - "type": "string" + "type": "string", + "description": "会話名です。" }, "status": { - "type": "string" + "type": "string", + "description": "会話ステータスです。アクティブな会話の場合は `normal` です。" }, "updated_at": { "anyOf": [ @@ -22009,7 +22627,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "最終更新タイムスタンプ。" } }, "required": [ @@ -22023,10 +22642,12 @@ "SimpleEndUser": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "エンドユーザー ID。" }, "is_anonymous": { - "type": "boolean" + "type": "boolean", + "description": "エンドユーザーが匿名かどうかです。" }, "session_id": { "anyOf": [ @@ -22037,10 +22658,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "セッション識別子です。" }, "type": { - "type": "string" + "type": "string", + "description": "エンドユーザーの種類です。" } }, "required": [ @@ -22061,7 +22684,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "フィードバック評価。肯定的な場合は `like`、否定的な場合は `dislike`。" } }, "type": "object" @@ -22083,10 +22707,12 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "提案された質問のリストです。" }, "result": { - "type": "string" + "type": "string", + "description": "結果ステータス。" } }, "required": [ @@ -22106,10 +22732,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "チャットカラーテーマ。" }, "chat_color_theme_inverted": { - "type": "boolean" + "type": "boolean", + "description": "チャットカラーテーマが反転しているかどうか。" }, "copyright": { "anyOf": [ @@ -22120,7 +22748,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "著作権テキスト。" }, "custom_disclaimer": { "anyOf": [ @@ -22131,10 +22760,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "カスタム免責事項テキスト。" }, "default_language": { - "type": "string" + "type": "string", + "description": "デフォルト言語コード。" }, "description": { "anyOf": [ @@ -22145,7 +22776,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Web アプリの説明。" }, "icon": { "anyOf": [ @@ -22156,7 +22788,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "アイコンのコンテンツ(絵文字または画像 ID)。" }, "icon_background": { "anyOf": [ @@ -22167,7 +22800,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "アイコンの背景色。" }, "icon_type": { "anyOf": [ @@ -22178,7 +22812,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "使用されるアイコンのタイプ。`emoji` は絵文字アイコン、`image` はアップロードされた画像アイコンです。" }, "icon_url": { "anyOf": [ @@ -22190,7 +22825,8 @@ "type": "null" } ], - "readOnly": true + "readOnly": true, + "description": "アイコン画像の URL。" }, "input_placeholder": { "anyOf": [ @@ -22201,7 +22837,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Web アプリのメッセージ入力ボックスに表示されるプレースホルダーテキストです。設定されていない場合は `null` です。" }, "privacy_policy": { "anyOf": [ @@ -22212,16 +22849,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "プライバシーポリシー URL。" }, "show_workflow_steps": { - "type": "boolean" + "type": "boolean", + "description": "ワークフローステップを表示するかどうか。" }, "title": { - "type": "string" + "type": "string", + "description": "Web アプリタイトル。" }, "use_icon_as_answer_icon": { - "type": "boolean" + "type": "boolean", + "description": "アプリアイコンを回答アイコンとして使用するかどうか。" } }, "required": [ @@ -22240,16 +22881,19 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "`type` が `variable` の場合に使用するワークフロー変数の参照パスです。" }, "type": { - "$ref": "#/components/schemas/ValueSourceType" + "$ref": "#/components/schemas/ValueSourceType", + "description": "`constant` は `value` を使用し、`variable` は `selector` が参照するワークフロー変数を使用します。" }, "value": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "`type` が `constant` の場合に使用する静的な選択肢です。" } }, "required": [ @@ -22263,14 +22907,17 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "`type` が `variable` の場合の変数セレクターパスです。" }, "type": { - "$ref": "#/components/schemas/ValueSourceType" + "$ref": "#/components/schemas/ValueSourceType", + "description": "`constant` は `value` を使用し、`variable` は `selector` が参照するワークフロー変数を使用します。" }, "value": { "default": "", - "type": "string" + "type": "string", + "description": "`type` が `constant` の場合の静的値。" } }, "required": [ @@ -22281,19 +22928,24 @@ "SystemParameters": { "properties": { "audio_file_size_limit": { - "type": "integer" + "type": "integer", + "description": "最大音声ファイルサイズ(MB)。" }, "file_size_limit": { - "type": "integer" + "type": "integer", + "description": "一般ファイルの最大サイズ(MB)です。" }, "image_file_size_limit": { - "type": "integer" + "type": "integer", + "description": "最大画像ファイルサイズ(MB)。" }, "video_file_size_limit": { - "type": "integer" + "type": "integer", + "description": "最大動画ファイルサイズ(MB)。" }, "workflow_file_upload_limit": { - "type": "integer" + "type": "integer", + "description": "ワークフロー実行ごとの最大ファイル数です。" } }, "required": [ @@ -22511,7 +23163,8 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" }, "voice": { "anyOf": [ @@ -22525,7 +23178,8 @@ "default": null } }, - "type": "object" + "type": "object", + "description": "テキストから音声への変換のリクエストボディ。`message_id` または `text` のいずれかを指定してください。" }, "ToolIcon": { "properties": { @@ -22545,7 +23199,8 @@ "UrlResponse": { "properties": { "url": { - "type": "string" + "type": "string", + "description": "元のアップロードファイルをダウンロードするための署名付き URL です。" } }, "required": [ @@ -22557,16 +23212,19 @@ "properties": { "button_style": { "$ref": "#/components/schemas/ButtonStyle", - "default": "default" + "default": "default", + "description": "ボタンのスタイルです。`primary`、`default`、`accent`、`ghost` を指定できます。" }, "id": { "maxLength": 20, "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "type": "string" + "type": "string", + "description": "アクションボタンの識別子です。フォーム送信時に `action` として指定します。" }, "title": { "maxLength": 100, - "type": "string" + "type": "string", + "description": "受信者に表示するボタンのテキストです。" } }, "required": [ @@ -22667,19 +23325,24 @@ "items": { "$ref": "#/components/schemas/WorkflowAppLogPartialResponse" }, - "type": "array" + "type": "array", + "description": "ワークフローログエントリのリストです。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "さらにページがあるかどうかです。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "1 ページあたりの件数です。" }, "page": { - "type": "integer" + "type": "integer", + "description": "現在のページ番号です。" }, "total": { - "type": "integer" + "type": "integer", + "description": "ログエントリの合計数です。" } }, "required": [ @@ -22703,7 +23366,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ログエントリが作成された Unix タイムスタンプです。" }, "created_by_account": { "anyOf": [ @@ -22714,7 +23378,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "管理者ユーザーが作成した場合のアカウント詳細です。" }, "created_by_end_user": { "anyOf": [ @@ -22736,7 +23401,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "作成者のロール(例:`end_user`、`account`)です。" }, "created_from": { "anyOf": [ @@ -22747,7 +23413,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフロー実行のソース(例:`service-api`)です。" }, "details": { "anyOf": [ @@ -22775,11 +23442,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ログエントリの追加詳細です。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "ログエントリ ID です。" }, "workflow_run": { "anyOf": [ @@ -22823,11 +23492,13 @@ "properties": { "created_at": { "format": "int64", - "type": "integer" + "type": "integer", + "description": "ワークフロー実行が作成された Unix タイムスタンプです。" }, "elapsed_time": { "format": "float", - "type": "number" + "type": "number", + "description": "合計経過時間(秒)です。" }, "error": { "anyOf": [ @@ -22837,7 +23508,8 @@ { "type": "null" } - ] + ], + "description": "ワークフローが失敗した場合のエラーメッセージです。" }, "finished_at": { "anyOf": [ @@ -22848,11 +23520,13 @@ { "type": "null" } - ] + ], + "description": "ワークフロー実行が完了した Unix タイムスタンプです。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "ワークフロー実行 ID です。" }, "outputs": { "anyOf": [ @@ -22863,7 +23537,8 @@ { "type": "null" } - ] + ], + "description": "ワークフローからの出力データです。" }, "status": { "enum": [ @@ -22872,17 +23547,21 @@ "stopped", "succeeded" ], - "type": "string" + "type": "string", + "description": "ワークフローの実行ステータスです。`running` は実行中、`succeeded` は正常完了、`failed` は実行エラー、`stopped` は手動停止、`partial-succeeded` は一部のノードが成功し他が失敗、`paused` は人間の入力待ちを示します。" }, "total_steps": { - "type": "integer" + "type": "integer", + "description": "実行されたワークフローの合計ステップ数です。" }, "total_tokens": { - "type": "integer" + "type": "integer", + "description": "全ノードで消費された合計トークン数です。" }, "workflow_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "Workflow ID." } }, "required": [ @@ -22907,11 +23586,13 @@ }, "task_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "進行中の実行のタスク ID です。[ワークフロータスクを停止](/ja/api-reference/workflow-runs/stop-workflow-task) と組み合わせて、実行中のワークフローをキャンセルします。実行中のみ有効です。" }, "workflow_run_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "このワークフロー実行記録の永続的な識別子です。[ワークフロー実行詳細を取得](/ja/api-reference/workflow-runs/get-workflow-run-detail) と組み合わせて、実行後に結果を取得します。" } }, "required": [ @@ -23265,7 +23946,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフロー実行が作成された Unix タイムスタンプです。" }, "elapsed_time": { "anyOf": [ @@ -23280,7 +23962,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "合計経過時間(秒)です。" }, "error": { "anyOf": [ @@ -23291,7 +23974,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフローが失敗した場合のエラーメッセージです。" }, "exceptions_count": { "anyOf": [ @@ -23302,7 +23986,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "実行中に発生した例外の数です。" }, "finished_at": { "anyOf": [ @@ -23314,11 +23999,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフロー実行が完了した Unix タイムスタンプです。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "ワークフロー実行 ID です。" }, "status": { "anyOf": [ @@ -23329,7 +24016,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフローの実行ステータスです。`running` は実行中、`succeeded` は正常完了、`failed` は実行エラー、`stopped` は手動停止、`partial-succeeded` は一部のノードが成功し他が失敗、`paused` は人間の入力待ちを示します。" }, "total_steps": { "anyOf": [ @@ -23340,7 +24028,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "実行されたワークフローの合計ステップ数です。" }, "total_tokens": { "anyOf": [ @@ -23351,7 +24040,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "消費された合計トークン数です。" }, "triggered_from": { "anyOf": [ @@ -23362,7 +24052,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフロー実行をトリガーしたソースです。`app-run` はアプリまたは API からの実行、`webhook` は Webhook トリガーによる実行、`schedule` はスケジュールトリガーによる実行、`plugin` はインテグレーショントリガーによる実行を示します。" }, "version": { "anyOf": [ @@ -23373,7 +24064,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフローバージョン識別子です。" } }, "required": [ @@ -23766,7 +24458,8 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" } }, "required": [ @@ -23787,7 +24480,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフロー実行が作成された Unix タイムスタンプです。" }, "elapsed_time": { "anyOf": [ @@ -23802,7 +24496,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "合計経過時間(秒)です。" }, "error": { "anyOf": [ @@ -23813,7 +24508,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフローが失敗した場合のエラーメッセージです。" }, "finished_at": { "anyOf": [ @@ -23825,11 +24521,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフロー実行が完了した Unix タイムスタンプです。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "ワークフロー実行 ID です。" }, "inputs": { "anyOf": [ @@ -23857,14 +24555,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフロー実行の入力変数です。ストレージバックエンドにより、解析済みの JSON 値または `{\"query\": \"...\"}` のような JSON エンコード文字列として返されます。文字列の場合はクライアント側で解析してください。`null` の場合もあります。" }, "outputs": { "additionalProperties": true, - "type": "object" + "type": "object", + "description": "ワークフローからの出力データです。出力がまだない場合は空のオブジェクトです。" }, "status": { - "type": "string" + "type": "string", + "description": "ワークフローの実行ステータスです。`running` は実行中、`succeeded` は正常完了、`failed` は実行エラー、`stopped` は手動停止、`partial-succeeded` は一部のノードが成功し他が失敗、`paused` は人間の入力待ちを示します。" }, "total_steps": { "anyOf": [ @@ -23875,7 +24576,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "実行されたワークフローの合計ステップ数です。" }, "total_tokens": { "anyOf": [ @@ -23886,11 +24588,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "消費された合計トークン数です。" }, "workflow_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "Workflow ID." } }, "required": [ diff --git a/tools/api-pipeline/README.md b/tools/api-pipeline/README.md index cdffadec6a..aceb7ef7d4 100644 --- a/tools/api-pipeline/README.md +++ b/tools/api-pipeline/README.md @@ -36,6 +36,10 @@ python3 "$DOCS/tools/api-pipeline/align_service_api.py" /path/to/service-openapi python3 "$DOCS/tools/api-pipeline/align_service_api.py" /path/to/service-openapi.json ``` +For the initial migration, `--presentation-root` can point to a checkout of +the pre-alignment docs so presentation follows schemas that the generator +moved behind `$ref` components. Subsequent runs use the committed locale specs. + The aligner takes paths, methods, parameters, schemas, status codes, authentication, deprecation flags, and operation IDs from Dify. It preserves localized prose, examples, operation tags and ordering, `x-mint`, `x-codeSamples`, top-level navigation tags, and the absolute server template used by the Mintlify playground. Existing JSON object keys retain their reviewed order, with generated-only keys appended, to keep contract updates diff-friendly. ## Editing the spec diff --git a/tools/api-pipeline/align_service_api.py b/tools/api-pipeline/align_service_api.py index 0c9d34c03a..63335eceb8 100644 --- a/tools/api-pipeline/align_service_api.py +++ b/tools/api-pipeline/align_service_api.py @@ -119,16 +119,39 @@ def item_identity(value: Any) -> tuple[Any, ...] | None: return None -def merge_presentation(generated: Any, current: Any) -> Any: +def is_presentation_field(key: str, parent_path: tuple[Any, ...]) -> bool: + """Return whether a key is OpenAPI presentation rather than user data.""" + + # Under a JSON Schema `properties` object these names are API fields, not + # OpenAPI annotations (for example, a response field named `summary`). + return key in PRESENTATION_KEYS and (not parent_path or parent_path[-1] != "properties") + + +def is_operation_tags(key: str, parent_path: tuple[Any, ...]) -> bool: + """Return whether a `tags` key belongs to an OpenAPI operation.""" + + return ( + key == "tags" + and len(parent_path) == 3 + and parent_path[0] == "paths" + and parent_path[2] in HTTP_METHODS + ) + + +def merge_presentation(generated: Any, current: Any, *, path: tuple[Any, ...] = ()) -> Any: """Copy documentation-only fields while retaining generated structure.""" if isinstance(generated, dict) and isinstance(current, dict): result = {} for key, current_value in current.items(): - if key in PRESENTATION_KEYS or key == "tags": + if is_presentation_field(key, path) or is_operation_tags(key, path): result[key] = copy.deepcopy(current_value) elif key in generated: - result[key] = merge_presentation(generated[key], current_value) + result[key] = merge_presentation( + generated[key], + current_value, + path=path + (key,), + ) for key, generated_value in generated.items(): if key not in result: result[key] = copy.deepcopy(generated_value) @@ -152,7 +175,11 @@ def merge_presentation(generated: Any, current: Any) -> Any: else: current_item = None result.append( - merge_presentation(generated_item, current_item) + merge_presentation( + generated_item, + current_item, + path=path + (index,), + ) if current_item is not None else copy.deepcopy(generated_item) ) @@ -161,6 +188,222 @@ def merge_presentation(generated: Any, current: Any) -> Any: return copy.deepcopy(generated) +def resolve_local_ref(root: dict[str, Any], ref: str) -> tuple[Any, tuple[str, ...]]: + """Resolve a local JSON pointer and return its value and path.""" + + if not ref.startswith("#/"): + raise ValueError(f"only local references are supported: {ref}") + path = tuple(part.replace("~1", "/").replace("~0", "~") for part in ref[2:].split("/")) + value: Any = root + for part in path: + if not isinstance(value, dict) or part not in value: + raise KeyError(f"unresolvable local reference: {ref}") + value = value[part] + return value, path + + +def schema_match_score(generated: Any, current: Any, generated_root: dict[str, Any]) -> int: + """Score how likely two schema branches describe the same value.""" + + if not isinstance(generated, dict) or not isinstance(current, dict): + return 0 + if isinstance(generated.get("$ref"), str): + generated, _ = resolve_local_ref(generated_root, generated["$ref"]) + if not isinstance(generated, dict): + return 0 + + score = 0 + generated_type = generated.get("type") + current_type = current.get("type") + if generated_type == current_type and generated_type is not None: + score += 4 + generated_properties = generated.get("properties") + current_properties = current.get("properties") + if isinstance(generated_properties, dict) and isinstance(current_properties, dict): + shared = set(generated_properties) & set(current_properties) + score += len(shared) * 10 + if set(generated_properties) == set(current_properties): + score += 5 + if "items" in generated and "items" in current: + score += 3 + generated_enum = generated.get("enum") + current_enum = current.get("enum") + if isinstance(generated_enum, list) and isinstance(current_enum, list): + score += len(set(generated_enum) & set(current_enum)) * 2 + return score + + +def carry_referenced_presentation( + generated_root: dict[str, Any], + current_root: dict[str, Any], + aligned_root: dict[str, Any], +) -> None: + """Carry docs fields when generated schemas move behind local references. + + ``merge_presentation`` handles fields that stay at the same JSON path. This + pass handles structural extraction performed by Pydantic/OpenAPI, such as + an inline response object becoming ``$ref: ...DocumentResponse``. It only + applies an old value when every matching source location agrees, so a + shared component never inherits endpoint-specific prose by accident. + """ + + candidates: dict[tuple[tuple[Any, ...], str], list[Any]] = defaultdict(list) + active_refs: set[tuple[str, str | None]] = set() + + def collect_presentation(current: dict[str, Any], aligned_path: tuple[Any, ...]) -> None: + for key in PRESENTATION_KEYS: + if key in current and is_presentation_field(key, aligned_path): + candidates[(aligned_path, key)].append(copy.deepcopy(current[key])) + + def best_variant(variants: list[Any], current: dict[str, Any]) -> tuple[int, Any] | None: + scored = [ + (schema_match_score(variant, current, generated_root), index, variant) + for index, variant in enumerate(variants) + if not (isinstance(variant, dict) and variant.get("type") == "null") + ] + if not scored: + return None + scored.sort(key=lambda item: (-item[0], item[1])) + if scored[0][0] == 0 and len(scored) > 1: + return None + return scored[0][1], scored[0][2] + + def walk( + generated: Any, + current: Any, + aligned: Any, + aligned_path: tuple[Any, ...], + *, + remapped: bool = False, + copy_here: bool = True, + ) -> None: + if isinstance(generated, dict) and isinstance(current, dict) and isinstance(aligned, dict): + generated_ref = generated.get("$ref") + current_ref = current.get("$ref") + if isinstance(generated_ref, str): + # Identical references are already merged at their component + # definitions by merge_presentation; following them again can + # misplace presentation from a nullable wrapper onto a branch. + if generated_ref == current_ref: + return + ref_pair = (generated_ref, current_ref if isinstance(current_ref, str) else None) + if ref_pair in active_refs: + return + generated_target, target_path = resolve_local_ref(generated_root, generated_ref) + aligned_target, _ = resolve_local_ref(aligned_root, generated_ref) + if isinstance(current_ref, str): + current_target, _ = resolve_local_ref(current_root, current_ref) + target_copy_here = True + else: + current_target = current + # Presentation on an inline schema stays beside the new + # $ref; only its children move into the component. + target_copy_here = False + active_refs.add(ref_pair) + walk( + generated_target, + current_target, + aligned_target, + target_path, + remapped=True, + copy_here=target_copy_here, + ) + active_refs.remove(ref_pair) + return + + if isinstance(current_ref, str): + current_target, _ = resolve_local_ref(current_root, current_ref) + walk( + generated, + current_target, + aligned, + aligned_path, + remapped=True, + copy_here=True, + ) + return + + if remapped and copy_here: + collect_presentation(current, aligned_path) + + # OpenAPI 3.1 commonly wraps an old nullable schema in anyOf with + # a null branch. Follow the structurally matching non-null branch. + for union_key in ("anyOf", "oneOf"): + generated_variants = generated.get(union_key) + if isinstance(generated_variants, list) and union_key not in current: + match = best_variant(generated_variants, current) + if match is not None: + index, generated_variant = match + aligned_variants = aligned.get(union_key) + if isinstance(aligned_variants, list) and index < len(aligned_variants): + walk( + generated_variant, + current, + aligned_variants[index], + aligned_path + (union_key, index), + remapped=True, + copy_here=False, + ) + return + + for key in generated: + if key not in current or key not in aligned: + continue + walk( + generated[key], + current[key], + aligned[key], + aligned_path + (key,), + remapped=remapped, + ) + return + + if isinstance(generated, list) and isinstance(current, list) and isinstance(aligned, list): + unused = set(range(len(current))) + for generated_index, generated_item in enumerate(generated): + if generated_index >= len(aligned): + break + ranked = sorted( + ( + schema_match_score(generated_item, current[index], generated_root), + index, + ) + for index in unused + ) + if not ranked: + continue + score, current_index = ranked[-1] + if score == 0: + current_index = generated_index if generated_index in unused else min(unused) + unused.remove(current_index) + walk( + generated_item, + current[current_index], + aligned[generated_index], + aligned_path + (generated_index,), + remapped=remapped, + ) + + walk(generated_root, current_root, aligned_root, ()) + + for (path, key), values in candidates.items(): + unique = {json.dumps(value, ensure_ascii=False, sort_keys=True) for value in values} + if len(unique) != 1: + continue + target: Any = aligned_root + for part in path: + if isinstance(part, int): + if not isinstance(target, list) or part >= len(target): + target = None + break + elif not isinstance(target, dict) or part not in target: + target = None + break + target = target[part] + if isinstance(target, dict) and key not in target: + target[key] = values[0] + + def iter_operations(spec: dict[str, Any]): paths = spec.get("paths") if not isinstance(paths, dict): @@ -405,6 +648,7 @@ def align_language( language: str, ) -> dict[str, Any]: aligned = merge_presentation(generated, current) + carry_referenced_presentation(generated, current, aligned) # JSON object order is not part of the wire contract, but it controls the # generated sidebar order. Keep the reviewed docs order, retain the @@ -464,7 +708,7 @@ def wire_shape(value: Any, *, path: tuple[Any, ...] = ()) -> Any: return { key: wire_shape(child, path=path + (key,)) for key, child in value.items() - if key not in PRESENTATION_KEYS + if not is_presentation_field(key, path) and not ( key == "tags" and len(path) == 3 @@ -514,12 +758,18 @@ def main() -> int: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("generated", type=Path, help="Dify-generated service-openapi.json") parser.add_argument("--docs-root", type=Path, default=Path(__file__).resolve().parents[2]) + parser.add_argument( + "--presentation-root", + type=Path, + help="optional source root for the pre-alignment locale presentation", + ) parser.add_argument("--write", action="store_true", help="write aligned locale specs") args = parser.parse_args() generated = load_json(args.generated) + presentation_root = args.presentation_root or args.docs_root current = { - language: load_json(args.docs_root / language / "api-reference" / "openapi_service.json") + language: load_json(presentation_root / language / "api-reference" / "openapi_service.json") for language in LANGUAGES } memories = { diff --git a/tools/api-pipeline/test_align_service_api.py b/tools/api-pipeline/test_align_service_api.py index a9beb920aa..128e4e4f32 100644 --- a/tools/api-pipeline/test_align_service_api.py +++ b/tools/api-pipeline/test_align_service_api.py @@ -4,6 +4,7 @@ from align_service_api import ( apply_deprecated_alias_presentation, align_language, + carry_referenced_presentation, merge_presentation, prefix_internal_api_links, remove_new_untranslated_presentation, @@ -159,9 +160,128 @@ def test_schema_property_named_tags_is_wire_owned(self) -> None: "Item": {"type": "object", "properties": {"tags": {"type": "array"}}} } aligned = align_language(copy.deepcopy(generated), self.current, "en") + self.assertEqual( + aligned["components"]["schemas"]["Item"]["properties"]["tags"]["type"], + "array", + ) aligned["components"]["schemas"]["Item"]["properties"]["tags"]["type"] = "string" self.assertIn("generated component contract changed", validate_alignment(generated, aligned)) + def test_schema_properties_named_like_presentation_are_wire_owned(self) -> None: + generated = copy.deepcopy(self.generated) + generated["components"]["schemas"] = { + "Item": { + "type": "object", + "properties": { + "description": {"type": "string"}, + "summary": {"type": "string"}, + "title": {"type": "string"}, + }, + } + } + current = copy.deepcopy(self.current) + current["components"]["schemas"] = { + "Item": { + "type": "object", + "properties": { + "description": {"type": "integer"}, + "summary": {"type": "integer"}, + "title": {"type": "integer"}, + }, + } + } + + aligned = align_language(generated, current, "en") + + properties = aligned["components"]["schemas"]["Item"]["properties"] + self.assertEqual({name: schema["type"] for name, schema in properties.items()}, { + "description": "string", + "summary": "string", + "title": "string", + }) + properties["summary"]["type"] = "integer" + self.assertIn("generated component contract changed", validate_alignment(generated, aligned)) + + def test_presentation_moves_from_inline_schema_to_referenced_component(self) -> None: + generated = copy.deepcopy(self.generated) + generated["paths"]["/items"]["get"]["responses"]["200"] = { + "description": "Success", + "content": { + "application/json": { + "schema": {"$ref": "#/components/schemas/ItemResponse"} + } + }, + } + generated["components"]["schemas"] = { + "ItemResponse": { + "type": "object", + "properties": {"name": {"type": "string", "title": "Name"}}, + } + } + current = copy.deepcopy(self.current) + current["paths"]["/items"]["get"]["responses"]["200"] = { + "description": "Curated success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Human-readable item name.", + } + }, + } + } + }, + } + + aligned = align_language(generated, current, "en") + + self.assertEqual( + aligned["components"]["schemas"]["ItemResponse"]["properties"]["name"]["description"], + "Human-readable item name.", + ) + self.assertNotIn("description", aligned["components"]["schemas"]["ItemResponse"]) + self.assertEqual(validate_alignment(generated, aligned), []) + + def test_conflicting_inline_descriptions_do_not_leak_into_shared_component(self) -> None: + generated = copy.deepcopy(self.generated) + generated["paths"]["/items"]["post"] = copy.deepcopy( + generated["paths"]["/items"]["get"] + ) + generated["components"]["schemas"] = { + "Shared": { + "type": "object", + "properties": {"id": {"type": "string"}}, + } + } + for method in ("get", "post"): + generated["paths"]["/items"][method]["responses"]["200"] = { + "description": "Success", + "content": { + "application/json": { + "schema": {"$ref": "#/components/schemas/Shared"} + } + }, + } + current = copy.deepcopy(generated) + for method, description in (("get", "Read identifier."), ("post", "Created identifier.")): + current["paths"]["/items"][method]["responses"]["200"]["content"]["application/json"][ + "schema" + ] = { + "type": "object", + "properties": {"id": {"type": "string", "description": description}}, + } + aligned = merge_presentation(generated, current) + + carry_referenced_presentation(generated, current, aligned) + + self.assertNotIn( + "description", + aligned["components"]["schemas"]["Shared"]["properties"]["id"], + ) + if __name__ == "__main__": unittest.main() diff --git a/zh/api-reference/openapi_service.json b/zh/api-reference/openapi_service.json index e0f3781086..50ef4354ea 100644 --- a/zh/api-reference/openapi_service.json +++ b/zh/api-reference/openapi_service.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Dify 服务 API", - "description": "用于 Dify 应用与知识库的 REST API。应用类接口使用应用 API 密钥认证,知识库类接口使用知识库 API 密钥认证。", + "description": "用于 Dify 应用与知识库的 REST API。在已发布的应用内创建应用 API 密钥,或从 **知识库 > 服务 API** 创建知识库 API 密钥。请从后端调用 API,并在每个请求中通过 `Authorization: Bearer {API_KEY}` 发送密钥。\n\nDify Cloud 的基础 URL 为 `https://api.dify.ai/v1`;自部署时,请使用部署的服务 API 基础 URL。可用以下命令验证应用密钥:\n\n```bash\ncurl https://api.dify.ai/v1/info \\\n -H \"Authorization: Bearer $DIFY_API_KEY\"\n```\n\n验证知识库 API 密钥时,使用相同的认证方式调用 `GET /datasets`。对于应用,根据 `GET /info` 返回的 `mode` 选择主要接口:`chat`(聊天助手)、`agent-chat`(Agent)、`advanced-chat`(Chatflow)和 `agent`(新 Agent)使用 `POST /chat-messages`;`completion`(文本生成应用)使用 `POST /completion-messages`;`workflow`(Workflow)使用 `POST /workflows/run`。调用 `GET /parameters` 可获取应用配置的输入变量。完整设置流程参见 [快速开始](/zh/api-reference/guides/get-started)。", "version": "1.0.0" }, "servers": [ @@ -461,7 +461,7 @@ "/chat-messages/{task_id}/stop": { "post": { "summary": "停止响应", - "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n停止聊天消息生成任务。仅在 `streaming` 模式下支持。", + "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n停止聊天消息生成任务。仅在 `streaming` 模式下支持。\n\n对于聊天助手、Agent 和新 Agent,`user` 必须与启动任务时使用的标识一致。不一致时,任务会继续运行,但接口仍返回成功。", "operationId": "stop_chat_message", "tags": [ "对话消息" @@ -501,6 +501,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SimpleResultResponse" + }, + "examples": { + "success": { + "summary": "响应示例", + "value": { + "result": "success" + } + } } } }, @@ -1105,6 +1113,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ResultResponse" + }, + "examples": { + "success": { + "summary": "响应示例", + "value": { + "result": "success" + } + } } } }, @@ -2140,13 +2156,15 @@ "type": "string" }, "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" } }, "required": [ "file" ], - "type": "object" + "type": "object", + "description": "语音转文字的请求体。" } } } @@ -4621,6 +4639,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SimpleResultResponse" + }, + "examples": { + "success": { + "summary": "响应示例", + "value": { + "result": "success" + } + } } } }, @@ -4911,7 +4937,7 @@ "/completion-messages/{task_id}/stop": { "post": { "summary": "停止响应", - "description": "**适用于**:文本生成应用。\n\n停止文本生成消息生成任务。仅在 `streaming` 模式下支持。", + "description": "**适用于**:文本生成应用。\n\n停止文本生成消息生成任务。仅在 `streaming` 模式下支持。\n\n`user` 必须与启动该任务时使用的标识一致。不一致时,任务会继续运行,但接口仍返回成功。", "operationId": "stop_completion", "tags": [ "文本生成消息" @@ -4951,6 +4977,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SimpleResultResponse" + }, + "examples": { + "success": { + "summary": "响应示例", + "value": { + "result": "success" + } + } } } }, @@ -6602,7 +6636,7 @@ "文档" ], "summary": "更新文档", - "description": "通过上传新文件更新文档,然后重新索引。这是基于文件更新文档的规范端点。使用返回的 `batch` ID 通过 [获取文档嵌入状态(进度)](/zh/api-reference/documents/get-document-indexing-status) 跟踪进度。", + "description": "更新并重新索引基于文件的文档。必须提供替换文件 `file`,或提供包含 `process_rule` 的 `data`;也可以同时提供 `file` 和 `data` 以更改处理设置。使用返回的 `batch` ID 通过 [获取文档嵌入状态(进度)](/zh/api-reference/documents/get-document-indexing-status) 跟踪进度。", "operationId": "update_document_by_file", "parameters": [ { @@ -7323,7 +7357,7 @@ "文档" ], "summary": "用文件更新文档", - "description": "已弃用。改用 [更新文档](/zh/api-reference/documents/update-document)。通过上传新文件更新文档,然后重新索引。", + "description": "已弃用。改用 [更新文档](/zh/api-reference/documents/update-document)。必须提供替换文件 `file`,或提供包含 `process_rule` 的 `data`;也可以同时提供 `file` 和 `data` 以更改处理设置。更新后会重新索引文档。", "operationId": "update_document_by_file_deprecated", "parameters": [ { @@ -12323,9 +12357,16 @@ "default": null }, "summary": { - "type": "string", - "nullable": true, - "description": "块内容的摘要。" + "description": "块内容的摘要。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "created_at": { "description": "创建时间戳(Unix 纪元秒)。", @@ -12436,8 +12477,15 @@ "description": "应用名称。" }, "description": { - "type": "string", - "description": "应用描述。" + "description": "应用描述。", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "tags": { "type": "array", @@ -12776,7 +12824,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "该思考的链 ID。" }, "created_at": { "anyOf": [ @@ -12787,19 +12836,23 @@ "type": "null" } ], - "default": null + "default": null, + "description": "创建时间戳。" }, "files": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "与该思考相关的文件 ID。" }, "id": { - "type": "string" + "type": "string", + "description": "Agent 思考 ID。" }, "message_id": { - "type": "string" + "type": "string", + "description": "该思考所属的唯一消息 ID。" }, "observation": { "anyOf": [ @@ -12810,10 +12863,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工具调用的响应。" }, "position": { - "type": "integer" + "type": "integer", + "description": "该思考的位置。" }, "thought": { "anyOf": [ @@ -12824,7 +12879,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "LLM 正在思考的内容。" }, "tool": { "anyOf": [ @@ -12835,7 +12891,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "调用的工具,以 `;` 分隔。" }, "tool_input": { "anyOf": [ @@ -12846,7 +12903,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工具输入(JSON 格式)。" }, "tool_labels": { "$ref": "#/components/schemas/JSONValue" @@ -12859,7 +12917,8 @@ "position", "tool_labels" ], - "type": "object" + "type": "object", + "description": "消息中的 Agent 思考步骤。" }, "Annotation": { "properties": { @@ -12872,7 +12931,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "标注被匹配时返回的预定义回答。" }, "created_at": { "anyOf": [ @@ -12884,7 +12944,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "创建时间戳(Unix 纪元秒)。" }, "hit_count": { "anyOf": [ @@ -12895,11 +12956,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "该标注被匹配并作为回复返回的次数。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "标注唯一标识符。" }, "question": { "anyOf": [ @@ -12910,7 +12973,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "触发该标注的问题文本。" } }, "required": [ @@ -12937,14 +13001,17 @@ "properties": { "error_msg": { "default": "", - "type": "string" + "type": "string", + "description": "描述任务失败原因的错误消息。当 `job_status` 不是 `error` 时为空字符串。" }, "job_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "来自 [配置标注回复](/zh/api-reference/annotations/configure-annotation-reply) 调用的任务 ID。" }, "job_status": { - "type": "string" + "type": "string", + "description": "当前任务状态。`waiting` 表示排队中,`processing` 表示处理中,`completed` 表示已完成,`error` 表示失败。" } }, "required": [ @@ -12957,10 +13024,12 @@ "properties": { "job_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "异步任务 ID。配合 [查询标注回复配置任务状态](/zh/api-reference/annotations/get-annotation-reply-job-status) 使用以跟踪进度。" }, "job_status": { - "type": "string" + "type": "string", + "description": "当前任务状态,仅为 `waiting`(排队中)或 `processing`(处理中);`completed` 和 `error` 仅由 [查询标注回复配置任务状态](/zh/api-reference/annotations/get-annotation-reply-job-status) 返回。" } }, "required": [ @@ -12975,19 +13044,24 @@ "items": { "$ref": "#/components/schemas/Annotation" }, - "type": "array" + "type": "array", + "description": "当前页面的标注项列表。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "如果当前结果集之后还有更多页面,则为 `true`。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "每页条目数。" }, "page": { - "type": "integer" + "type": "integer", + "description": "当前页码。" }, "total": { - "type": "integer" + "type": "integer", + "description": "匹配查询条件的标注总数。" } }, "required": [ @@ -13039,7 +13113,8 @@ "embedding_provider_name", "score_threshold" ], - "type": "object" + "type": "object", + "description": "配置标注回复设置的请求体。" }, "AppFeedbackListResponse": { "properties": { @@ -13047,7 +13122,8 @@ "items": { "$ref": "#/components/schemas/AppFeedbackResponse" }, - "type": "array" + "type": "array", + "description": "反馈项列表。" } }, "required": [ @@ -13059,7 +13135,8 @@ "properties": { "app_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "应用 ID。" }, "content": { "anyOf": [ @@ -13070,14 +13147,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "可选的文字反馈。" }, "conversation_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "会话 ID。" }, "created_at": { - "type": "string" + "type": "string", + "description": "创建时间戳。" }, "from_account_id": { "anyOf": [ @@ -13089,7 +13169,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "提交反馈的账户 ID。当 `from_source` 为 `admin` 时存在。" }, "from_end_user_id": { "anyOf": [ @@ -13101,24 +13182,30 @@ "type": "null" } ], - "default": null + "default": null, + "description": "提交反馈的终端用户 ID。当 `from_source` 为 `user` 时存在。" }, "from_source": { - "type": "string" + "type": "string", + "description": "反馈来源。`user` 为终端用户通过 API 提交的反馈,`admin` 为从控制台提交的反馈。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "反馈 ID。" }, "message_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "消息 ID。" }, "rating": { - "type": "string" + "type": "string", + "description": "反馈评分。`like` 为正面,`dislike` 为负面。" }, "updated_at": { - "type": "string" + "type": "string", + "description": "最后更新时间戳。" } }, "required": [ @@ -13131,7 +13218,8 @@ "rating", "updated_at" ], - "type": "object" + "type": "object", + "description": "单条反馈项。" }, "AudioBinaryResponse": { "format": "binary", @@ -13140,7 +13228,8 @@ "AudioTranscriptResponse": { "properties": { "text": { - "type": "string" + "type": "string", + "description": "语音识别输出的文字。" } }, "required": [ @@ -13167,7 +13256,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "使用的检索资源列表。" }, "usage": { "anyOf": [ @@ -13178,7 +13268,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "模型使用信息。" } }, "type": "object" @@ -13195,7 +13286,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "资源的内容片段。" }, "created_at": { "anyOf": [ @@ -13207,7 +13299,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "创建时间戳(Unix 纪元秒)。" }, "data_source_type": { "anyOf": [ @@ -13218,7 +13311,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "数据源类型。" }, "dataset_id": { "anyOf": [ @@ -13230,7 +13324,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "知识库 ID。" }, "dataset_name": { "anyOf": [ @@ -13241,7 +13336,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "知识库名称。" }, "document_id": { "anyOf": [ @@ -13253,7 +13349,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档 ID。" }, "document_name": { "anyOf": [ @@ -13264,7 +13361,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档名称。" }, "hit_count": { "anyOf": [ @@ -13275,7 +13373,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "该块被命中的次数。" }, "id": { "anyOf": [ @@ -13287,7 +13386,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "检索资源的唯一 ID。" }, "index_node_hash": { "anyOf": [ @@ -13298,7 +13398,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "索引节点的哈希值。" }, "message_id": { "anyOf": [ @@ -13310,10 +13411,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "该资源所属消息的 ID。" }, "position": { - "type": "integer" + "type": "integer", + "description": "资源在列表中的位置。" }, "score": { "anyOf": [ @@ -13325,7 +13428,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "资源的相关性评分。" }, "segment_id": { "anyOf": [ @@ -13337,7 +13441,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档中特定块的 ID。" }, "segment_position": { "anyOf": [ @@ -13348,7 +13453,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "块在文档中的位置。" }, "summary": { "anyOf": [ @@ -13359,7 +13465,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "块内容的摘要。" }, "word_count": { "anyOf": [ @@ -13370,13 +13477,15 @@ "type": "null" } ], - "default": null + "default": null, + "description": "块的字数。" } }, "required": [ "position" ], - "type": "object" + "type": "object", + "description": "检索资源的引用和归属信息。" }, "BlockingUsageResponse": { "additionalProperties": true, @@ -13391,7 +13500,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "补全令牌的总价。" }, "completion_price_unit": { "anyOf": [ @@ -13403,7 +13513,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "补全令牌的价格单位。" }, "completion_tokens": { "anyOf": [ @@ -13414,7 +13525,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "补全内容中的令牌数。" }, "completion_unit_price": { "anyOf": [ @@ -13426,7 +13538,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "每个补全令牌的单价。" }, "currency": { "anyOf": [ @@ -13437,7 +13550,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "计价货币。" }, "latency": { "anyOf": [ @@ -13449,7 +13563,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "延迟时间(秒)。" }, "prompt_price": { "anyOf": [ @@ -13461,7 +13576,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "提示词令牌的总价。" }, "prompt_price_unit": { "anyOf": [ @@ -13473,7 +13589,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "提示词令牌的价格单位。" }, "prompt_tokens": { "anyOf": [ @@ -13484,7 +13601,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "提示词中的令牌数。" }, "prompt_unit_price": { "anyOf": [ @@ -13496,7 +13614,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "每个提示词令牌的单价。" }, "total_price": { "anyOf": [ @@ -13508,7 +13627,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "所有令牌的总价。" }, "total_tokens": { "anyOf": [ @@ -13519,7 +13639,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "使用的令牌总数。" } }, "type": "object" @@ -13554,37 +13675,45 @@ "additionalProperties": true, "properties": { "answer": { - "type": "string" + "type": "string", + "description": "完整的响应内容。" }, "conversation_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "会话 ID。" }, "created_at": { "format": "int64", - "type": "integer" + "type": "integer", + "description": "消息创建时间戳(Unix 纪元秒)。" }, "event": { "const": "message", - "type": "string" + "type": "string", + "description": "事件类型,固定为 `message`。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "该响应事件的唯一 ID。" }, "message_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "唯一的消息 ID。调用反馈或推荐问题接口时,将此值作为 `message_id` 参数使用。" }, "metadata": { "$ref": "#/components/schemas/BlockingMetadataResponse" }, "mode": { - "type": "string" + "type": "string", + "description": "应用模式。`chat` 表示聊天助手应用,`agent-chat` 表示 Agent 应用,`advanced-chat` 表示 Chatflow 应用。" }, "task_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "用于请求追踪和停止响应 API 的任务 ID。" } }, "required": [ @@ -14293,7 +14422,8 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value." }, "workflow_id": { "anyOf": [ @@ -14371,19 +14501,24 @@ "items": { "$ref": "#/components/schemas/ChildChunkResponse" }, - "type": "array" + "type": "array", + "description": "子分段列表。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "每页条目数。" }, "page": { - "type": "integer" + "type": "integer", + "description": "当前页码。" }, "total": { - "type": "integer" + "type": "integer", + "description": "子分段总数。" }, "total_pages": { - "type": "integer" + "type": "integer", + "description": "总页数。" } }, "required": [ @@ -14398,28 +14533,36 @@ "ChildChunkResponse": { "properties": { "content": { - "type": "string" + "type": "string", + "description": "子分段的文本内容。" }, "created_at": { - "type": "integer" + "type": "integer", + "description": "创建时间戳(Unix 纪元,单位为秒)。" }, "id": { - "type": "string" + "type": "string", + "description": "子分段的唯一标识符。" }, "position": { - "type": "integer" + "type": "integer", + "description": "子分段在父分段中的位置。" }, "segment_id": { - "type": "string" + "type": "string", + "description": "该子分段所属的父分段 ID。" }, "type": { - "type": "string" + "type": "string", + "description": "子分段的创建方式。通过 API 创建或更新的子分段始终为 `customized`。系统生成的子分段为 `automatic`。" }, "updated_at": { - "type": "integer" + "type": "integer", + "description": "最后更新时间戳(Unix 纪元,单位为秒)。" }, "word_count": { - "type": "integer" + "type": "integer", + "description": "子分段内容的字数。" } }, "required": [ @@ -14450,32 +14593,39 @@ "additionalProperties": true, "properties": { "answer": { - "type": "string" + "type": "string", + "description": "完整的响应内容。" }, "created_at": { "format": "int64", - "type": "integer" + "type": "integer", + "description": "消息创建时间戳(Unix 纪元秒)。" }, "event": { - "type": "string" + "type": "string", + "description": "事件类型,固定为 `message`。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "该响应事件的唯一 ID。" }, "message_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "唯一的消息 ID。调用反馈或推荐问题接口时,将此值作为 `message_id` 参数使用。" }, "metadata": { "$ref": "#/components/schemas/BlockingMetadataResponse" }, "mode": { - "type": "string" + "type": "string", + "description": "应用模式,固定为 `completion`。" }, "task_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "用于请求追踪和 [停止响应](/zh/api-reference/completion-messages/stop-completion-message-generation) API 的任务 ID。" } }, "required": [ @@ -14883,7 +15033,8 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" } }, "required": [ @@ -14954,13 +15105,16 @@ "items": { "$ref": "#/components/schemas/SimpleConversation" }, - "type": "array" + "type": "array", + "description": "会话列表。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "是否有更多会话。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "每页条目数。" } }, "required": [ @@ -15095,7 +15249,8 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" } }, "required": [ @@ -15118,7 +15273,8 @@ "type": "string" }, "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" } }, "required": [ @@ -15145,10 +15301,12 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" } }, - "type": "object" + "type": "object", + "description": "重命名会话的请求体。" }, "ConversationVariableInfiniteScrollPaginationResponse": { "properties": { @@ -15156,13 +15314,16 @@ "items": { "$ref": "#/components/schemas/ConversationVariableResponse" }, - "type": "array" + "type": "array", + "description": "会话变量列表。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "是否有下一页。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "每页条目数。" } }, "required": [ @@ -15184,7 +15345,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "创建时间戳。" }, "description": { "anyOf": [ @@ -15195,14 +15357,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "变量描述。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "Variable ID." }, "name": { - "type": "string" + "type": "string", + "description": "变量名称。" }, "updated_at": { "anyOf": [ @@ -15214,7 +15379,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "最后更新时间戳。" }, "value": { "anyOf": [ @@ -15225,10 +15391,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "变量值(复杂类型可以是 JSON 字符串)。" }, "value_type": { - "type": "string" + "type": "string", + "description": "变量值类型。可选值:`string`、`number`、`object`、`secret`、`file`、`boolean`、`array[any]`、`array[string]`、`array[number]`、`array[object]`、`array[file]`、`array[boolean]`。" } }, "required": [ @@ -15252,7 +15420,8 @@ "ConversationVariableUpdatePayloadWithUser": { "properties": { "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" }, "value": { "description": "变量的新值。必须与变量的预期类型匹配。" @@ -15261,7 +15430,8 @@ "required": [ "value" ], - "type": "object" + "type": "object", + "description": "更新会话变量的请求体。" }, "ConversationVariablesQuery": { "properties": { @@ -15313,10 +15483,12 @@ "items": { "$ref": "#/components/schemas/DatasetBoundTagResponse" }, - "type": "array" + "type": "array", + "description": "绑定到此知识库的标签列表。" }, "total": { - "type": "integer" + "type": "integer", + "description": "绑定到该知识库的标签总数。" } }, "required": [ @@ -15328,10 +15500,12 @@ "DatasetBoundTagResponse": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "标签标识符。" }, "name": { - "type": "string" + "type": "string", + "description": "标签显示名称。" } }, "required": [ @@ -15484,7 +15658,8 @@ "DatasetDetailResponse": { "properties": { "app_count": { - "type": "integer" + "type": "integer", + "description": "当前使用该知识库的应用数量。" }, "author_name": { "anyOf": [ @@ -15494,10 +15669,12 @@ { "type": "null" } - ] + ], + "description": "创建者的显示名称。" }, "built_in_field_enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用内置元数据字段(例如 `document_name`、`uploader`)。" }, "chunk_structure": { "anyOf": [ @@ -15507,13 +15684,16 @@ { "type": "null" } - ] + ], + "description": "分段结构配置。" }, "created_at": { - "type": "integer" + "type": "integer", + "description": "创建时间戳(Unix 纪元,单位为秒)。" }, "created_by": { - "type": "string" + "type": "string", + "description": "创建该知识库的用户 ID。" }, "data_source_type": { "anyOf": [ @@ -15523,7 +15703,8 @@ { "type": "null" } - ] + ], + "description": "文档的数据源类型,尚未配置时为 `null`。" }, "description": { "anyOf": [ @@ -15533,7 +15714,8 @@ { "type": "null" } - ] + ], + "description": "描述知识库用途或内容的可选文本。" }, "doc_form": { "anyOf": [ @@ -15543,16 +15725,19 @@ { "type": "null" } - ] + ], + "description": "文档分块模式。`text_model` 表示标准文本分块,`hierarchical_model` 表示父子结构,`qa_model` 表示问答对提取。" }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DatasetDocMetadataResponse" }, - "type": "array" + "type": "array", + "description": "知识库的元数据字段定义。" }, "document_count": { - "type": "integer" + "type": "integer", + "description": "知识库中的文档总数。" }, "embedding_available": { "anyOf": [ @@ -15563,7 +15748,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "配置的嵌入模型当前是否可用。" }, "embedding_model": { "anyOf": [ @@ -15573,7 +15759,8 @@ { "type": "null" } - ] + ], + "description": "用于索引的嵌入模型名称。" }, "embedding_model_provider": { "anyOf": [ @@ -15583,10 +15770,12 @@ { "type": "null" } - ] + ], + "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。旧版知识库可能返回简写形式(例如 `openai`)。" }, "enable_api": { - "type": "boolean" + "type": "boolean", + "description": "该知识库是否启用 API 访问。" }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" @@ -15599,13 +15788,15 @@ { "type": "null" } - ] + ], + "description": "外部知识库的检索设置。内部知识库时为 `null`。" }, "icon_info": { "$ref": "#/components/schemas/DatasetIconInfoResponse" }, "id": { - "type": "string" + "type": "string", + "description": "知识库的唯一标识符。" }, "indexing_technique": { "anyOf": [ @@ -15615,13 +15806,16 @@ { "type": "null" } - ] + ], + "description": "`high_quality` 使用嵌入模型进行精确搜索;`economy` 使用基于关键词的索引。" }, "is_multimodal": { - "type": "boolean" + "type": "boolean", + "description": "是否启用多模态内容处理。" }, "is_published": { - "type": "boolean" + "type": "boolean", + "description": "知识库是否已发布。" }, "maintainer": { "anyOf": [ @@ -15632,13 +15826,16 @@ "type": "null" } ], - "default": null + "default": null, + "description": "知识库维护者的显示名称。未设置时为 `null`。" }, "name": { - "type": "string" + "type": "string", + "description": "知识库的显示名称。在工作区内唯一。" }, "permission": { - "type": "string" + "type": "string", + "description": "控制谁可以访问此知识库。可选值:`only_me`、`all_team_members`、`partial_members`。" }, "permission_keys": { "items": { @@ -15654,10 +15851,12 @@ { "type": "null" } - ] + ], + "description": "自定义处理流水线的 ID(如果已配置)。" }, "provider": { - "type": "string" + "type": "string", + "description": "供应商类型。内部管理为 `vendor`,外部知识库连接为 `external`。" }, "retrieval_model_dict": { "$ref": "#/components/schemas/DatasetRetrievalModelResponse" @@ -15670,7 +15869,8 @@ { "type": "null" } - ] + ], + "description": "运行时处理模式。" }, "summary_index_setting": { "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" @@ -15679,16 +15879,20 @@ "items": { "$ref": "#/components/schemas/DatasetTagResponse" }, - "type": "array" + "type": "array", + "description": "与该知识库关联的标签。" }, "total_available_documents": { - "type": "integer" + "type": "integer", + "description": "已启用且可用的文档数量。" }, "total_documents": { - "type": "integer" + "type": "integer", + "description": "文档总数。" }, "updated_at": { - "type": "integer" + "type": "integer", + "description": "最后更新时间戳(Unix 纪元,单位为秒)。" }, "updated_by": { "anyOf": [ @@ -15698,10 +15902,12 @@ { "type": "null" } - ] + ], + "description": "最后更新该知识库的用户 ID。" }, "word_count": { - "type": "integer" + "type": "integer", + "description": "所有文档的总字数。" } }, "required": [ @@ -15742,7 +15948,8 @@ "DatasetDetailWithPartialMembersResponse": { "properties": { "app_count": { - "type": "integer" + "type": "integer", + "description": "当前使用该知识库的应用数量。" }, "author_name": { "anyOf": [ @@ -15752,10 +15959,12 @@ { "type": "null" } - ] + ], + "description": "创建者的显示名称。" }, "built_in_field_enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用内置元数据字段(例如 `document_name`、`uploader`)。" }, "chunk_structure": { "anyOf": [ @@ -15765,13 +15974,16 @@ { "type": "null" } - ] + ], + "description": "分段结构配置。" }, "created_at": { - "type": "integer" + "type": "integer", + "description": "创建时间戳(Unix 纪元,单位为秒)。" }, "created_by": { - "type": "string" + "type": "string", + "description": "创建该知识库的用户 ID。" }, "data_source_type": { "anyOf": [ @@ -15781,7 +15993,8 @@ { "type": "null" } - ] + ], + "description": "文档的数据源类型,尚未配置时为 `null`。" }, "description": { "anyOf": [ @@ -15791,7 +16004,8 @@ { "type": "null" } - ] + ], + "description": "描述知识库用途或内容的可选文本。" }, "doc_form": { "anyOf": [ @@ -15801,16 +16015,19 @@ { "type": "null" } - ] + ], + "description": "文档分块模式。`text_model` 表示标准文本分块,`hierarchical_model` 表示父子结构,`qa_model` 表示问答对提取。" }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DatasetDocMetadataResponse" }, - "type": "array" + "type": "array", + "description": "知识库的元数据字段定义。" }, "document_count": { - "type": "integer" + "type": "integer", + "description": "知识库中的文档总数。" }, "embedding_available": { "anyOf": [ @@ -15821,7 +16038,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "配置的嵌入模型当前是否可用。" }, "embedding_model": { "anyOf": [ @@ -15831,7 +16049,8 @@ { "type": "null" } - ] + ], + "description": "用于索引的嵌入模型名称。" }, "embedding_model_provider": { "anyOf": [ @@ -15841,10 +16060,12 @@ { "type": "null" } - ] + ], + "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。旧版知识库可能返回简写形式(例如 `openai`)。" }, "enable_api": { - "type": "boolean" + "type": "boolean", + "description": "该知识库是否启用 API 访问。" }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" @@ -15857,13 +16078,15 @@ { "type": "null" } - ] + ], + "description": "外部知识库的检索设置。内部知识库时为 `null`。" }, "icon_info": { "$ref": "#/components/schemas/DatasetIconInfoResponse" }, "id": { - "type": "string" + "type": "string", + "description": "知识库的唯一标识符。" }, "indexing_technique": { "anyOf": [ @@ -15873,13 +16096,16 @@ { "type": "null" } - ] + ], + "description": "`high_quality` 使用嵌入模型进行精确搜索;`economy` 使用基于关键词的索引。" }, "is_multimodal": { - "type": "boolean" + "type": "boolean", + "description": "是否启用多模态内容处理。" }, "is_published": { - "type": "boolean" + "type": "boolean", + "description": "知识库是否已发布。" }, "maintainer": { "anyOf": [ @@ -15890,10 +16116,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "知识库维护者的显示名称。未设置时为 `null`。" }, "name": { - "type": "string" + "type": "string", + "description": "知识库的显示名称。在工作区内唯一。" }, "partial_member_list": { "anyOf": [ @@ -15907,10 +16135,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "当 `permission` 为 `partial_members` 时被授予访问权限的成员账户 ID。更新响应中始终返回;详情响应中仅当 `permission` 为 `partial_members` 时返回。" }, "permission": { - "type": "string" + "type": "string", + "description": "控制谁可以访问此知识库。可选值:`only_me`、`all_team_members`、`partial_members`。" }, "permission_keys": { "items": { @@ -15926,10 +16156,12 @@ { "type": "null" } - ] + ], + "description": "自定义处理流水线的 ID(如果已配置)。" }, "provider": { - "type": "string" + "type": "string", + "description": "供应商类型。内部管理为 `vendor`,外部知识库连接为 `external`。" }, "retrieval_model_dict": { "$ref": "#/components/schemas/DatasetRetrievalModelResponse" @@ -15942,7 +16174,8 @@ { "type": "null" } - ] + ], + "description": "运行时处理模式。" }, "summary_index_setting": { "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" @@ -15951,16 +16184,20 @@ "items": { "$ref": "#/components/schemas/DatasetTagResponse" }, - "type": "array" + "type": "array", + "description": "与该知识库关联的标签。" }, "total_available_documents": { - "type": "integer" + "type": "integer", + "description": "已启用且可用的文档数量。" }, "total_documents": { - "type": "integer" + "type": "integer", + "description": "文档总数。" }, "updated_at": { - "type": "integer" + "type": "integer", + "description": "最后更新时间戳(Unix 纪元,单位为秒)。" }, "updated_by": { "anyOf": [ @@ -15970,10 +16207,12 @@ { "type": "null" } - ] + ], + "description": "最后更新该知识库的用户 ID。" }, "word_count": { - "type": "integer" + "type": "integer", + "description": "所有文档的总字数。" } }, "required": [ @@ -16014,13 +16253,16 @@ "DatasetDocMetadataResponse": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "元数据字段标识符。" }, "name": { - "type": "string" + "type": "string", + "description": "元数据字段名称。" }, "type": { - "type": "string" + "type": "string", + "description": "元数据字段值类型。" } }, "required": [ @@ -16041,7 +16283,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部知识库 API 的端点 URL。" }, "external_knowledge_api_id": { "anyOf": [ @@ -16052,7 +16295,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部知识库 API 连接的 ID。" }, "external_knowledge_api_name": { "anyOf": [ @@ -16063,7 +16307,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部知识库 API 的显示名称。" }, "external_knowledge_id": { "anyOf": [ @@ -16074,7 +16319,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部知识库的 ID。" } }, "type": "object" @@ -16090,7 +16336,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "最低相关性得分阈值。" }, "score_threshold_enabled": { "anyOf": [ @@ -16101,10 +16348,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "是否启用分数阈值过滤。" }, "top_k": { - "type": "integer" + "type": "integer", + "description": "从外部知识库返回的最大结果数量。" } }, "required": [ @@ -16123,7 +16372,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "图标标识符或表情符号。" }, "icon_background": { "anyOf": [ @@ -16134,7 +16384,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "图标的背景颜色。" }, "icon_type": { "anyOf": [ @@ -16145,7 +16396,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "图标类型。" }, "icon_url": { "anyOf": [ @@ -16156,7 +16408,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "自定义图标图片的 URL。" } }, "type": "object" @@ -16172,7 +16425,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "分配给关键词搜索结果的权重。" } }, "type": "object" @@ -16220,19 +16474,24 @@ "items": { "$ref": "#/components/schemas/DatasetDetailResponse" }, - "type": "array" + "type": "array", + "description": "知识库对象数组。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "下一页是否还有更多项目。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "每页条目数。" }, "page": { - "type": "integer" + "type": "integer", + "description": "当前页码。" }, "total": { - "type": "integer" + "type": "integer", + "description": "匹配条目的总数。" } }, "required": [ @@ -16247,7 +16506,8 @@ "DatasetMetadataActionResponse": { "properties": { "result": { - "type": "string" + "type": "string", + "description": "操作结果。" } }, "required": [ @@ -16258,10 +16518,12 @@ "DatasetMetadataBuiltInFieldResponse": { "properties": { "name": { - "type": "string" + "type": "string", + "description": "内置字段标识符。`document_name` 表示文档标题,`uploader` 表示创建者,`upload_date` 表示创建时间,`last_update_date` 表示最后修改时间,`source` 表示文档来源。" }, "type": { - "type": "string" + "type": "string", + "description": "字段数据类型。文本值为 `string`,日期/时间值为 `time`。" } }, "required": [ @@ -16276,7 +16538,8 @@ "items": { "$ref": "#/components/schemas/DatasetMetadataBuiltInFieldResponse" }, - "type": "array" + "type": "array", + "description": "系统提供的元数据字段列表。" } }, "required": [ @@ -16288,16 +16551,20 @@ "properties": { "count": { "default": 0, - "type": "integer" + "type": "integer", + "description": "使用该元数据字段的文档数量。" }, "id": { - "type": "string" + "type": "string", + "description": "元数据字段标识符。" }, "name": { - "type": "string" + "type": "string", + "description": "元数据字段名称。" }, "type": { - "type": "string" + "type": "string", + "description": "元数据字段类型。" } }, "required": [ @@ -16310,13 +16577,15 @@ "DatasetMetadataListResponse": { "properties": { "built_in_field_enabled": { - "type": "boolean" + "type": "boolean", + "description": "该知识库是否启用了内置元数据字段。" }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DatasetMetadataListItemResponse" }, - "type": "array" + "type": "array", + "description": "元数据字段定义列表。" } }, "required": [ @@ -16328,13 +16597,16 @@ "DatasetMetadataResponse": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "元数据字段标识符。" }, "name": { - "type": "string" + "type": "string", + "description": "元数据字段名称。" }, "type": { - "type": "string" + "type": "string", + "description": "元数据字段类型。" } }, "required": [ @@ -16355,7 +16627,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "重排序模型名称。" }, "reranking_provider_name": { "anyOf": [ @@ -16366,7 +16639,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "重排序模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/cohere/cohere`)。旧版知识库可能返回简写形式(例如 `cohere`)。" } }, "type": "object" @@ -16374,7 +16648,8 @@ "DatasetRetrievalModelResponse": { "properties": { "reranking_enable": { - "type": "boolean" + "type": "boolean", + "description": "是否启用重排序。" }, "reranking_mode": { "anyOf": [ @@ -16385,7 +16660,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "重排序模式。`reranking_model` 表示基于模型的重排序,`weighted_score` 表示基于分数的加权。重排序禁用时为 `null`。" }, "reranking_model": { "$ref": "#/components/schemas/DatasetRerankingModelResponse" @@ -16399,16 +16675,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "结果的最低相关性分数。仅在 `score_threshold_enabled` 为 `true` 时生效。" }, "score_threshold_enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用分数阈值过滤。" }, "search_method": { - "type": "string" + "type": "string", + "description": "用于检索的搜索方式。`keyword_search` 表示关键词匹配,`semantic_search` 表示基于嵌入的语义相似度,`full_text_search` 表示全文索引,`hybrid_search` 表示语义和关键词混合搜索。" }, "top_k": { - "type": "integer" + "type": "integer", + "description": "返回的最大结果数。" }, "weights": { "anyOf": [ @@ -16419,7 +16699,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "混合搜索的权重配置。" } }, "required": [ @@ -16441,7 +16722,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "是否已启用摘要索引。" }, "model_name": { "anyOf": [ @@ -16452,7 +16734,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "用于生成摘要的模型名称。" }, "model_provider_name": { "anyOf": [ @@ -16463,7 +16746,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "摘要生成模型的供应商。" }, "summary_prompt": { "anyOf": [ @@ -16474,7 +16758,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "用于摘要生成的提示词模板。" } }, "type": "object" @@ -16482,13 +16767,16 @@ "DatasetTagResponse": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "标签标识符。" }, "name": { - "type": "string" + "type": "string", + "description": "Tag name." }, "type": { - "type": "string" + "type": "string", + "description": "标签类型。知识库标签始终为 `knowledge`。" } }, "required": [ @@ -16670,7 +16958,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "用于向量搜索的嵌入模型名称。" }, "embedding_provider_name": { "anyOf": [ @@ -16681,7 +16970,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "用于向量搜索的嵌入模型供应商。" }, "vector_weight": { "anyOf": [ @@ -16692,7 +16982,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "分配给语义(向量)搜索结果的权重。" } }, "type": "object" @@ -16714,7 +17005,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "平衡语义搜索和关键词搜索权重的策略。" } }, "type": "object" @@ -16730,7 +17022,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "凭证 ID。调用 [执行数据源节点](/zh/api-reference/knowledge-pipeline/run-datasource-node) 时作为 `credential_id` 传入,或作为 [运行流水线](/zh/api-reference/knowledge-pipeline/run-pipeline) 各数据源项中的 `credential_id` 字段。" }, "is_default": { "anyOf": [ @@ -16741,7 +17034,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "该凭证是否为提供商的默认凭证。" }, "name": { "anyOf": [ @@ -16752,7 +17046,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "凭证的显示名称。" }, "type": { "anyOf": [ @@ -16763,7 +17058,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "数据源插件定义的凭证类型。" } }, "type": "object" @@ -16819,7 +17115,8 @@ "items": { "$ref": "#/components/schemas/DatasourceCredentialInfoResponse" }, - "type": "array" + "type": "array", + "description": "可用于对该数据源进行认证的凭证列表。" }, "datasource_type": { "anyOf": [ @@ -16830,7 +17127,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "数据源类型。取值为 `local_file`、`online_document`、`online_drive`、`website_crawl` 之一。" }, "node_id": { "anyOf": [ @@ -16841,7 +17139,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "流水线工作流中数据源节点的 ID。调用 [执行数据源节点](/zh/api-reference/knowledge-pipeline/run-datasource-node) 时作为 `node_id` 传入,或调用 [运行流水线](/zh/api-reference/knowledge-pipeline/run-pipeline) 时作为 `start_node_id` 传入。" }, "plugin_id": { "anyOf": [ @@ -16852,7 +17151,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "提供该节点的数据源插件的 ID。" }, "provider_name": { "anyOf": [ @@ -16863,7 +17163,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "数据源插件注册的提供商名称。" }, "title": { "anyOf": [ @@ -16874,14 +17175,16 @@ "type": "null" } ], - "default": null + "default": null, + "description": "为该节点配置的显示标题。" }, "user_input_variables": { "items": { "additionalProperties": true, "type": "object" }, - "type": "array" + "type": "array", + "description": "调用方需要为该数据源提供的流水线输入变量,来自节点数据源参数中 `{{#...#}}` 引用的变量。每一项遵循工作流使用的流水线变量结构。" } }, "type": "object" @@ -16898,7 +17201,8 @@ "DocumentAndBatchResponse": { "properties": { "batch": { - "type": "string" + "type": "string", + "description": "用于跟踪索引进度的批次 ID。" }, "document": { "$ref": "#/components/schemas/DocumentResponse" @@ -16931,7 +17235,8 @@ "properties": { "archived": { "default": null, - "type": "boolean" + "type": "boolean", + "description": "文档是否已归档。" }, "average_segment_length": { "anyOf": [ @@ -16942,7 +17247,8 @@ "type": "number" } ], - "default": null + "default": null, + "description": "分段的平均字符长度。" }, "completed_at": { "anyOf": [ @@ -16953,33 +17259,40 @@ "type": "null" } ], - "default": null + "default": null, + "description": "处理完成的 Unix 时间戳,尚未完成时为 `null`。" }, "created_at": { "default": null, - "type": "integer" + "type": "integer", + "description": "文档创建的 Unix 时间戳。" }, "created_by": { "default": null, - "type": "string" + "type": "string", + "description": "创建该文档的用户 ID。" }, "created_from": { "default": null, - "type": "string" + "type": "string", + "description": "文档来源。通过 API 创建时为 `api`,通过 UI 创建时为 `web`。" }, "data_source_info": { "additionalProperties": true, "default": null, - "type": "object" + "type": "object", + "description": "数据源详情。文件上传时,此详情接口在 `upload_file` 下返回完整的文件对象,而列表接口仅返回 `upload_file_id`。" }, "data_source_type": { "default": null, - "type": "string" + "type": "string", + "description": "文档的上传方式。文件上传为 `upload_file`,Notion 导入为 `notion_import`。" }, "dataset_process_rule": { "additionalProperties": true, "default": null, - "type": "object" + "type": "object", + "description": "知识库级别的处理规则配置。" }, "dataset_process_rule_id": { "anyOf": [ @@ -16990,7 +17303,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "应用于该文档的处理规则 ID。" }, "disabled_at": { "anyOf": [ @@ -17001,7 +17315,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档被禁用的 Unix 时间戳,启用时为 `null`。" }, "disabled_by": { "anyOf": [ @@ -17012,7 +17327,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "禁用该文档的用户 ID,启用时为 `null`。" }, "display_status": { "anyOf": [ @@ -17023,11 +17339,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "适合 UI 显示的索引状态。" }, "doc_form": { "default": null, - "type": "string" + "type": "string", + "description": "文档分块模式。`text_model` 表示标准文本,`hierarchical_model` 表示父子结构,`qa_model` 表示问答对。" }, "doc_language": { "anyOf": [ @@ -17038,7 +17356,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档内容的语言。" }, "doc_metadata": { "anyOf": [ @@ -17056,7 +17375,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "此文档的自定义元数据键值对。" }, "doc_type": { "anyOf": [ @@ -17067,16 +17387,19 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档类型分类,未设置时为 `null`。" }, "document_process_rule": { "additionalProperties": true, "default": null, - "type": "object" + "type": "object", + "description": "文档级别的处理规则配置。" }, "enabled": { "default": null, - "type": "boolean" + "type": "boolean", + "description": "该文档是否启用检索。" }, "error": { "anyOf": [ @@ -17087,14 +17410,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "索引失败时的错误消息,否则为 `null`。" }, "hit_count": { "default": null, - "type": "integer" + "type": "integer", + "description": "该文档被检索的次数。" }, "id": { - "type": "string" + "type": "string", + "description": "文档标识符。" }, "indexing_latency": { "anyOf": [ @@ -17105,27 +17431,33 @@ "type": "null" } ], - "default": null + "default": null, + "description": "索引耗时(秒),未完成时为 `null`。" }, "indexing_status": { "default": null, - "type": "string" + "type": "string", + "description": "当前索引状态,例如 `waiting`、`parsing`、`cleaning`、`splitting`、`indexing`、`completed`、`error`、`paused`。" }, "name": { "default": null, - "type": "string" + "type": "string", + "description": "文档名称。" }, "need_summary": { "default": null, - "type": "boolean" + "type": "boolean", + "description": "该文档是否需要生成摘要。" }, "position": { "default": null, - "type": "integer" + "type": "integer", + "description": "在知识库中的位置索引。" }, "segment_count": { "default": null, - "type": "integer" + "type": "integer", + "description": "文档中的分段数。" }, "summary_index_status": { "anyOf": [ @@ -17136,7 +17468,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "摘要索引的状态,未启用摘要索引时为 `null`。" }, "tokens": { "anyOf": [ @@ -17147,7 +17480,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档中的令牌数。" }, "updated_at": { "anyOf": [ @@ -17158,7 +17492,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "最后更新的 Unix 时间戳,从未更新时为 `null`。" } }, "required": [ @@ -17234,19 +17569,24 @@ "items": { "$ref": "#/components/schemas/DocumentResponse" }, - "type": "array" + "type": "array", + "description": "文档对象数组。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "下一页是否还有更多项目。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "每页条目数。" }, "page": { - "type": "integer" + "type": "integer", + "description": "当前页码。" }, "total": { - "type": "integer" + "type": "integer", + "description": "匹配条目的总数。" } }, "required": [ @@ -17285,10 +17625,12 @@ "DocumentMetadataResponse": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "元数据字段标识符。" }, "name": { - "type": "string" + "type": "string", + "description": "元数据字段名称。" }, "type": { "type": "string" @@ -17332,7 +17674,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档是否已归档。" }, "created_at": { "anyOf": [ @@ -17343,7 +17686,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "创建时间戳(Unix 纪元,单位为秒)。" }, "created_by": { "anyOf": [ @@ -17354,7 +17698,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "创建该文档的用户 ID。" }, "created_from": { "anyOf": [ @@ -17365,11 +17710,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档来源。通过 API 创建时为 `api`,通过 UI 创建时为 `web`。" }, "data_source_detail_dict": { "additionalProperties": true, - "type": "object" + "type": "object", + "description": "详细的数据源信息,包括文件详情。" }, "data_source_info": { "anyOf": [ @@ -17381,7 +17728,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "原始数据源信息,随 `data_source_type` 而异。" }, "data_source_type": { "anyOf": [ @@ -17392,7 +17740,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档的创建方式。文件上传为 `upload_file`,Notion 导入为 `notion_import`。" }, "dataset_process_rule_id": { "anyOf": [ @@ -17403,7 +17752,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "应用于该文档的处理规则 ID。" }, "disabled_at": { "anyOf": [ @@ -17414,7 +17764,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档被禁用的时间戳。启用时为 `null`。" }, "disabled_by": { "anyOf": [ @@ -17425,7 +17776,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "禁用该文档的用户 ID。启用时为 `null`。" }, "display_status": { "anyOf": [ @@ -17436,7 +17788,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "基于 `indexing_status` 和 `enabled` 状态派生的面向用户的显示状态。" }, "doc_form": { "anyOf": [ @@ -17447,13 +17800,15 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档分块模式。`text_model` 表示标准文本分块,`hierarchical_model` 表示父子结构,`qa_model` 表示问答对提取。" }, "doc_metadata": { "items": { "$ref": "#/components/schemas/DocumentMetadataResponse" }, - "type": "array" + "type": "array", + "description": "分配给该文档的元数据值。" }, "enabled": { "anyOf": [ @@ -17464,7 +17819,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "该文档是否启用检索。" }, "error": { "anyOf": [ @@ -17475,7 +17831,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "索引失败时的错误消息。无错误时为 `null`。" }, "hit_count": { "anyOf": [ @@ -17486,10 +17843,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "该文档在检索查询中被匹配的次数。" }, "id": { - "type": "string" + "type": "string", + "description": "文档的唯一标识符。" }, "indexing_status": { "anyOf": [ @@ -17500,10 +17859,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "当前索引状态。`waiting` 表示排队中,`parsing` 表示正在提取内容,`cleaning` 表示正在去噪,`splitting` 表示正在分块,`indexing` 表示正在构建向量,`completed` 表示就绪,`error` 表示失败,`paused` 表示手动暂停。" }, "name": { - "type": "string" + "type": "string", + "description": "文档名称。" }, "need_summary": { "anyOf": [ @@ -17514,7 +17875,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "是否需要为该文档生成摘要。" }, "position": { "anyOf": [ @@ -17525,7 +17887,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档在列表中的显示位置。" }, "summary_index_status": { "anyOf": [ @@ -17536,7 +17899,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "该文档的摘要索引状态。未配置摘要索引时为 `null`。" }, "tokens": { "anyOf": [ @@ -17547,7 +17911,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档中的令牌总数。" }, "word_count": { "anyOf": [ @@ -17558,7 +17923,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文档的总字数。" } }, "required": [ @@ -17574,7 +17940,8 @@ "items": { "$ref": "#/components/schemas/DocumentStatusResponse" }, - "type": "array" + "type": "array", + "description": "索引状态条目列表。" } }, "required": [ @@ -17603,7 +17970,8 @@ { "type": "null" } - ] + ], + "description": "清洗完成的 Unix 时间戳。" }, "completed_at": { "anyOf": [ @@ -17613,7 +17981,8 @@ { "type": "null" } - ] + ], + "description": "索引完成的 Unix 时间戳。" }, "completed_segments": { "anyOf": [ @@ -17624,7 +17993,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "已索引的分段数。" }, "error": { "anyOf": [ @@ -17634,7 +18004,8 @@ { "type": "null" } - ] + ], + "description": "索引失败时的错误信息。无错误时为 `null`。" }, "error_code": { "anyOf": [ @@ -17659,10 +18030,12 @@ "default": null }, "id": { - "type": "string" + "type": "string", + "description": "文档标识符。" }, "indexing_status": { - "type": "string" + "type": "string", + "description": "当前索引状态:`waiting`、`parsing`、`cleaning`、`splitting`、`indexing`、`completed` 或 `error`。" }, "parsing_completed_at": { "anyOf": [ @@ -17672,7 +18045,8 @@ { "type": "null" } - ] + ], + "description": "解析完成的 Unix 时间戳。" }, "paused_at": { "anyOf": [ @@ -17682,7 +18056,8 @@ { "type": "null" } - ] + ], + "description": "索引暂停的时间戳。未暂停时为 `null`。" }, "processing_started_at": { "anyOf": [ @@ -17692,7 +18067,8 @@ { "type": "null" } - ] + ], + "description": "处理开始的 Unix 时间戳。" }, "splitting_completed_at": { "anyOf": [ @@ -17702,7 +18078,8 @@ { "type": "null" } - ] + ], + "description": "拆分完成的 Unix 时间戳。" }, "stopped_at": { "anyOf": [ @@ -17712,7 +18089,8 @@ { "type": "null" } - ] + ], + "description": "索引停止的时间戳。未停止时为 `null`。" }, "total_segments": { "anyOf": [ @@ -17723,7 +18101,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "待索引的分段总数。" }, "vector_space_limit_mb": { "anyOf": [ @@ -18077,27 +18456,32 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "当 `allowed_file_types` 包含 `custom` 时允许的文件扩展名。扩展名可以包含或省略前导 `.`,匹配时不区分大小写。选择 `custom` 时,此列表必须至少包含一个扩展名。" }, "allowed_file_types": { "items": { "$ref": "#/components/schemas/FileType" }, - "type": "array" + "type": "array", + "description": "接收人可上传的文件类别:`image`、`document`、`audio`、`video` 或 `custom`。" }, "allowed_file_upload_methods": { "items": { "$ref": "#/components/schemas/FileTransferMethod" }, - "type": "array" + "type": "array", + "description": "接收人可使用的上传方式:`local_file` 或 `remote_url`。" }, "output_variable_name": { - "type": "string" + "type": "string", + "description": "用于在工作流中引用该输入提交值的变量名。" }, "type": { "const": "file", "default": "file", - "type": "string" + "type": "string", + "description": "`file`,用于上传单个文件。" } }, "required": [ @@ -18111,32 +18495,38 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "当 `allowed_file_types` 包含 `custom` 时允许的文件扩展名。扩展名可以包含或省略前导 `.`,匹配时不区分大小写。选择 `custom` 时,此列表必须至少包含一个扩展名。`file` 和 `file-list` 输入会包含此字段。" }, "allowed_file_types": { "items": { "$ref": "#/components/schemas/FileType" }, - "type": "array" + "type": "array", + "description": "接收人可上传的文件类别。`file` 和 `file-list` 输入会包含此字段。可用值:`image`、`document`、`audio`、`video`、`custom`。" }, "allowed_file_upload_methods": { "items": { "$ref": "#/components/schemas/FileTransferMethod" }, - "type": "array" + "type": "array", + "description": "接收人可使用的上传方式。可用值:`local_file`、`remote_url`。`file` 和 `file-list` 输入会包含此字段。" }, "number_limits": { "default": 0, "minimum": 0, - "type": "integer" + "type": "integer", + "description": "接收人可上传的最大文件数。仅 `file-list` 输入会包含此字段。" }, "output_variable_name": { - "type": "string" + "type": "string", + "description": "引用该输入提交值在工作流中使用的变量名。对应提交 `inputs` 对象中的键。" }, "type": { "const": "file-list", "default": "file-list", - "type": "string" + "type": "string", + "description": "`file-list`,用于上传多个文件。" } }, "required": [ @@ -18165,7 +18555,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "关联的会话 ID。" }, "created_at": { "anyOf": [ @@ -18177,7 +18568,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "上传时间戳(Unix 纪元秒)。" }, "created_by": { "anyOf": [ @@ -18189,7 +18581,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "上传者的终端用户 ID。可通过 [获取终端用户信息](/zh/api-reference/end-users/get-end-user-info) 查询详情。" }, "extension": { "anyOf": [ @@ -18200,7 +18593,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文件扩展名。" }, "file_key": { "anyOf": [ @@ -18211,11 +18605,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "未使用,始终为 `null`。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "唯一文件 ID。" }, "mime_type": { "anyOf": [ @@ -18226,10 +18622,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文件的 MIME 类型。" }, "name": { - "type": "string" + "type": "string", + "description": "文件名。" }, "original_url": { "anyOf": [ @@ -18240,7 +18638,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文件的原始 URL。" }, "preview_url": { "anyOf": [ @@ -18251,7 +18650,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文件的预览 URL。" }, "reference": { "anyOf": [ @@ -18262,10 +18662,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "在 Agent 和工具场景中附加文件时内部使用的不透明文件引用。通过此端点上传的文件始终为 `null`。" }, "size": { - "type": "integer" + "type": "integer", + "description": "文件大小(字节)。" }, "source_url": { "anyOf": [ @@ -18276,7 +18678,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文件的签名下载 URL。" }, "tenant_id": { "anyOf": [ @@ -18288,7 +18691,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "关联的租户 ID。" }, "user_id": { "anyOf": [ @@ -18300,7 +18704,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "未使用,始终为 `null`。" } }, "required": [ @@ -18352,21 +18757,26 @@ { "$ref": "#/components/schemas/FileListInputConfig" } - ] + ], + "description": "表单输入字段定义。" }, "HitTestingChildChunk": { "properties": { "content": { - "type": "string" + "type": "string", + "description": "子分段的文本内容。" }, "id": { - "type": "string" + "type": "string", + "description": "子分段的唯一标识符。" }, "position": { - "type": "integer" + "type": "integer", + "description": "子分段在父分段中的位置。" }, "score": { - "type": "number" + "type": "number", + "description": "子分段的相关性得分。" } }, "required": [ @@ -18380,7 +18790,8 @@ "HitTestingDocument": { "properties": { "data_source_type": { - "type": "string" + "type": "string", + "description": "文档的创建方式。" }, "doc_metadata": { "anyOf": [ @@ -18388,7 +18799,8 @@ { "type": "null" } - ] + ], + "description": "文档的元数据值。未配置元数据时为 `null`。" }, "doc_type": { "anyOf": [ @@ -18398,13 +18810,16 @@ { "type": "null" } - ] + ], + "description": "文档类型分类。未设置时为 `null`。" }, "id": { - "type": "string" + "type": "string", + "description": "文档的唯一标识符。" }, "name": { - "type": "string" + "type": "string", + "description": "文档名称。" } }, "required": [ @@ -18419,22 +18834,28 @@ "HitTestingFile": { "properties": { "extension": { - "type": "string" + "type": "string", + "description": "文件扩展名。" }, "id": { - "type": "string" + "type": "string", + "description": "附件文件标识符。" }, "mime_type": { - "type": "string" + "type": "string", + "description": "文件的 MIME 类型。" }, "name": { - "type": "string" + "type": "string", + "description": "原始文件名。" }, "size": { - "type": "integer" + "type": "integer", + "description": "文件大小(字节)。" }, "source_url": { - "type": "string" + "type": "string", + "description": "访问附件的 URL。" } }, "required": [ @@ -18514,7 +18935,8 @@ "HitTestingQuery": { "properties": { "content": { - "type": "string" + "type": "string", + "description": "查询文本。" } }, "required": [ @@ -18528,13 +18950,15 @@ "items": { "$ref": "#/components/schemas/HitTestingChildChunk" }, - "type": "array" + "type": "array", + "description": "使用分层索引时,分段内匹配的子分段。" }, "files": { "items": { "$ref": "#/components/schemas/HitTestingFile" }, - "type": "array" + "type": "array", + "description": "附加到该分段的文件。" }, "score": { "anyOf": [ @@ -18544,7 +18968,8 @@ { "type": "null" } - ] + ], + "description": "相关性得分。" }, "segment": { "$ref": "#/components/schemas/HitTestingSegment" @@ -18557,7 +18982,8 @@ { "type": "null" } - ] + ], + "description": "通过摘要索引检索到的摘要内容。" }, "tsne_position": { "anyOf": [ @@ -18565,7 +18991,8 @@ { "type": "null" } - ] + ], + "description": "t-SNE 可视化位置。" } }, "required": [ @@ -18587,7 +19014,8 @@ "items": { "$ref": "#/components/schemas/HitTestingRecord" }, - "type": "array" + "type": "array", + "description": "匹配的检索记录列表。" } }, "required": [ @@ -18606,7 +19034,8 @@ { "type": "null" } - ] + ], + "description": "回答内容,用于问答模式文档。" }, "completed_at": { "anyOf": [ @@ -18616,16 +19045,20 @@ { "type": "null" } - ] + ], + "description": "索引完成的时间戳。尚未完成时为 `null`。" }, "content": { - "type": "string" + "type": "string", + "description": "分段的文本内容。" }, "created_at": { - "type": "integer" + "type": "integer", + "description": "创建时间戳(Unix 纪元,单位为秒)。" }, "created_by": { - "type": "string" + "type": "string", + "description": "创建该分段的用户 ID。" }, "disabled_at": { "anyOf": [ @@ -18635,7 +19068,8 @@ { "type": "null" } - ] + ], + "description": "分段被禁用的时间戳。启用时为 `null`。" }, "disabled_by": { "anyOf": [ @@ -18645,16 +19079,19 @@ { "type": "null" } - ] + ], + "description": "禁用该分段的用户 ID。启用时为 `null`。" }, "document": { "$ref": "#/components/schemas/HitTestingDocument" }, "document_id": { - "type": "string" + "type": "string", + "description": "该分段所属文档的 ID。" }, "enabled": { - "type": "boolean" + "type": "boolean", + "description": "该分段是否启用检索。" }, "error": { "anyOf": [ @@ -18664,13 +19101,16 @@ { "type": "null" } - ] + ], + "description": "索引失败时的错误消息。无错误时为 `null`。" }, "hit_count": { - "type": "integer" + "type": "integer", + "description": "该分段在检索查询中被匹配的次数。" }, "id": { - "type": "string" + "type": "string", + "description": "分段的唯一标识符。" }, "index_node_hash": { "anyOf": [ @@ -18680,7 +19120,8 @@ { "type": "null" } - ] + ], + "description": "索引内容的哈希值,用于检测变更。" }, "index_node_id": { "anyOf": [ @@ -18690,7 +19131,8 @@ { "type": "null" } - ] + ], + "description": "向量存储中索引节点的 ID。" }, "indexing_at": { "anyOf": [ @@ -18700,16 +19142,19 @@ { "type": "null" } - ] + ], + "description": "索引开始的时间戳。尚未开始时为 `null`。" }, "keywords": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "与该分段关联的关键词,用于基于关键词的检索。" }, "position": { - "type": "integer" + "type": "integer", + "description": "分段在文档中的位置。" }, "sign_content": { "anyOf": [ @@ -18719,10 +19164,12 @@ { "type": "null" } - ] + ], + "description": "用于完整性验证的签名内容哈希。" }, "status": { - "type": "string" + "type": "string", + "description": "分段的索引状态。" }, "stopped_at": { "anyOf": [ @@ -18732,13 +19179,16 @@ { "type": "null" } - ] + ], + "description": "索引停止的时间戳。未停止时为 `null`。" }, "tokens": { - "type": "integer" + "type": "integer", + "description": "分段内容的令牌数。" }, "word_count": { - "type": "integer" + "type": "integer", + "description": "分段内容的字数。" } }, "required": [ @@ -18780,28 +19230,33 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Unix 时间戳(秒),超过该时间后表单将不可提交。" }, "form_content": { - "type": "string" + "type": "string", + "description": "已替换工作流变量的预渲染表单正文。" }, "inputs": { "items": { "$ref": "#/components/schemas/FormInputConfig" }, - "type": "array" + "type": "array", + "description": "表单输入字段定义。" }, "resolved_default_values": { "additionalProperties": { "type": "string" }, - "type": "object" + "type": "object", + "description": "用于在表单中展示的预渲染默认值,按输入的 `output_variable_name` 分组。仅当 `paragraph` 输入的默认值可由工作流变量解析时填充;无可解析默认值的输入为空。客户端请直接展示这些值,无需在前端再次解析 `default`。所有值均为字符串。" }, "user_actions": { "items": { "$ref": "#/components/schemas/UserActionConfig" }, - "type": "array" + "type": "array", + "description": "可用的提交操作。" } }, "required": [ @@ -18886,7 +19341,8 @@ "type": "object" }, "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" } }, "required": [ @@ -18966,16 +19422,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "绑定到该标签的知识库数量。" }, "id": { - "type": "string" + "type": "string", + "description": "标签标识符。" }, "name": { - "type": "string" + "type": "string", + "description": "标签显示名称。" }, "type": { - "type": "string" + "type": "string", + "description": "标签类型。知识库标签始终为 `knowledge`。" } }, "required": [ @@ -19049,13 +19509,15 @@ "description": "反馈评分。设为 `null` 可撤销之前提交的反馈。" }, "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" } }, "required": [ "user" ], - "type": "object" + "type": "object", + "description": "提交消息反馈的请求体。" }, "MessageFile": { "properties": { @@ -19068,14 +19530,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "该文件的所属者。用户上传的文件为 `user`,助手生成的文件为 `assistant`。" }, "filename": { - "type": "string" + "type": "string", + "description": "原始文件名。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "File ID." }, "mime_type": { "anyOf": [ @@ -19086,7 +19551,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文件的 MIME 类型。" }, "size": { "anyOf": [ @@ -19097,13 +19563,16 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文件大小(字节)。" }, "transfer_method": { - "type": "string" + "type": "string", + "description": "使用的传输方式。`remote_url` 表示基于 URL 的文件,`local_file` 表示已上传的文件,`tool_file` 表示工具生成的文件。" }, "type": { - "type": "string" + "type": "string", + "description": "文件类型,例如 `image`。" }, "upload_file_id": { "anyOf": [ @@ -19115,7 +19584,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "通过 `local_file` 传输时的上传文件 ID。" }, "url": { "anyOf": [ @@ -19127,7 +19597,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文件的预览 URL。" } }, "required": [ @@ -19136,7 +19607,8 @@ "transfer_method", "type" ], - "type": "object" + "type": "object", + "description": "附加到消息的文件。" }, "MessageInfiniteScrollPagination": { "properties": { @@ -19144,13 +19616,16 @@ "items": { "$ref": "#/components/schemas/MessageListItem" }, - "type": "array" + "type": "array", + "description": "消息列表。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "是否有更多消息。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "每页条目数。" } }, "required": [ @@ -19166,18 +19641,22 @@ "items": { "$ref": "#/components/schemas/AgentThought" }, - "type": "array" + "type": "array", + "description": "该消息的 Agent 思考。" }, "answer": { - "type": "string" + "type": "string", + "description": "助手回答文本。" }, "answer_tokens": { "default": 0, - "type": "integer" + "type": "integer", + "description": "生成回答的 token 数量。" }, "conversation_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "会话 ID。" }, "created_at": { "anyOf": [ @@ -19189,7 +19668,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "创建时间戳(Unix 纪元秒)。" }, "currency": { "anyOf": [ @@ -19200,7 +19680,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "`total_price` 的货币单位(例如 `USD`),无定价信息时为 `null`。" }, "error": { "anyOf": [ @@ -19211,13 +19692,15 @@ "type": "null" } ], - "default": null + "default": null, + "description": "当 `status` 为 `error` 时的错误消息。" }, "extra_contents": { "items": { "$ref": "#/components/schemas/HumanInputContent" }, - "type": "array" + "type": "array", + "description": "与此消息关联的附加执行内容,例如 Chatflow 工作流中人工介入节点的表单数据。" }, "feedback": { "anyOf": [ @@ -19228,27 +19711,32 @@ "type": "null" } ], - "default": null + "default": null, + "description": "该消息的用户反馈。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "消息 ID。" }, "inputs": { "additionalProperties": { "$ref": "#/components/schemas/JSONValueType" }, - "type": "object" + "type": "object", + "description": "该消息的输入变量。" }, "message_files": { "items": { "$ref": "#/components/schemas/MessageFile" }, - "type": "array" + "type": "array", + "description": "附加到该消息的文件。" }, "message_tokens": { "default": 0, - "type": "integer" + "type": "integer", + "description": "输入消息的 token 数量。" }, "parent_message_id": { "anyOf": [ @@ -19260,24 +19748,29 @@ "type": "null" } ], - "default": null + "default": null, + "description": "线程会话的父消息 ID。" }, "provider_response_latency": { "default": 0, "format": "float", - "type": "number" + "type": "number", + "description": "模型供应商的响应延迟,单位为秒。" }, "query": { - "type": "string" + "type": "string", + "description": "用户查询文本。" }, "retriever_resources": { "items": { "$ref": "#/components/schemas/RetrieverResource" }, - "type": "array" + "type": "array", + "description": "该消息使用的检索资源。" }, "status": { - "type": "string" + "type": "string", + "description": "消息状态。成功消息为 `normal`,生成失败时为 `error`。" }, "total_price": { "anyOf": [ @@ -19289,11 +19782,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "所用 token 的总价,无定价信息时为 `null`。" }, "total_tokens": { "readOnly": true, - "type": "integer" + "type": "integer", + "description": "使用的 token 总数,即 `message_tokens` 与 `answer_tokens` 之和。" } }, "required": [ @@ -19516,7 +20011,8 @@ "OptionalServiceApiUserPayload": { "properties": { "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" } }, "type": "object" @@ -19532,15 +20028,18 @@ "type": "null" } ], - "default": null + "default": null, + "description": "表单输入的默认值配置。" }, "output_variable_name": { - "type": "string" + "type": "string", + "description": "存储输入值的变量名称。" }, "type": { "const": "paragraph", "default": "paragraph", - "type": "string" + "type": "string", + "description": "`paragraph`,用于输入多行文本。" } }, "required": [ @@ -19553,10 +20052,12 @@ "annotation_reply": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用此功能。" } }, - "type": "object" + "type": "object", + "description": "标注回复功能配置。" }, "file_upload": { "properties": { @@ -19595,19 +20096,23 @@ "image": { "properties": { "detail": { - "type": "string" + "type": "string", + "description": "视觉模型的图像细节级别。" }, "enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用图片上传。" }, "number_limits": { - "type": "integer" + "type": "integer", + "description": "可上传的最大图片数量。" }, "transfer_methods": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "图片上传允许的传输方式。`remote_url` 表示通过文件 URL 上传,`local_file` 表示上传本地文件。" } }, "type": "object" @@ -19616,15 +20121,18 @@ "type": "integer" } }, - "type": "object" + "type": "object", + "description": "文件上传配置。" }, "more_like_this": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用此功能。" } }, - "type": "object" + "type": "object", + "description": "更多类似推荐功能配置。" }, "opening_statement": { "anyOf": [ @@ -19635,45 +20143,55 @@ "type": "null" } ], - "default": null + "default": null, + "description": "开场白文本。" }, "retriever_resource": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用此功能。" } }, - "type": "object" + "type": "object", + "description": "知识检索引用资源配置。" }, "sensitive_word_avoidance": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用此功能。" } }, - "type": "object" + "type": "object", + "description": "内容审核功能配置。" }, "speech_to_text": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用此功能。" } }, - "type": "object" + "type": "object", + "description": "语音转文字功能配置。" }, "suggested_questions": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "建议问题列表。" }, "suggested_questions_after_answer": { "properties": { "enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用此功能。" } }, - "type": "object" + "type": "object", + "description": "回答后建议问题的配置。" }, "system_parameters": { "$ref": "#/components/schemas/SystemParameters" @@ -19681,19 +20199,24 @@ "text_to_speech": { "properties": { "autoPlay": { - "type": "string" + "type": "string", + "description": "自动播放设置。`enabled` 为自动播放音频,`disabled` 为需要手动播放。" }, "enabled": { - "type": "boolean" + "type": "boolean", + "description": "是否启用此功能。" }, "language": { - "type": "string" + "type": "string", + "description": "TTS 语言。" }, "voice": { - "type": "string" + "type": "string", + "description": "TTS 声音标识符。" } }, - "type": "object" + "type": "object", + "description": "文字转语音功能配置。" }, "user_input_form": { "items": { @@ -19746,7 +20269,9 @@ "additionalProperties": true, "type": "object" }, - "default": {}, + "default": { + "description": "输入字段的默认值。" + }, "description": { "type": "string" }, @@ -19765,7 +20290,8 @@ ] }, "label": { - "type": "string" + "type": "string", + "description": "输入字段的显示标签。" }, "max_length": { "anyOf": [ @@ -19784,7 +20310,8 @@ "type": "array" }, "required": { - "type": "boolean" + "type": "boolean", + "description": "该字段是否必填。" }, "type": { "enum": [ @@ -19801,7 +20328,8 @@ "type": "string" }, "variable": { - "type": "string" + "type": "string", + "description": "工作流中使用的变量名称。" } }, "required": [ @@ -19814,7 +20342,8 @@ "required": [ "text-input" ], - "type": "object" + "type": "object", + "title": "Text Input" }, { "additionalProperties": false, @@ -19864,7 +20393,9 @@ "additionalProperties": true, "type": "object" }, - "default": {}, + "default": { + "description": "默认选中的值。" + }, "description": { "type": "string" }, @@ -19883,7 +20414,8 @@ ] }, "label": { - "type": "string" + "type": "string", + "description": "下拉选择字段的显示标签。" }, "max_length": { "anyOf": [ @@ -19899,10 +20431,12 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "此表单控件的可选值列表。" }, "required": { - "type": "boolean" + "type": "boolean", + "description": "该字段是否必填。" }, "type": { "enum": [ @@ -19919,7 +20453,8 @@ "type": "string" }, "variable": { - "type": "string" + "type": "string", + "description": "工作流中使用的变量名称。" } }, "required": [ @@ -19932,7 +20467,8 @@ "required": [ "select" ], - "type": "object" + "type": "object", + "title": "Select" }, { "additionalProperties": false, @@ -19982,7 +20518,9 @@ "additionalProperties": true, "type": "object" }, - "default": {}, + "default": { + "description": "段落字段的默认值。" + }, "description": { "type": "string" }, @@ -20001,7 +20539,8 @@ ] }, "label": { - "type": "string" + "type": "string", + "description": "段落字段的显示标签。" }, "max_length": { "anyOf": [ @@ -20020,7 +20559,8 @@ "type": "array" }, "required": { - "type": "boolean" + "type": "boolean", + "description": "该字段是否必填。" }, "type": { "enum": [ @@ -20037,7 +20577,8 @@ "type": "string" }, "variable": { - "type": "string" + "type": "string", + "description": "工作流中使用的变量名称。" } }, "required": [ @@ -20050,7 +20591,8 @@ "required": [ "paragraph" ], - "type": "object" + "type": "object", + "title": "Paragraph" }, { "additionalProperties": false, @@ -20763,7 +21305,8 @@ ], "type": "object" }, - "type": "array" + "type": "array", + "description": "用户输入表单配置。" } }, "required": [ @@ -21031,16 +21574,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "上传时间戳(ISO 8601 格式)。在记录创建过程中可能为 `null`。" }, "created_by": { - "type": "string" + "type": "string", + "description": "上传文件的用户 ID。" }, "extension": { - "type": "string" + "type": "string", + "description": "文件扩展名。" }, "id": { - "type": "string" + "type": "string", + "description": "已上传文件的唯一标识符。" }, "mime_type": { "anyOf": [ @@ -21051,13 +21598,16 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文件的 MIME 类型。若上传未包含 MIME 类型则可能为 `null`。" }, "name": { - "type": "string" + "type": "string", + "description": "原始文件名。" }, "size": { - "type": "integer" + "type": "integer", + "description": "文件大小(字节)。" } }, "required": [ @@ -21125,7 +21675,8 @@ "properties": { "deprecated": { "default": false, - "type": "boolean" + "type": "boolean", + "description": "模型是否已弃用。" }, "features": { "anyOf": [ @@ -21139,31 +21690,36 @@ "type": "null" } ], - "default": null + "default": null, + "description": "模型支持的功能,无功能时为 `null`。" }, "fetch_from": { "$ref": "#/components/schemas/FetchFrom" }, "has_invalid_load_balancing_configs": { "default": false, - "type": "boolean" + "type": "boolean", + "description": "模型是否存在无效的负载均衡配置。" }, "label": { "$ref": "#/components/schemas/I18nObject" }, "load_balancing_enabled": { "default": false, - "type": "boolean" + "type": "boolean", + "description": "模型是否启用负载均衡。" }, "model": { - "type": "string" + "type": "string", + "description": "模型标识符。创建或更新知识库时,将此值作为 `embedding_model` 参数使用。" }, "model_properties": { "additionalProperties": true, "propertyNames": { "$ref": "#/components/schemas/ModelPropertyKey" }, - "type": "object" + "type": "object", + "description": "模型特定的属性,例如 `context_size`。" }, "model_type": { "$ref": "#/components/schemas/ModelType" @@ -21188,7 +21744,8 @@ "items": { "$ref": "#/components/schemas/ProviderWithModelsResponse" }, - "type": "array" + "type": "array", + "description": "模型供应商及其可用模型的列表。" } }, "required": [ @@ -21207,7 +21764,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "供应商小图标的 URL。" }, "icon_small_dark": { "anyOf": [ @@ -21218,7 +21776,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "深色模式图标 URL;供应商没有时为 `null`。" }, "label": { "$ref": "#/components/schemas/I18nObject" @@ -21227,16 +21786,19 @@ "items": { "$ref": "#/components/schemas/ProviderModelWithStatusEntity" }, - "type": "array" + "type": "array", + "description": "该供应商的可用模型列表。" }, "provider": { - "type": "string" + "type": "string", + "description": "模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。旧版供应商可能返回简写形式(例如 `openai`)。" }, "status": { "$ref": "#/components/schemas/CustomConfigurationStatus" }, "tenant_id": { - "type": "string" + "type": "string", + "description": "该供应商配置所属的工作空间 ID。" } }, "required": [ @@ -21273,6 +21835,7 @@ "RequiredServiceApiUserPayload": { "properties": { "user": { + "description": "由你的应用定义且在应用内唯一的终端用户标识。", "type": "string" } }, @@ -21312,7 +21875,8 @@ "ResultResponse": { "properties": { "result": { - "type": "string" + "type": "string", + "description": "操作结果,固定为 `success`。" } }, "required": [ @@ -21388,10 +21952,12 @@ "SegmentAttachmentResponse": { "properties": { "extension": { - "type": "string" + "type": "string", + "description": "文件扩展名。" }, "id": { - "type": "string" + "type": "string", + "description": "附件文件标识符。" }, "mime_type": { "anyOf": [ @@ -21401,16 +21967,20 @@ { "type": "null" } - ] + ], + "description": "文件的 MIME 类型。" }, "name": { - "type": "string" + "type": "string", + "description": "原始文件名。" }, "size": { - "type": "integer" + "type": "integer", + "description": "文件大小(字节)。" }, "source_url": { - "type": "string" + "type": "string", + "description": "访问附件的 URL。" } }, "required": [ @@ -21483,10 +22053,12 @@ "items": { "$ref": "#/components/schemas/SegmentResponse" }, - "type": "array" + "type": "array", + "description": "已创建的分段列表。" }, "doc_form": { - "type": "string" + "type": "string", + "description": "该文档使用的分块模式。" } }, "required": [ @@ -21517,7 +22089,8 @@ "$ref": "#/components/schemas/SegmentResponse" }, "doc_form": { - "type": "string" + "type": "string", + "description": "该文档使用的分块模式。" } }, "required": [ @@ -21566,22 +22139,28 @@ "items": { "$ref": "#/components/schemas/SegmentResponse" }, - "type": "array" + "type": "array", + "description": "分段列表。" }, "doc_form": { - "type": "string" + "type": "string", + "description": "该文档使用的分块模式。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "下一页是否还有更多项目。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "每页条目数。" }, "page": { - "type": "integer" + "type": "integer", + "description": "当前页码。" }, "total": { - "type": "integer" + "type": "integer", + "description": "匹配的分段总数。" } }, "required": [ @@ -21604,19 +22183,22 @@ { "type": "null" } - ] + ], + "description": "回答内容,用于问答模式文档。" }, "attachments": { "items": { "$ref": "#/components/schemas/SegmentAttachmentResponse" }, - "type": "array" + "type": "array", + "description": "附加到该分段的文件。" }, "child_chunks": { "items": { "$ref": "#/components/schemas/ChildChunkResponse" }, - "type": "array" + "type": "array", + "description": "属于该分段的子分段。仅在分层模式文档中存在。" }, "completed_at": { "anyOf": [ @@ -21626,16 +22208,20 @@ { "type": "null" } - ] + ], + "description": "索引完成的时间戳。尚未完成时为 `null`。" }, "content": { - "type": "string" + "type": "string", + "description": "分段的文本内容。" }, "created_at": { - "type": "integer" + "type": "integer", + "description": "创建时间戳(Unix 纪元,单位为秒)。" }, "created_by": { - "type": "string" + "type": "string", + "description": "创建该分段的用户 ID。" }, "disabled_at": { "anyOf": [ @@ -21645,7 +22231,8 @@ { "type": "null" } - ] + ], + "description": "分段被禁用的时间戳。启用时为 `null`。" }, "disabled_by": { "anyOf": [ @@ -21655,13 +22242,16 @@ { "type": "null" } - ] + ], + "description": "禁用该分段的用户 ID。启用时为 `null`。" }, "document_id": { - "type": "string" + "type": "string", + "description": "该分段所属文档的 ID。" }, "enabled": { - "type": "boolean" + "type": "boolean", + "description": "该分段是否启用检索。" }, "error": { "anyOf": [ @@ -21671,13 +22261,16 @@ { "type": "null" } - ] + ], + "description": "索引失败时的错误消息。无错误时为 `null`。" }, "hit_count": { - "type": "integer" + "type": "integer", + "description": "该分段在检索查询中被匹配的次数。" }, "id": { - "type": "string" + "type": "string", + "description": "分段的唯一标识符。" }, "index_node_hash": { "anyOf": [ @@ -21687,7 +22280,8 @@ { "type": "null" } - ] + ], + "description": "索引内容的哈希值,用于检测变更。" }, "index_node_id": { "anyOf": [ @@ -21697,7 +22291,8 @@ { "type": "null" } - ] + ], + "description": "向量存储中索引节点的 ID。" }, "indexing_at": { "anyOf": [ @@ -21707,7 +22302,8 @@ { "type": "null" } - ] + ], + "description": "索引开始的时间戳。尚未开始时为 `null`。" }, "keywords": { "anyOf": [ @@ -21720,16 +22316,20 @@ { "type": "null" } - ] + ], + "description": "与该分段关联的关键词,用于基于关键词的检索。" }, "position": { - "type": "integer" + "type": "integer", + "description": "分段在文档中的位置。" }, "sign_content": { - "type": "string" + "type": "string", + "description": "用于完整性验证的签名内容哈希。" }, "status": { - "type": "string" + "type": "string", + "description": "分段的当前索引状态,例如 `completed`、`indexing`、`error`。" }, "stopped_at": { "anyOf": [ @@ -21739,7 +22339,8 @@ { "type": "null" } - ] + ], + "description": "索引停止的时间戳。未停止时为 `null`。" }, "summary": { "anyOf": [ @@ -21749,13 +22350,16 @@ { "type": "null" } - ] + ], + "description": "AI 生成的分段内容摘要。未启用摘要索引时为 `null`。" }, "tokens": { - "type": "integer" + "type": "integer", + "description": "分段内容的令牌数。" }, "updated_at": { - "type": "integer" + "type": "integer", + "description": "最后更新时间戳(Unix 纪元,单位为秒)。" }, "updated_by": { "anyOf": [ @@ -21765,10 +22369,12 @@ { "type": "null" } - ] + ], + "description": "最后更新该分段的用户 ID。" }, "word_count": { - "type": "integer" + "type": "integer", + "description": "分段内容的字数。" } }, "required": [ @@ -21922,15 +22528,18 @@ "SelectInputConfig": { "properties": { "option_source": { - "$ref": "#/components/schemas/StringListSource" + "$ref": "#/components/schemas/StringListSource", + "description": "此下拉选项的来源。`constant` 使用 `value`;`variable` 使用 `selector` 引用的工作流变量。" }, "output_variable_name": { - "type": "string" + "type": "string", + "description": "用于在工作流中引用该输入提交值的变量名。" }, "type": { "const": "select", "default": "select", - "type": "string" + "type": "string", + "description": "`select`,用于从列表中单选。" } }, "required": [ @@ -21942,13 +22551,16 @@ "SimpleAccountResponse": { "properties": { "email": { - "type": "string" + "type": "string", + "description": "账户邮箱地址。" }, "id": { - "type": "string" + "type": "string", + "description": "账户 ID。" }, "name": { - "type": "string" + "type": "string", + "description": "账户显示名称。" } }, "required": [ @@ -21970,17 +22582,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "创建时间戳。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "会话 ID。" }, "inputs": { "additionalProperties": { "$ref": "#/components/schemas/JSONValue" }, - "type": "object" + "type": "object", + "description": "会话的输入变量。" }, "introduction": { "anyOf": [ @@ -21991,13 +22606,16 @@ "type": "null" } ], - "default": null + "default": null, + "description": "会话介绍。" }, "name": { - "type": "string" + "type": "string", + "description": "会话名称。" }, "status": { - "type": "string" + "type": "string", + "description": "会话状态。活跃会话为 `normal`。" }, "updated_at": { "anyOf": [ @@ -22009,7 +22627,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "最后更新时间戳。" } }, "required": [ @@ -22023,10 +22642,12 @@ "SimpleEndUser": { "properties": { "id": { - "type": "string" + "type": "string", + "description": "终端用户 ID。" }, "is_anonymous": { - "type": "boolean" + "type": "boolean", + "description": "终端用户是否为匿名。" }, "session_id": { "anyOf": [ @@ -22037,10 +22658,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "会话标识符。" }, "type": { - "type": "string" + "type": "string", + "description": "终端用户类型。" } }, "required": [ @@ -22061,7 +22684,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "反馈评分。`like` 为正面,`dislike` 为负面。" } }, "type": "object" @@ -22083,10 +22707,12 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "建议问题列表。" }, "result": { - "type": "string" + "type": "string", + "description": "结果状态。" } }, "required": [ @@ -22106,10 +22732,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "聊天主题颜色。" }, "chat_color_theme_inverted": { - "type": "boolean" + "type": "boolean", + "description": "聊天主题颜色是否反转。" }, "copyright": { "anyOf": [ @@ -22120,7 +22748,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "版权文本。" }, "custom_disclaimer": { "anyOf": [ @@ -22131,10 +22760,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "自定义免责声明文本。" }, "default_language": { - "type": "string" + "type": "string", + "description": "默认语言代码。" }, "description": { "anyOf": [ @@ -22145,7 +22776,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Web 应用描述。" }, "icon": { "anyOf": [ @@ -22156,7 +22788,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "图标内容(表情或图片 ID)。" }, "icon_background": { "anyOf": [ @@ -22167,7 +22800,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "图标背景颜色。" }, "icon_type": { "anyOf": [ @@ -22178,7 +22812,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "使用的图标类型。`emoji` 为表情图标,`image` 为上传的图片图标。" }, "icon_url": { "anyOf": [ @@ -22190,7 +22825,8 @@ "type": "null" } ], - "readOnly": true + "readOnly": true, + "description": "图标图片的 URL。" }, "input_placeholder": { "anyOf": [ @@ -22201,7 +22837,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Web 应用消息输入框中显示的占位文本。未配置时为 `null`。" }, "privacy_policy": { "anyOf": [ @@ -22212,16 +22849,20 @@ "type": "null" } ], - "default": null + "default": null, + "description": "隐私政策 URL。" }, "show_workflow_steps": { - "type": "boolean" + "type": "boolean", + "description": "是否显示工作流步骤。" }, "title": { - "type": "string" + "type": "string", + "description": "Web 应用标题。" }, "use_icon_as_answer_icon": { - "type": "boolean" + "type": "boolean", + "description": "是否使用应用图标作为回答图标。" } }, "required": [ @@ -22240,16 +22881,19 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "当 `type` 为 `variable` 时使用的工作流变量引用路径。" }, "type": { - "$ref": "#/components/schemas/ValueSourceType" + "$ref": "#/components/schemas/ValueSourceType", + "description": "`constant` 使用 `value`;`variable` 使用 `selector` 引用的工作流变量。" }, "value": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "当 `type` 为 `constant` 时使用的静态选项列表。" } }, "required": [ @@ -22263,14 +22907,17 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "当 `type` 为 `variable` 时的变量选择器路径。" }, "type": { - "$ref": "#/components/schemas/ValueSourceType" + "$ref": "#/components/schemas/ValueSourceType", + "description": "`constant` 使用 `value`;`variable` 使用 `selector` 引用的工作流变量。" }, "value": { "default": "", - "type": "string" + "type": "string", + "description": "当 `type` 为 `constant` 时的静态值。" } }, "required": [ @@ -22281,19 +22928,24 @@ "SystemParameters": { "properties": { "audio_file_size_limit": { - "type": "integer" + "type": "integer", + "description": "最大音频文件大小(MB)。" }, "file_size_limit": { - "type": "integer" + "type": "integer", + "description": "常规文件最大大小(MB)。" }, "image_file_size_limit": { - "type": "integer" + "type": "integer", + "description": "最大图片文件大小(MB)。" }, "video_file_size_limit": { - "type": "integer" + "type": "integer", + "description": "最大视频文件大小(MB)。" }, "workflow_file_upload_limit": { - "type": "integer" + "type": "integer", + "description": "每次工作流执行的最大文件数量。" } }, "required": [ @@ -22511,7 +23163,8 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" }, "voice": { "anyOf": [ @@ -22525,7 +23178,8 @@ "default": null } }, - "type": "object" + "type": "object", + "description": "文字转语音的请求体。提供 `message_id` 或 `text` 其中之一。" }, "ToolIcon": { "properties": { @@ -22545,7 +23199,8 @@ "UrlResponse": { "properties": { "url": { - "type": "string" + "type": "string", + "description": "用于下载原始上传文件的签名 URL。" } }, "required": [ @@ -22557,16 +23212,19 @@ "properties": { "button_style": { "$ref": "#/components/schemas/ButtonStyle", - "default": "default" + "default": "default", + "description": "按钮样式:`primary`、`default`、`accent` 或 `ghost`。" }, "id": { "maxLength": 20, "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "type": "string" + "type": "string", + "description": "操作按钮标识。提交表单时,将其作为 `action` 的值。" }, "title": { "maxLength": 100, - "type": "string" + "type": "string", + "description": "向接收人显示的按钮文本。" } }, "required": [ @@ -22667,19 +23325,24 @@ "items": { "$ref": "#/components/schemas/WorkflowAppLogPartialResponse" }, - "type": "array" + "type": "array", + "description": "工作流日志条目列表。" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "是否有更多可用页面。" }, "limit": { - "type": "integer" + "type": "integer", + "description": "每页条目数。" }, "page": { - "type": "integer" + "type": "integer", + "description": "当前页码。" }, "total": { - "type": "integer" + "type": "integer", + "description": "日志条目总数。" } }, "required": [ @@ -22703,7 +23366,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "日志条目创建时的 Unix 时间戳。" }, "created_by_account": { "anyOf": [ @@ -22714,7 +23378,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "由管理员用户创建时的账户详情。" }, "created_by_end_user": { "anyOf": [ @@ -22736,7 +23401,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "创建者的角色(例如 `end_user`、`account`)。" }, "created_from": { "anyOf": [ @@ -22747,7 +23413,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流运行的来源(例如 `service-api`)。" }, "details": { "anyOf": [ @@ -22775,11 +23442,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "日志条目的附加详情。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "日志条目 ID。" }, "workflow_run": { "anyOf": [ @@ -22823,11 +23492,13 @@ "properties": { "created_at": { "format": "int64", - "type": "integer" + "type": "integer", + "description": "工作流运行创建时的 Unix 时间戳。" }, "elapsed_time": { "format": "float", - "type": "number" + "type": "number", + "description": "总耗时(秒)。" }, "error": { "anyOf": [ @@ -22837,7 +23508,8 @@ { "type": "null" } - ] + ], + "description": "工作流失败时的错误消息。" }, "finished_at": { "anyOf": [ @@ -22848,11 +23520,13 @@ { "type": "null" } - ] + ], + "description": "工作流运行结束时的 Unix 时间戳。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "工作流运行 ID。" }, "outputs": { "anyOf": [ @@ -22863,7 +23537,8 @@ { "type": "null" } - ] + ], + "description": "工作流的输出数据。" }, "status": { "enum": [ @@ -22872,17 +23547,21 @@ "stopped", "succeeded" ], - "type": "string" + "type": "string", + "description": "工作流执行状态。`running` 表示执行中,`succeeded` 表示成功完成,`failed` 表示执行出错,`stopped` 表示手动停止,`partial-succeeded` 表示部分节点成功但其他失败,`paused` 表示等待人工介入。" }, "total_steps": { - "type": "integer" + "type": "integer", + "description": "已执行的工作流总步数。" }, "total_tokens": { - "type": "integer" + "type": "integer", + "description": "所有节点消耗的总令牌数。" }, "workflow_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "工作流 ID." } }, "required": [ @@ -22907,11 +23586,13 @@ }, "task_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "进行中的执行任务 ID。配合 [停止工作流任务](/zh/api-reference/workflow-runs/stop-workflow-task) 使用以取消运行中的工作流。仅在执行期间有效。" }, "workflow_run_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "此工作流运行记录的持久化标识符。配合 [获取工作流运行详情](/zh/api-reference/workflow-runs/get-workflow-run-detail) 使用以在执行后获取结果。" } }, "required": [ @@ -23265,7 +23946,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流运行创建时的 Unix 时间戳。" }, "elapsed_time": { "anyOf": [ @@ -23280,7 +23962,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "总耗时(秒)。" }, "error": { "anyOf": [ @@ -23291,7 +23974,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流失败时的错误消息。" }, "exceptions_count": { "anyOf": [ @@ -23302,7 +23986,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "执行期间发生的异常数量。" }, "finished_at": { "anyOf": [ @@ -23314,11 +23999,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流运行结束时的 Unix 时间戳。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "工作流运行 ID。" }, "status": { "anyOf": [ @@ -23329,7 +24016,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流执行状态。`running` 表示执行中,`succeeded` 表示成功完成,`failed` 表示执行出错,`stopped` 表示手动停止,`partial-succeeded` 表示部分节点成功但其他失败,`paused` 表示等待人工介入。" }, "total_steps": { "anyOf": [ @@ -23340,7 +24028,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "已执行的工作流总步数。" }, "total_tokens": { "anyOf": [ @@ -23351,7 +24040,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "消耗的总令牌数。" }, "triggered_from": { "anyOf": [ @@ -23362,7 +24052,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "触发工作流运行的来源。`app-run` 表示从应用或 API 发起的运行,`webhook` 表示由 Webhook 触发器发起的运行,`schedule` 表示由定时触发器发起的运行,`plugin` 表示由集成触发器发起的运行。" }, "version": { "anyOf": [ @@ -23373,7 +24064,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流版本标识符。" } }, "required": [ @@ -23766,7 +24458,8 @@ "default": null }, "user": { - "type": "string" + "type": "string", + "description": "由你的应用定义且在应用内唯一的终端用户标识。" } }, "required": [ @@ -23787,7 +24480,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流运行创建时的 Unix 时间戳。" }, "elapsed_time": { "anyOf": [ @@ -23802,7 +24496,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "总耗时(秒)。" }, "error": { "anyOf": [ @@ -23813,7 +24508,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流失败时的错误消息。" }, "finished_at": { "anyOf": [ @@ -23825,11 +24521,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流运行结束时的 Unix 时间戳。" }, "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "工作流运行 ID。" }, "inputs": { "anyOf": [ @@ -23857,14 +24555,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流运行的输入变量。根据存储后端,返回值可能是已解析的 JSON 值,也可能是 JSON 编码字符串(例如 `{\"query\": \"...\"}`);字符串需由客户端解析。也可能为 `null`。" }, "outputs": { "additionalProperties": true, - "type": "object" + "type": "object", + "description": "工作流的输出数据。尚无输出时为空对象。" }, "status": { - "type": "string" + "type": "string", + "description": "工作流执行状态。`running` 表示执行中,`succeeded` 表示成功完成,`failed` 表示执行出错,`stopped` 表示手动停止,`partial-succeeded` 表示部分节点成功但其他失败,`paused` 表示等待人工介入。" }, "total_steps": { "anyOf": [ @@ -23875,7 +24576,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "已执行的工作流总步数。" }, "total_tokens": { "anyOf": [ @@ -23886,11 +24588,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "消耗的总令牌数。" }, "workflow_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "工作流 ID." } }, "required": [ From 1a829267980ef00400f640314cbbe36079b88df7 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 26 Aug 2026 09:52:40 +0800 Subject: [PATCH 05/10] fix: restore verified service api field details --- en/api-reference/openapi_service.json | 16 ++++++++-------- ja/api-reference/openapi_service.json | 21 +++++++++++++-------- zh/api-reference/openapi_service.json | 21 +++++++++++++-------- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/en/api-reference/openapi_service.json b/en/api-reference/openapi_service.json index 919335ee84..8eff241945 100644 --- a/en/api-reference/openapi_service.json +++ b/en/api-reference/openapi_service.json @@ -16096,7 +16096,7 @@ } ], "default": null, - "description": "Embedding model provider. Use the `provider` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). A bare name like `openai` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", "title": "Embedding Model Provider" }, "external_knowledge_api_id": { @@ -17530,7 +17530,7 @@ } ], "default": null, - "description": "Embedding model provider. Use the `provider` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). A bare name like `openai` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", "title": "Embedding Model Provider" }, "external_knowledge_api_id": { @@ -20904,7 +20904,7 @@ "MetadataArgs": { "properties": { "name": { - "description": "Metadata field name.", + "description": "Metadata field name. Must be unique within the knowledge base, must not match a built-in field name, and must be at most 255 characters.", "title": "Name", "type": "string" }, @@ -21028,7 +21028,7 @@ "MetadataUpdatePayload": { "properties": { "name": { - "description": "New metadata field name.", + "description": "New metadata field name. Must be unique within the knowledge base, must not match a built-in field name, and must be at most 255 characters.", "title": "Name", "type": "string" } @@ -23043,7 +23043,7 @@ } ], "default": null, - "description": "Provider name of the reranking model.", + "description": "Reranking model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/cohere/cohere`). A bare name like `cohere` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=rerank`.", "title": "Reranking Provider Name" } }, @@ -24284,7 +24284,7 @@ "TagBindingPayload": { "properties": { "tag_ids": { - "description": "Tag IDs to bind.", + "description": "IDs of the tags to bind. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags). Unknown tag IDs are silently ignored.", "items": { "type": "string" }, @@ -24308,7 +24308,7 @@ "TagCreatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "Tag name. Must be unique within the workspace.", "maxLength": 50, "minLength": 1, "title": "Name", @@ -24405,7 +24405,7 @@ "TagUpdatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "New tag name. Must be unique within the workspace.", "maxLength": 50, "minLength": 1, "title": "Name", diff --git a/ja/api-reference/openapi_service.json b/ja/api-reference/openapi_service.json index f619865f5e..0ea1b5a691 100644 --- a/ja/api-reference/openapi_service.json +++ b/ja/api-reference/openapi_service.json @@ -15542,7 +15542,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。`openai` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `provider` フィールドから取得します。" }, "external_knowledge_api_id": { "anyOf": [ @@ -16821,7 +16822,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。`openai` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `provider` フィールドから取得します。" }, "external_knowledge_api_id": { "anyOf": [ @@ -19839,7 +19841,7 @@ "MetadataArgs": { "properties": { "name": { - "description": "メタデータフィールド名です。", + "description": "メタデータフィールド名です。ナレッジベース内で一意であり、組み込みフィールド名と一致せず、255 文字以内である必要があります。", "type": "string" }, "type": { @@ -19947,7 +19949,8 @@ "MetadataUpdatePayload": { "properties": { "name": { - "type": "string" + "type": "string", + "description": "新しいメタデータフィールド名です。ナレッジベース内で一意であり、組み込みフィールド名と一致せず、255 文字以内である必要があります。" } }, "required": [ @@ -21867,7 +21870,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "リランクモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/cohere/cohere`)。`cohere` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=rerank` を指定した際の `provider` フィールドから取得します。" } }, "type": "object" @@ -22964,7 +22968,8 @@ "type": "string" }, "minItems": 1, - "type": "array" + "type": "array", + "description": "バインドするタグの ID です。[ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) を参照してください。不明なタグ ID はエラーにならず無視されます。" }, "target_id": { "type": "string" @@ -22979,7 +22984,7 @@ "TagCreatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "タグ名です。ワークスペース内で一意である必要があります。", "maxLength": 50, "minLength": 1, "type": "string" @@ -23061,7 +23066,7 @@ "TagUpdatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "タグの新しい名前です。ワークスペース内で一意である必要があります。", "maxLength": 50, "minLength": 1, "type": "string" diff --git a/zh/api-reference/openapi_service.json b/zh/api-reference/openapi_service.json index 50ef4354ea..2173ab54b0 100644 --- a/zh/api-reference/openapi_service.json +++ b/zh/api-reference/openapi_service.json @@ -15542,7 +15542,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。`openai` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `provider` 字段获取。" }, "external_knowledge_api_id": { "anyOf": [ @@ -16821,7 +16822,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。`openai` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `provider` 字段获取。" }, "external_knowledge_api_id": { "anyOf": [ @@ -19839,7 +19841,7 @@ "MetadataArgs": { "properties": { "name": { - "description": "元数据字段名称。", + "description": "元数据字段名称。在知识库内必须唯一,不得与内置字段同名,且不得超过 255 个字符。", "type": "string" }, "type": { @@ -19947,7 +19949,8 @@ "MetadataUpdatePayload": { "properties": { "name": { - "type": "string" + "type": "string", + "description": "新的元数据字段名称。在知识库内必须唯一,不得与内置字段同名,且不得超过 255 个字符。" } }, "required": [ @@ -21867,7 +21870,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "重排序模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/cohere/cohere`)。`cohere` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=rerank` 返回的 `provider` 字段获取。" } }, "type": "object" @@ -22964,7 +22968,8 @@ "type": "string" }, "minItems": 1, - "type": "array" + "type": "array", + "description": "要绑定的标签 ID。参见 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags)。未知的标签 ID 会被忽略,不会报错。" }, "target_id": { "type": "string" @@ -22979,7 +22984,7 @@ "TagCreatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "标签名称。在工作区内必须唯一。", "maxLength": 50, "minLength": 1, "type": "string" @@ -23061,7 +23066,7 @@ "TagUpdatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "新的标签名称。在工作区内必须唯一。", "maxLength": 50, "minLength": 1, "type": "string" From 90d0c313da21fa3d8a31e068017f2e4df41a3a7d Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 26 Aug 2026 09:59:08 +0800 Subject: [PATCH 06/10] Revert "fix: restore verified service api field details" This reverts commit 1a829267980ef00400f640314cbbe36079b88df7. --- en/api-reference/openapi_service.json | 16 ++++++++-------- ja/api-reference/openapi_service.json | 21 ++++++++------------- zh/api-reference/openapi_service.json | 21 ++++++++------------- 3 files changed, 24 insertions(+), 34 deletions(-) diff --git a/en/api-reference/openapi_service.json b/en/api-reference/openapi_service.json index 8eff241945..919335ee84 100644 --- a/en/api-reference/openapi_service.json +++ b/en/api-reference/openapi_service.json @@ -16096,7 +16096,7 @@ } ], "default": null, - "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). A bare name like `openai` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "description": "Embedding model provider. Use the `provider` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", "title": "Embedding Model Provider" }, "external_knowledge_api_id": { @@ -17530,7 +17530,7 @@ } ], "default": null, - "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). A bare name like `openai` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "description": "Embedding model provider. Use the `provider` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", "title": "Embedding Model Provider" }, "external_knowledge_api_id": { @@ -20904,7 +20904,7 @@ "MetadataArgs": { "properties": { "name": { - "description": "Metadata field name. Must be unique within the knowledge base, must not match a built-in field name, and must be at most 255 characters.", + "description": "Metadata field name.", "title": "Name", "type": "string" }, @@ -21028,7 +21028,7 @@ "MetadataUpdatePayload": { "properties": { "name": { - "description": "New metadata field name. Must be unique within the knowledge base, must not match a built-in field name, and must be at most 255 characters.", + "description": "New metadata field name.", "title": "Name", "type": "string" } @@ -23043,7 +23043,7 @@ } ], "default": null, - "description": "Reranking model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/cohere/cohere`). A bare name like `cohere` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=rerank`.", + "description": "Provider name of the reranking model.", "title": "Reranking Provider Name" } }, @@ -24284,7 +24284,7 @@ "TagBindingPayload": { "properties": { "tag_ids": { - "description": "IDs of the tags to bind. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags). Unknown tag IDs are silently ignored.", + "description": "Tag IDs to bind.", "items": { "type": "string" }, @@ -24308,7 +24308,7 @@ "TagCreatePayload": { "properties": { "name": { - "description": "Tag name. Must be unique within the workspace.", + "description": "Tag name.", "maxLength": 50, "minLength": 1, "title": "Name", @@ -24405,7 +24405,7 @@ "TagUpdatePayload": { "properties": { "name": { - "description": "New tag name. Must be unique within the workspace.", + "description": "Tag name.", "maxLength": 50, "minLength": 1, "title": "Name", diff --git a/ja/api-reference/openapi_service.json b/ja/api-reference/openapi_service.json index 0ea1b5a691..f619865f5e 100644 --- a/ja/api-reference/openapi_service.json +++ b/ja/api-reference/openapi_service.json @@ -15542,8 +15542,7 @@ "type": "null" } ], - "default": null, - "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。`openai` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `provider` フィールドから取得します。" + "default": null }, "external_knowledge_api_id": { "anyOf": [ @@ -16822,8 +16821,7 @@ "type": "null" } ], - "default": null, - "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。`openai` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `provider` フィールドから取得します。" + "default": null }, "external_knowledge_api_id": { "anyOf": [ @@ -19841,7 +19839,7 @@ "MetadataArgs": { "properties": { "name": { - "description": "メタデータフィールド名です。ナレッジベース内で一意であり、組み込みフィールド名と一致せず、255 文字以内である必要があります。", + "description": "メタデータフィールド名です。", "type": "string" }, "type": { @@ -19949,8 +19947,7 @@ "MetadataUpdatePayload": { "properties": { "name": { - "type": "string", - "description": "新しいメタデータフィールド名です。ナレッジベース内で一意であり、組み込みフィールド名と一致せず、255 文字以内である必要があります。" + "type": "string" } }, "required": [ @@ -21870,8 +21867,7 @@ "type": "null" } ], - "default": null, - "description": "リランクモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/cohere/cohere`)。`cohere` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=rerank` を指定した際の `provider` フィールドから取得します。" + "default": null } }, "type": "object" @@ -22968,8 +22964,7 @@ "type": "string" }, "minItems": 1, - "type": "array", - "description": "バインドするタグの ID です。[ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) を参照してください。不明なタグ ID はエラーにならず無視されます。" + "type": "array" }, "target_id": { "type": "string" @@ -22984,7 +22979,7 @@ "TagCreatePayload": { "properties": { "name": { - "description": "タグ名です。ワークスペース内で一意である必要があります。", + "description": "Tag name.", "maxLength": 50, "minLength": 1, "type": "string" @@ -23066,7 +23061,7 @@ "TagUpdatePayload": { "properties": { "name": { - "description": "タグの新しい名前です。ワークスペース内で一意である必要があります。", + "description": "Tag name.", "maxLength": 50, "minLength": 1, "type": "string" diff --git a/zh/api-reference/openapi_service.json b/zh/api-reference/openapi_service.json index 2173ab54b0..50ef4354ea 100644 --- a/zh/api-reference/openapi_service.json +++ b/zh/api-reference/openapi_service.json @@ -15542,8 +15542,7 @@ "type": "null" } ], - "default": null, - "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。`openai` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `provider` 字段获取。" + "default": null }, "external_knowledge_api_id": { "anyOf": [ @@ -16822,8 +16821,7 @@ "type": "null" } ], - "default": null, - "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。`openai` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `provider` 字段获取。" + "default": null }, "external_knowledge_api_id": { "anyOf": [ @@ -19841,7 +19839,7 @@ "MetadataArgs": { "properties": { "name": { - "description": "元数据字段名称。在知识库内必须唯一,不得与内置字段同名,且不得超过 255 个字符。", + "description": "元数据字段名称。", "type": "string" }, "type": { @@ -19949,8 +19947,7 @@ "MetadataUpdatePayload": { "properties": { "name": { - "type": "string", - "description": "新的元数据字段名称。在知识库内必须唯一,不得与内置字段同名,且不得超过 255 个字符。" + "type": "string" } }, "required": [ @@ -21870,8 +21867,7 @@ "type": "null" } ], - "default": null, - "description": "重排序模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/cohere/cohere`)。`cohere` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=rerank` 返回的 `provider` 字段获取。" + "default": null } }, "type": "object" @@ -22968,8 +22964,7 @@ "type": "string" }, "minItems": 1, - "type": "array", - "description": "要绑定的标签 ID。参见 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags)。未知的标签 ID 会被忽略,不会报错。" + "type": "array" }, "target_id": { "type": "string" @@ -22984,7 +22979,7 @@ "TagCreatePayload": { "properties": { "name": { - "description": "标签名称。在工作区内必须唯一。", + "description": "Tag name.", "maxLength": 50, "minLength": 1, "type": "string" @@ -23066,7 +23061,7 @@ "TagUpdatePayload": { "properties": { "name": { - "description": "新的标签名称。在工作区内必须唯一。", + "description": "Tag name.", "maxLength": 50, "minLength": 1, "type": "string" From a3ce0ed7b56401f53a73bf8b894bb86fa99d33a6 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 26 Aug 2026 10:03:52 +0800 Subject: [PATCH 07/10] refactor: limit service api change to generated specs --- en/api-reference/openapi_service.json | 83 +- ja/api-reference/openapi_service.json | 168 ++-- tools/api-pipeline/README.md | 21 +- tools/api-pipeline/align_service_api.py | 833 ------------------- tools/api-pipeline/merge_specs.py | 23 +- tools/api-pipeline/service_api_source.json | 5 - tools/api-pipeline/test_align_service_api.py | 287 ------- zh/api-reference/openapi_service.json | 160 ++-- 8 files changed, 198 insertions(+), 1382 deletions(-) delete mode 100644 tools/api-pipeline/align_service_api.py delete mode 100644 tools/api-pipeline/service_api_source.json delete mode 100644 tools/api-pipeline/test_align_service_api.py diff --git a/en/api-reference/openapi_service.json b/en/api-reference/openapi_service.json index 919335ee84..2d14c97f33 100644 --- a/en/api-reference/openapi_service.json +++ b/en/api-reference/openapi_service.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Dify Service API", - "description": "REST API for Dify applications and knowledge bases. Create an app API key inside a published app, or create a knowledge API key from **Knowledge > Service API**. Call the API from your backend and send the key in every request as `Authorization: Bearer {API_KEY}`.\n\nDify Cloud uses `https://api.dify.ai/v1`; for a self-hosted deployment, use its Service API base URL. Verify an app key with:\n\n```bash\ncurl https://api.dify.ai/v1/info \\\n -H \"Authorization: Bearer $DIFY_API_KEY\"\n```\n\nFor a knowledge API key, make the same authenticated request to `GET /datasets`. For apps, use the `mode` returned by `GET /info` to choose the primary endpoint: `chat` (Chatbot), `agent-chat` (Agent), `advanced-chat` (Chatflow), and `agent` (New Agent) use `POST /chat-messages`; `completion` (Text Generator) uses `POST /completion-messages`; and `workflow` (Workflow) uses `POST /workflows/run`. Call `GET /parameters` to discover the input variables configured for the app. See [Get Started](/en/api-reference/guides/get-started) for the complete setup flow.", + "description": "REST API for Dify applications and knowledge bases. Application endpoints authenticate with an app API key; knowledge endpoints authenticate with a dataset API key.", "version": "1.0.0" }, "servers": [ @@ -11880,7 +11880,7 @@ "/datasets/{dataset_id}/document/create_by_file": { "post": { "deprecated": true, - "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + "description": "Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.", "operationId": "create_document_by_file_75a87285", "parameters": [ { @@ -11901,7 +11901,7 @@ "schema": { "properties": { "data": { - "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/en/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", + "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", "type": "string" }, "file": { @@ -11955,7 +11955,7 @@ "description": "`file_too_large` : File size exceeded." } }, - "summary": "Deprecated Compatibility Endpoint", + "summary": "Create Document by File", "tags": [ "Documents" ] @@ -11964,7 +11964,7 @@ "/datasets/{dataset_id}/document/create_by_text": { "post": { "deprecated": true, - "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + "description": "Deprecated legacy alias for creating a new document by providing text content. Use /datasets/{dataset_id}/document/create-by-text instead.", "operationId": "create_document_by_text_deprecated", "parameters": [ { @@ -12021,14 +12021,13 @@ }, "tags": [ "service_api" - ], - "summary": "Deprecated Compatibility Endpoint" + ] } }, "/datasets/{dataset_id}/documents/{document_id}/update_by_file": { "post": { "deprecated": true, - "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + "description": "Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.", "operationId": "update_document_by_file_deprecated_5dc5fe59", "parameters": [ { @@ -12123,7 +12122,7 @@ "description": "Unsupported file type" } }, - "summary": "Deprecated Compatibility Endpoint", + "summary": "Update Document by File", "tags": [ "Documents" ] @@ -12132,7 +12131,7 @@ "/datasets/{dataset_id}/documents/{document_id}/update_by_text": { "post": { "deprecated": true, - "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + "description": "Deprecated legacy alias for updating an existing document by providing text content. Use /datasets/{dataset_id}/documents/{document_id}/update-by-text instead.", "operationId": "update_document_by_text_deprecated", "parameters": [ { @@ -12200,14 +12199,13 @@ }, "tags": [ "service_api" - ], - "summary": "Deprecated Compatibility Endpoint" + ] } }, "/datasets/{dataset_id}/hit-testing": { "post": { "deprecated": true, - "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", + "description": "Performs a search query against a knowledge base to retrieve the most relevant chunks. This endpoint can be used for both production retrieval and test retrieval.", "operationId": "dataset_hit_testing_f584b2dd", "parameters": [ { @@ -12274,7 +12272,7 @@ "description": "`internal_server_error` : An internal error occurred during retrieval." } }, - "summary": "Deprecated Compatibility Endpoint", + "summary": "Retrieve Chunks from a Knowledge Base / Test Retrieval", "tags": [ "Knowledge Bases" ] @@ -19355,36 +19353,31 @@ "type": "string" }, "title": "Allowed File Extensions", - "type": "array", - "description": "Allowed file extensions when `allowed_file_types` includes `custom`. Entries may include or omit the leading `.`, and matching is case-insensitive. The list must contain at least one extension when `custom` is selected." + "type": "array" }, "allowed_file_types": { "items": { "$ref": "#/components/schemas/FileType" }, "title": "Allowed File Types", - "type": "array", - "description": "File categories the recipient may upload: `image`, `document`, `audio`, `video`, or `custom`." + "type": "array" }, "allowed_file_upload_methods": { "items": { "$ref": "#/components/schemas/FileTransferMethod" }, "title": "Allowed File Upload Methods", - "type": "array", - "description": "Upload methods the recipient may use: `local_file` or `remote_url`." + "type": "array" }, "output_variable_name": { "title": "Output Variable Name", - "type": "string", - "description": "Variable name used to reference this input's submitted value inside the workflow." + "type": "string" }, "type": { "const": "file", "default": "file", "title": "Type", - "type": "string", - "description": "`file`, a single-file upload input." + "type": "string" } }, "required": [ @@ -19400,8 +19393,7 @@ "type": "string" }, "title": "Allowed File Extensions", - "type": "array", - "description": "Allowed file extensions when `allowed_file_types` includes `custom`. Entries may include or omit the leading `.`, and matching is case-insensitive. The list must contain at least one extension when `custom` is selected. Present for `file` and `file-list` inputs." + "type": "array" }, "allowed_file_types": { "items": { @@ -19435,8 +19427,7 @@ "const": "file-list", "default": "file-list", "title": "Type", - "type": "string", - "description": "`file-list`, a multiple-file upload input." + "type": "string" } }, "required": [ @@ -21134,8 +21125,7 @@ "const": "paragraph", "default": "paragraph", "title": "Type", - "type": "string", - "description": "`paragraph`, a multi-line text input." + "type": "string" } }, "required": [ @@ -23796,20 +23786,17 @@ "SelectInputConfig": { "properties": { "option_source": { - "$ref": "#/components/schemas/StringListSource", - "description": "Options for this select input. `constant` uses `value`; `variable` uses the workflow variable referenced by `selector`." + "$ref": "#/components/schemas/StringListSource" }, "output_variable_name": { "title": "Output Variable Name", - "type": "string", - "description": "Variable name used to reference this input's submitted value inside the workflow." + "type": "string" }, "type": { "const": "select", "default": "select", "title": "Type", - "type": "string", - "description": "`select`, a single-choice input." + "type": "string" } }, "required": [ @@ -24193,20 +24180,17 @@ "type": "string" }, "title": "Selector", - "type": "array", - "description": "Workflow variable selector used when `type` is `variable`." + "type": "array" }, "type": { - "$ref": "#/components/schemas/ValueSourceType", - "description": "`constant` uses `value`; `variable` uses the workflow variable referenced by `selector`." + "$ref": "#/components/schemas/ValueSourceType" }, "value": { "items": { "type": "string" }, "title": "Value", - "type": "array", - "description": "Static option list used when `type` is `constant`." + "type": "array" } }, "required": [ @@ -24227,8 +24211,7 @@ "description": "Variable selector path when `type` is `variable`." }, "type": { - "$ref": "#/components/schemas/ValueSourceType", - "description": "`constant` uses `value`; `variable` uses the workflow variable referenced by `selector`." + "$ref": "#/components/schemas/ValueSourceType" }, "value": { "default": "", @@ -24584,21 +24567,18 @@ "properties": { "button_style": { "$ref": "#/components/schemas/ButtonStyle", - "default": "default", - "description": "Button style: `primary`, `default`, `accent`, or `ghost`." + "default": "default" }, "id": { "maxLength": 20, "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "title": "Id", - "type": "string", - "description": "Action button identifier. Send it as `action` when submitting the form." + "type": "string" }, "title": { "maxLength": 100, "title": "Title", - "type": "string", - "description": "Button text shown to the recipient." + "type": "string" } }, "required": [ @@ -26079,8 +26059,7 @@ } ], "default": null, - "title": "Inputs", - "description": "Input variables of the workflow run. Depending on the storage backend, the value can be decoded JSON or a JSON-encoded string such as `{\"query\": \"...\"}`; parse it when it is a string. May be `null`." + "title": "Inputs" }, "outputs": { "additionalProperties": true, diff --git a/ja/api-reference/openapi_service.json b/ja/api-reference/openapi_service.json index f619865f5e..2fdd2777a9 100644 --- a/ja/api-reference/openapi_service.json +++ b/ja/api-reference/openapi_service.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Dify サービス API", - "description": "Dify アプリケーションとナレッジベースのための REST API です。公開済みアプリ内でアプリ API キーを作成するか、**ナレッジ > サービス API** からナレッジベース API キーを作成します。API はバックエンドから呼び出し、すべてのリクエストで `Authorization: Bearer {API_KEY}` としてキーを送信してください。\n\nDify Cloud のベース URL は `https://api.dify.ai/v1` です。セルフホスト環境では、そのデプロイのサービス API ベース URL を使用します。次のコマンドでアプリ API キーを確認できます。\n\n```bash\ncurl https://api.dify.ai/v1/info \\\n -H \"Authorization: Bearer $DIFY_API_KEY\"\n```\n\nナレッジベース API キーの場合は、同じ認証方法で `GET /datasets` を呼び出します。アプリの場合は、`GET /info` が返す `mode` から主要エンドポイントを選択します。`chat`(チャットボット)、`agent-chat`(Agent)、`advanced-chat`(Chatflow)、`agent`(新しい Agent)は `POST /chat-messages`、`completion`(テキストジェネレーター)は `POST /completion-messages`、`workflow`(Workflow)は `POST /workflows/run` を使用します。`GET /parameters` を呼び出すと、アプリに設定された入力変数を確認できます。完全な設定手順は [クイックスタート](/ja/api-reference/guides/get-started) を参照してください。", + "description": "Dify アプリケーションとナレッジベースのための REST API です。アプリケーション系エンドポイントはアプリの API キーで、ナレッジ系エンドポイントはナレッジベースの API キーで認証します。", "version": "1.0.0" }, "servers": [ @@ -109,10 +109,11 @@ } } }, - "description": "リクエストが成功しました。" + "description": "Success" } }, "security": [], + "summary": "Return public Service API metadata without requiring an API key", "tags": [ "service_api" ] @@ -751,7 +752,7 @@ }, "examples": { "uploadSuccess": { - "summary": "レスポンス例", + "summary": "Response Example", "value": { "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab", "reference": null, @@ -1009,7 +1010,7 @@ }, "examples": { "endUserDetail": { - "summary": "レスポンス例", + "summary": "Response Example", "value": { "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890", "tenant_id": "11223344-5566-7788-99aa-bbccddeeff00", @@ -1490,7 +1491,7 @@ }, "examples": { "conversationHistory": { - "summary": "レスポンス例", + "summary": "Response Example", "value": { "limit": 20, "has_more": false, @@ -3553,7 +3554,7 @@ }, "examples": { "workflowLogs": { - "summary": "レスポンス例", + "summary": "Response Example", "value": { "page": 1, "limit": 20, @@ -11774,14 +11775,16 @@ "/datasets/{dataset_id}/document/create_by_file": { "post": { "deprecated": true, - "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + "description": "Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned `batch` ID with [Get Document Indexing Status](/ja/api-reference/documents/get-document-indexing-status) to track progress.", "operationId": "create_document_by_file_75a87285", "parameters": [ { + "description": "Knowledge base ID.", "in": "path", "name": "dataset_id", "required": true, "schema": { + "description": "Knowledge base ID.", "format": "uuid", "type": "string" } @@ -11793,9 +11796,11 @@ "schema": { "properties": { "data": { + "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", "type": "string" }, "file": { + "description": "Document file to upload.", "format": "binary", "type": "string" } @@ -11818,50 +11823,52 @@ } } }, - "description": "ドキュメントが正常に作成されました。" + "description": "Document created successfully." }, "400": { "content": { "application/json": {} }, - "description": "リクエストパラメーターが無効です。" + "description": "- `no_file_uploaded` : Please upload your file.\n- `too_many_files` : Only one file is allowed.\n- `filename_not_exists_error` : The specified filename does not exist.\n- `provider_not_initialize` : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.\n- `invalid_param` : Knowledge base does not exist, external datasets not supported, unsupported file type, missing required fields, or invalid doc_form (must be `text_model`, `hierarchical_model`, or `qa_model`)." }, "401": { "content": { "application/json": {} }, - "description": "認証に失敗しました。API トークンが無効です。" + "description": "Unauthorized - invalid API token" }, "403": { "content": { "application/json": {} }, - "description": "このリソースにアクセスする権限がありません。" + "description": "Forbidden - dataset API access or workspace access denied" }, "413": { "content": { "application/json": {} }, - "description": "リクエストに失敗しました。" + "description": "`file_too_large` : File size exceeded." } }, - "summary": "非推奨の互換エンドポイント", + "summary": "Create Document by File", "tags": [ - "ドキュメント" + "Documents" ] } }, "/datasets/{dataset_id}/document/create_by_text": { "post": { "deprecated": true, - "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + "description": "Deprecated legacy alias for creating a new document by providing text content. Use /datasets/{dataset_id}/document/create-by-text instead.", "operationId": "create_document_by_text_deprecated", "parameters": [ { + "description": "Knowledge base ID.", "in": "path", "name": "dataset_id", "required": true, "schema": { + "description": "Knowledge base ID.", "format": "uuid", "type": "string" } @@ -11886,53 +11893,56 @@ } } }, - "description": "リクエストが成功しました。" + "description": "Document created successfully" }, "400": { "content": { "application/json": {} }, - "description": "リクエストパラメーターが無効です。" + "description": "Bad request - invalid parameters" }, "401": { "content": { "application/json": {} }, - "description": "認証に失敗しました。API トークンが無効です。" + "description": "Unauthorized - invalid API token" }, "403": { "content": { "application/json": {} }, - "description": "このリソースにアクセスする権限がありません。" + "description": "Forbidden - dataset API access or workspace access denied" } }, "tags": [ "service_api" - ], - "summary": "非推奨の互換エンドポイント" + ] } }, "/datasets/{dataset_id}/documents/{document_id}/update_by_file": { "post": { "deprecated": true, - "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + "description": "Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/ja/api-reference/documents/get-document-indexing-status) to track progress.", "operationId": "update_document_by_file_deprecated_5dc5fe59", "parameters": [ { + "description": "Knowledge base ID.", "in": "path", "name": "dataset_id", "required": true, "schema": { + "description": "Knowledge base ID.", "format": "uuid", "type": "string" } }, { + "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { + "description": "Document ID.", "format": "uuid", "type": "string" } @@ -11944,9 +11954,11 @@ "schema": { "properties": { "data": { + "description": "JSON string containing document update settings such as `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, and `embedding_model_provider`. `name` and `text` are not used for file updates.", "type": "string" }, "file": { + "description": "Replacement document file to upload.", "format": "binary", "type": "string" } @@ -11966,71 +11978,75 @@ } } }, - "description": "ドキュメントが正常に更新されました。" + "description": "Document updated successfully." }, "400": { "content": { "application/json": {} }, - "description": "リクエストパラメーターが無効です。" + "description": "- `too_many_files` : Only one file is allowed.\n- `filename_not_exists_error` : The specified filename does not exist.\n- `provider_not_initialize` : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.\n- `invalid_param` : Knowledge base does not exist, external datasets not supported, unsupported file type, or invalid doc_form (must be `text_model`, `hierarchical_model`, or `qa_model`)." }, "401": { "content": { "application/json": {} }, - "description": "認証に失敗しました。API トークンが無効です。" + "description": "Unauthorized - invalid API token" }, "403": { "content": { "application/json": {} }, - "description": "このリソースにアクセスする権限がありません。" + "description": "Forbidden - dataset API access or workspace access denied" }, "404": { "content": { "application/json": {} }, - "description": "リクエストされたリソースが見つかりません。" + "description": "Document not found" }, "413": { "content": { "application/json": {} }, - "description": "リクエストに失敗しました。" + "description": "`file_too_large` : File size exceeded." }, "415": { "content": { "application/json": {} }, - "description": "リクエストに失敗しました。" + "description": "Unsupported file type" } }, - "summary": "非推奨の互換エンドポイント", + "summary": "Update Document by File", "tags": [ - "ドキュメント" + "Documents" ] } }, "/datasets/{dataset_id}/documents/{document_id}/update_by_text": { "post": { "deprecated": true, - "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + "description": "Deprecated legacy alias for updating an existing document by providing text content. Use /datasets/{dataset_id}/documents/{document_id}/update-by-text instead.", "operationId": "update_document_by_text_deprecated", "parameters": [ { + "description": "Knowledge base ID.", "in": "path", "name": "dataset_id", "required": true, "schema": { + "description": "Knowledge base ID.", "format": "uuid", "type": "string" } }, { + "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { + "description": "Document ID.", "format": "uuid", "type": "string" } @@ -12055,44 +12071,45 @@ } } }, - "description": "リクエストが成功しました。" + "description": "Document updated successfully" }, "401": { "content": { "application/json": {} }, - "description": "認証に失敗しました。API トークンが無効です。" + "description": "Unauthorized - invalid API token" }, "403": { "content": { "application/json": {} }, - "description": "このリソースにアクセスする権限がありません。" + "description": "Forbidden - dataset API access or workspace access denied" }, "404": { "content": { "application/json": {} }, - "description": "リクエストされたリソースが見つかりません。" + "description": "Document not found" } }, "tags": [ "service_api" - ], - "summary": "非推奨の互換エンドポイント" + ] } }, "/datasets/{dataset_id}/hit-testing": { "post": { "deprecated": true, - "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", + "description": "Performs a search query against a knowledge base to retrieve the most relevant chunks. This endpoint can be used for both production retrieval and test retrieval.", "operationId": "dataset_hit_testing_f584b2dd", "parameters": [ { + "description": "Knowledge base ID.", "in": "path", "name": "dataset_id", "required": true, "schema": { + "description": "Knowledge base ID.", "format": "uuid", "type": "string" } @@ -12117,42 +12134,42 @@ } } }, - "description": "検索結果です。" + "description": "Retrieval results." }, "400": { "content": { "application/json": {} }, - "description": "リクエストパラメーターが無効です。" + "description": "- `dataset_not_initialized` : The dataset is still being initialized or indexing. Please wait a moment.\n- `provider_not_initialize` : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.\n- `provider_quota_exceeded` : Your quota for Dify Hosted OpenAI has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials.\n- `model_currently_not_support` : Dify Hosted OpenAI trial currently not support the GPT-4 model.\n- `completion_request_error` : Completion request failed.\n- `invalid_param` : Invalid parameter value." }, "401": { "content": { "application/json": {} }, - "description": "認証に失敗しました。API トークンが無効です。" + "description": "Unauthorized - invalid API token" }, "403": { "content": { "application/json": {} }, - "description": "このリソースにアクセスする権限がありません。" + "description": "`forbidden` : Insufficient permissions." }, "404": { "content": { "application/json": {} }, - "description": "`not_found` : ナレッジベースが見つかりません。" + "description": "`not_found` : Knowledge base not found." }, "500": { "content": { "application/json": {} }, - "description": "`internal_server_error` : 検索中に内部エラーが発生しました。" + "description": "`internal_server_error` : An internal error occurred during retrieval." } }, - "summary": "非推奨の互換エンドポイント", + "summary": "Retrieve Chunks from a Knowledge Base / Test Retrieval", "tags": [ - "ナレッジベース" + "Knowledge Bases" ] } } @@ -18456,32 +18473,27 @@ "items": { "type": "string" }, - "type": "array", - "description": "`allowed_file_types` に `custom` が含まれる場合に許可されるファイル拡張子です。先頭の `.` は付けても省略してもよく、大文字と小文字は区別されません。`custom` を選択した場合、このリストには少なくとも 1 つの拡張子が必要です。" + "type": "array" }, "allowed_file_types": { "items": { "$ref": "#/components/schemas/FileType" }, - "type": "array", - "description": "受信者がアップロードできるファイルカテゴリです。`image`、`document`、`audio`、`video`、`custom` を指定できます。" + "type": "array" }, "allowed_file_upload_methods": { "items": { "$ref": "#/components/schemas/FileTransferMethod" }, - "type": "array", - "description": "受信者が使用できるアップロード方法です。`local_file` または `remote_url` を指定できます。" + "type": "array" }, "output_variable_name": { - "type": "string", - "description": "ワークフロー内で送信値を参照するための変数名です。" + "type": "string" }, "type": { "const": "file", "default": "file", - "type": "string", - "description": "`file` は、単一ファイルのアップロード入力です。" + "type": "string" } }, "required": [ @@ -18495,8 +18507,7 @@ "items": { "type": "string" }, - "type": "array", - "description": "`allowed_file_types` に `custom` が含まれる場合に許可されるファイル拡張子です。先頭の `.` は付けても省略してもよく、大文字と小文字は区別されません。`custom` を選択した場合、このリストには少なくとも 1 つの拡張子が必要です。`file` および `file-list` 入力に含まれます。" + "type": "array" }, "allowed_file_types": { "items": { @@ -18525,8 +18536,7 @@ "type": { "const": "file-list", "default": "file-list", - "type": "string", - "description": "`file-list` は、複数ファイルのアップロード入力です。" + "type": "string" } }, "required": [ @@ -20038,8 +20048,7 @@ "type": { "const": "paragraph", "default": "paragraph", - "type": "string", - "description": "`paragraph` は、複数行テキスト入力です。" + "type": "string" } }, "required": [ @@ -22528,18 +22537,15 @@ "SelectInputConfig": { "properties": { "option_source": { - "$ref": "#/components/schemas/StringListSource", - "description": "この選択入力の選択肢です。`constant` は `value` を使用し、`variable` は `selector` が参照するワークフロー変数を使用します。" + "$ref": "#/components/schemas/StringListSource" }, "output_variable_name": { - "type": "string", - "description": "ワークフロー内で送信値を参照するための変数名です。" + "type": "string" }, "type": { "const": "select", "default": "select", - "type": "string", - "description": "`select` は、リストからの単一選択入力です。" + "type": "string" } }, "required": [ @@ -22881,19 +22887,16 @@ "items": { "type": "string" }, - "type": "array", - "description": "`type` が `variable` の場合に使用するワークフロー変数の参照パスです。" + "type": "array" }, "type": { - "$ref": "#/components/schemas/ValueSourceType", - "description": "`constant` は `value` を使用し、`variable` は `selector` が参照するワークフロー変数を使用します。" + "$ref": "#/components/schemas/ValueSourceType" }, "value": { "items": { "type": "string" }, - "type": "array", - "description": "`type` が `constant` の場合に使用する静的な選択肢です。" + "type": "array" } }, "required": [ @@ -22911,8 +22914,7 @@ "description": "`type` が `variable` の場合の変数セレクターパスです。" }, "type": { - "$ref": "#/components/schemas/ValueSourceType", - "description": "`constant` は `value` を使用し、`variable` は `selector` が参照するワークフロー変数を使用します。" + "$ref": "#/components/schemas/ValueSourceType" }, "value": { "default": "", @@ -23212,19 +23214,16 @@ "properties": { "button_style": { "$ref": "#/components/schemas/ButtonStyle", - "default": "default", - "description": "ボタンのスタイルです。`primary`、`default`、`accent`、`ghost` を指定できます。" + "default": "default" }, "id": { "maxLength": 20, "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "type": "string", - "description": "アクションボタンの識別子です。フォーム送信時に `action` として指定します。" + "type": "string" }, "title": { "maxLength": 100, - "type": "string", - "description": "受信者に表示するボタンのテキストです。" + "type": "string" } }, "required": [ @@ -24555,8 +24554,7 @@ "type": "null" } ], - "default": null, - "description": "ワークフロー実行の入力変数です。ストレージバックエンドにより、解析済みの JSON 値または `{\"query\": \"...\"}` のような JSON エンコード文字列として返されます。文字列の場合はクライアント側で解析してください。`null` の場合もあります。" + "default": null }, "outputs": { "additionalProperties": true, diff --git a/tools/api-pipeline/README.md b/tools/api-pipeline/README.md index aceb7ef7d4..6d16585eac 100644 --- a/tools/api-pipeline/README.md +++ b/tools/api-pipeline/README.md @@ -1,6 +1,6 @@ # API Pipeline -Tooling for the Service API reference. During the generated-contract migration, Dify's generated `service-openapi.json` owns the wire contract in `{lang}/api-reference/openapi_service.json`; the locale files continue to own presentation fields. Overlay extraction follows after the generated and documented contracts are aligned. +Tooling for the Service API reference. `{lang}/api-reference/openapi_service.json` is the hand-maintained spec of record per language: edit it directly. The Phase-1 merge machinery (`build`/`relink` modes, `resolutions.json`, `overrides/`) that consolidated the five legacy per-app-type specs is retired; recover it from git history when Phase 2 rebuilds the spec from R&D's generated spec plus docs-owned overlays. ## Layout @@ -11,8 +11,6 @@ Tooling for the Service API reference. During the generated-contract migration, | `memberships.json` | App type → supported operations; drives the app-type overview pages and the coverage check | | `lint_specs.py` | Example/schema, enum, link, and x-codeSamples lint | | `parity_check.py` | en/zh/ja structural parity (ops, params, responses, samples) | -| `align_service_api.py` | Migration-stage alignment from Dify's generated contract while preserving locale presentation | -| `service_api_source.json` | Reviewed Dify commit and generated Service API digest | | `coverage_matrix.py`, `swagger_diff.py` | Code-vs-spec audit tooling, for runtime verification (read `openapi_service.json`) | ## Usage @@ -27,25 +25,10 @@ python3 "$DOCS/tools/api-pipeline/parity_check.py" parity_check.py and check-coverage exit nonzero on failure; lint_specs.py exits nonzero only on missing files — gate on its printed `TOTAL ISSUES` count. -## Align with Dify - -Generate `service-openapi.json` from the exact Dify commit recorded in `service_api_source.json`. Then align all three locale specs: - -```bash -python3 "$DOCS/tools/api-pipeline/align_service_api.py" /path/to/service-openapi.json --write -python3 "$DOCS/tools/api-pipeline/align_service_api.py" /path/to/service-openapi.json -``` - -For the initial migration, `--presentation-root` can point to a checkout of -the pre-alignment docs so presentation follows schemas that the generator -moved behind `$ref` components. Subsequent runs use the committed locale specs. - -The aligner takes paths, methods, parameters, schemas, status codes, authentication, deprecation flags, and operation IDs from Dify. It preserves localized prose, examples, operation tags and ordering, `x-mint`, `x-codeSamples`, top-level navigation tags, and the absolute server template used by the Mintlify playground. Existing JSON object keys retain their reviewed order, with generated-only keys appended, to keep contract updates diff-friendly. - ## Editing the spec - Edit all three languages; `parity_check` enforces structural parity with en. -- Every published operation carries `x-mint.href = /{lang}/api-reference/{en-tag-kebab}/{en-summary-kebab}` (English slugs in every language, so the language switcher can map pages) and `x-mint.metadata.title`/`sidebarTitle` = the translated summary (without them, the custom href makes Mintlify label the sidebar from the English slug). Generated operations without `x-mint` remain in the wire contract but are excluded from the documentation navigation. +- Every operation carries `x-mint.href = /{lang}/api-reference/{en-tag-kebab}/{en-summary-kebab}` (English slugs in every language, so the language switcher can map pages) and `x-mint.metadata.title`/`sidebarTitle` = the translated summary (without them, the custom href makes Mintlify label the sidebar from the English slug). Set all of these when adding an operation. - The `tags` arrays must stay index-aligned across languages; `wire` maps translated tag labels by position and fails on a mismatch. - Shared endpoints exist once, with availability lines and mode notes in the description; there is no cross-spec propagation anymore. - After adding, removing, retitling, or reordering operations: update `memberships.json` (and the app-type overview pages) if availability changed, then run `wire`, `check-coverage`, and the lints. Description-only edits need no `wire`. diff --git a/tools/api-pipeline/align_service_api.py b/tools/api-pipeline/align_service_api.py deleted file mode 100644 index 63335eceb8..0000000000 --- a/tools/api-pipeline/align_service_api.py +++ /dev/null @@ -1,833 +0,0 @@ -#!/usr/bin/env python3 -"""Align localized Service API specs with Dify's generated wire contract. - -This is the migration-stage aligner. It starts from Dify's generated -``service-openapi.json`` and carries over documentation presentation fields -from the existing English, Chinese, and Japanese specs. Routes, methods, -parameters, request and response schemas, status codes, authentication, -deprecation flags, and operation IDs always come from Dify. - -The later overlay stage will replace this migration workflow. Until then, -running the command without ``--write`` checks that committed specs are the -deterministic result of the alignment. -""" - -from __future__ import annotations - -import argparse -import copy -import json -import re -import sys -from collections import defaultdict -from pathlib import Path -from typing import Any - -LANGUAGES = ("en", "zh", "ja") -HTTP_METHODS = {"delete", "get", "head", "options", "patch", "post", "put", "trace"} -PRESENTATION_KEYS = { - "description", - "example", - "examples", - "externalDocs", - "summary", - "title", - "x-codeSamples", - "x-mint", -} - -DEPRECATED_ALIAS_PRESENTATION = { - "en": { - "summary": "Deprecated Compatibility Endpoint", - "description": "Deprecated compatibility endpoint. Use the equivalent hyphenated endpoint instead.", - }, - "zh": { - "summary": "已弃用的兼容端点", - "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", - }, - "ja": { - "summary": "非推奨の互換エンドポイント", - "description": "旧バージョンとの互換性のための非推奨エンドポイントです。対応するハイフン区切りのパスを使用してください。", - }, -} - -RESPONSE_DESCRIPTION_FALLBACKS = { - "zh": { - "2": "请求成功。", - "400": "请求参数无效。", - "401": "身份验证失败:API 令牌无效。", - "403": "没有访问此资源的权限。", - "404": "找不到请求的资源。", - "409": "请求与资源当前状态冲突。", - "429": "请求过于频繁。", - "5": "服务器无法完成请求。", - "default": "请求失败。", - }, - "ja": { - "2": "リクエストが成功しました。", - "400": "リクエストパラメーターが無効です。", - "401": "認証に失敗しました。API トークンが無効です。", - "403": "このリソースにアクセスする権限がありません。", - "404": "リクエストされたリソースが見つかりません。", - "409": "リクエストがリソースの現在の状態と競合しています。", - "429": "リクエストが多すぎます。", - "5": "サーバーはリクエストを完了できませんでした。", - "default": "リクエストに失敗しました。", - }, -} -FALLBACK_TRANSLATIONS = { - translation - for language_fallbacks in RESPONSE_DESCRIPTION_FALLBACKS.values() - for translation in language_fallbacks.values() -} - -API_LINK_RE = re.compile(r"(? dict[str, Any]: - with path.open(encoding="utf-8") as handle: - value = json.load(handle) - if not isinstance(value, dict): - raise TypeError(f"{path} must contain a JSON object") - return value - - -def render_json(value: dict[str, Any]) -> str: - return json.dumps(value, ensure_ascii=False, indent=2) + "\n" - - -def item_identity(value: Any) -> tuple[Any, ...] | None: - if not isinstance(value, dict): - return None - if isinstance(value.get("$ref"), str): - return ("ref", value["$ref"]) - if isinstance(value.get("name"), str) and isinstance(value.get("in"), str): - return ("parameter", value["in"], value["name"]) - if isinstance(value.get("type"), str) and isinstance(value.get("format"), str): - return ("schema", value["type"], value["format"]) - if isinstance(value.get("type"), str): - return ("schema", value["type"]) - return None - - -def is_presentation_field(key: str, parent_path: tuple[Any, ...]) -> bool: - """Return whether a key is OpenAPI presentation rather than user data.""" - - # Under a JSON Schema `properties` object these names are API fields, not - # OpenAPI annotations (for example, a response field named `summary`). - return key in PRESENTATION_KEYS and (not parent_path or parent_path[-1] != "properties") - - -def is_operation_tags(key: str, parent_path: tuple[Any, ...]) -> bool: - """Return whether a `tags` key belongs to an OpenAPI operation.""" - - return ( - key == "tags" - and len(parent_path) == 3 - and parent_path[0] == "paths" - and parent_path[2] in HTTP_METHODS - ) - - -def merge_presentation(generated: Any, current: Any, *, path: tuple[Any, ...] = ()) -> Any: - """Copy documentation-only fields while retaining generated structure.""" - - if isinstance(generated, dict) and isinstance(current, dict): - result = {} - for key, current_value in current.items(): - if is_presentation_field(key, path) or is_operation_tags(key, path): - result[key] = copy.deepcopy(current_value) - elif key in generated: - result[key] = merge_presentation( - generated[key], - current_value, - path=path + (key,), - ) - for key, generated_value in generated.items(): - if key not in result: - result[key] = copy.deepcopy(generated_value) - return result - - if isinstance(generated, list) and isinstance(current, list): - current_by_identity: dict[tuple[Any, ...], list[Any]] = defaultdict(list) - for item in current: - identity = item_identity(item) - if identity is not None: - current_by_identity[identity].append(item) - - result = [] - for index, generated_item in enumerate(generated): - identity = item_identity(generated_item) - matches = current_by_identity.get(identity, []) if identity is not None else [] - if len(matches) == 1: - current_item = matches[0] - elif len(generated) == len(current): - current_item = current[index] - else: - current_item = None - result.append( - merge_presentation( - generated_item, - current_item, - path=path + (index,), - ) - if current_item is not None - else copy.deepcopy(generated_item) - ) - return result - - return copy.deepcopy(generated) - - -def resolve_local_ref(root: dict[str, Any], ref: str) -> tuple[Any, tuple[str, ...]]: - """Resolve a local JSON pointer and return its value and path.""" - - if not ref.startswith("#/"): - raise ValueError(f"only local references are supported: {ref}") - path = tuple(part.replace("~1", "/").replace("~0", "~") for part in ref[2:].split("/")) - value: Any = root - for part in path: - if not isinstance(value, dict) or part not in value: - raise KeyError(f"unresolvable local reference: {ref}") - value = value[part] - return value, path - - -def schema_match_score(generated: Any, current: Any, generated_root: dict[str, Any]) -> int: - """Score how likely two schema branches describe the same value.""" - - if not isinstance(generated, dict) or not isinstance(current, dict): - return 0 - if isinstance(generated.get("$ref"), str): - generated, _ = resolve_local_ref(generated_root, generated["$ref"]) - if not isinstance(generated, dict): - return 0 - - score = 0 - generated_type = generated.get("type") - current_type = current.get("type") - if generated_type == current_type and generated_type is not None: - score += 4 - generated_properties = generated.get("properties") - current_properties = current.get("properties") - if isinstance(generated_properties, dict) and isinstance(current_properties, dict): - shared = set(generated_properties) & set(current_properties) - score += len(shared) * 10 - if set(generated_properties) == set(current_properties): - score += 5 - if "items" in generated and "items" in current: - score += 3 - generated_enum = generated.get("enum") - current_enum = current.get("enum") - if isinstance(generated_enum, list) and isinstance(current_enum, list): - score += len(set(generated_enum) & set(current_enum)) * 2 - return score - - -def carry_referenced_presentation( - generated_root: dict[str, Any], - current_root: dict[str, Any], - aligned_root: dict[str, Any], -) -> None: - """Carry docs fields when generated schemas move behind local references. - - ``merge_presentation`` handles fields that stay at the same JSON path. This - pass handles structural extraction performed by Pydantic/OpenAPI, such as - an inline response object becoming ``$ref: ...DocumentResponse``. It only - applies an old value when every matching source location agrees, so a - shared component never inherits endpoint-specific prose by accident. - """ - - candidates: dict[tuple[tuple[Any, ...], str], list[Any]] = defaultdict(list) - active_refs: set[tuple[str, str | None]] = set() - - def collect_presentation(current: dict[str, Any], aligned_path: tuple[Any, ...]) -> None: - for key in PRESENTATION_KEYS: - if key in current and is_presentation_field(key, aligned_path): - candidates[(aligned_path, key)].append(copy.deepcopy(current[key])) - - def best_variant(variants: list[Any], current: dict[str, Any]) -> tuple[int, Any] | None: - scored = [ - (schema_match_score(variant, current, generated_root), index, variant) - for index, variant in enumerate(variants) - if not (isinstance(variant, dict) and variant.get("type") == "null") - ] - if not scored: - return None - scored.sort(key=lambda item: (-item[0], item[1])) - if scored[0][0] == 0 and len(scored) > 1: - return None - return scored[0][1], scored[0][2] - - def walk( - generated: Any, - current: Any, - aligned: Any, - aligned_path: tuple[Any, ...], - *, - remapped: bool = False, - copy_here: bool = True, - ) -> None: - if isinstance(generated, dict) and isinstance(current, dict) and isinstance(aligned, dict): - generated_ref = generated.get("$ref") - current_ref = current.get("$ref") - if isinstance(generated_ref, str): - # Identical references are already merged at their component - # definitions by merge_presentation; following them again can - # misplace presentation from a nullable wrapper onto a branch. - if generated_ref == current_ref: - return - ref_pair = (generated_ref, current_ref if isinstance(current_ref, str) else None) - if ref_pair in active_refs: - return - generated_target, target_path = resolve_local_ref(generated_root, generated_ref) - aligned_target, _ = resolve_local_ref(aligned_root, generated_ref) - if isinstance(current_ref, str): - current_target, _ = resolve_local_ref(current_root, current_ref) - target_copy_here = True - else: - current_target = current - # Presentation on an inline schema stays beside the new - # $ref; only its children move into the component. - target_copy_here = False - active_refs.add(ref_pair) - walk( - generated_target, - current_target, - aligned_target, - target_path, - remapped=True, - copy_here=target_copy_here, - ) - active_refs.remove(ref_pair) - return - - if isinstance(current_ref, str): - current_target, _ = resolve_local_ref(current_root, current_ref) - walk( - generated, - current_target, - aligned, - aligned_path, - remapped=True, - copy_here=True, - ) - return - - if remapped and copy_here: - collect_presentation(current, aligned_path) - - # OpenAPI 3.1 commonly wraps an old nullable schema in anyOf with - # a null branch. Follow the structurally matching non-null branch. - for union_key in ("anyOf", "oneOf"): - generated_variants = generated.get(union_key) - if isinstance(generated_variants, list) and union_key not in current: - match = best_variant(generated_variants, current) - if match is not None: - index, generated_variant = match - aligned_variants = aligned.get(union_key) - if isinstance(aligned_variants, list) and index < len(aligned_variants): - walk( - generated_variant, - current, - aligned_variants[index], - aligned_path + (union_key, index), - remapped=True, - copy_here=False, - ) - return - - for key in generated: - if key not in current or key not in aligned: - continue - walk( - generated[key], - current[key], - aligned[key], - aligned_path + (key,), - remapped=remapped, - ) - return - - if isinstance(generated, list) and isinstance(current, list) and isinstance(aligned, list): - unused = set(range(len(current))) - for generated_index, generated_item in enumerate(generated): - if generated_index >= len(aligned): - break - ranked = sorted( - ( - schema_match_score(generated_item, current[index], generated_root), - index, - ) - for index in unused - ) - if not ranked: - continue - score, current_index = ranked[-1] - if score == 0: - current_index = generated_index if generated_index in unused else min(unused) - unused.remove(current_index) - walk( - generated_item, - current[current_index], - aligned[generated_index], - aligned_path + (generated_index,), - remapped=remapped, - ) - - walk(generated_root, current_root, aligned_root, ()) - - for (path, key), values in candidates.items(): - unique = {json.dumps(value, ensure_ascii=False, sort_keys=True) for value in values} - if len(unique) != 1: - continue - target: Any = aligned_root - for part in path: - if isinstance(part, int): - if not isinstance(target, list) or part >= len(target): - target = None - break - elif not isinstance(target, dict) or part not in target: - target = None - break - target = target[part] - if isinstance(target, dict) and key not in target: - target[key] = values[0] - - -def iter_operations(spec: dict[str, Any]): - paths = spec.get("paths") - if not isinstance(paths, dict): - raise TypeError("OpenAPI paths must be an object") - for path, path_item in paths.items(): - if not isinstance(path_item, dict): - continue - for method, operation in path_item.items(): - if method in HTTP_METHODS and isinstance(operation, dict): - yield path, method, operation - - -def build_translation_memory( - english: Any, - localized: Any, - *, - key: str | None = None, - result: dict[str, set[str]] | None = None, -) -> dict[str, set[str]]: - """Collect existing prose translations at structurally matching locations.""" - - result = defaultdict(set) if result is None else result - if isinstance(english, dict) and isinstance(localized, dict): - for child_key in set(english) & set(localized): - build_translation_memory( - english[child_key], - localized[child_key], - key=child_key, - result=result, - ) - elif isinstance(english, list) and isinstance(localized, list): - for english_item, localized_item in zip(english, localized): - build_translation_memory(english_item, localized_item, key=key, result=result) - elif ( - key in {"description", "summary", "title"} - and isinstance(english, str) - and isinstance(localized, str) - and english != localized - and localized not in FALLBACK_TRANSLATIONS - ): - result[english].add(localized) - return result - - -def apply_translation_memory(english: Any, localized: Any, memory: dict[str, set[str]], *, key: str | None = None) -> Any: - """Fill newly generated prose from unambiguous existing translations.""" - - if isinstance(english, dict) and isinstance(localized, dict): - result = copy.deepcopy(localized) - for child_key in set(english) & set(localized): - result[child_key] = apply_translation_memory( - english[child_key], - localized[child_key], - memory, - key=child_key, - ) - return result - if isinstance(english, list) and isinstance(localized, list) and len(english) == len(localized): - return [ - apply_translation_memory(english_item, localized_item, memory, key=key) - for english_item, localized_item in zip(english, localized) - ] - if ( - key in {"description", "summary", "title"} - and isinstance(english, str) - and localized == english - and len(memory.get(english, set())) == 1 - ): - return next(iter(memory[english])) - return copy.deepcopy(localized) - - -def prefer_aligned_memory( - initial: dict[str, set[str]], - aligned: dict[str, set[str]], -) -> dict[str, set[str]]: - """Prefer a unique translation visible in the generated document shape.""" - - result = {english: set(translations) for english, translations in initial.items()} - for english, translations in aligned.items(): - if len(translations) == 1: - result[english] = set(translations) - elif english not in result: - result[english] = set(translations) - return result - - -def collect_equal_presentation(english: Any, localized: Any, *, key: str | None = None) -> set[str]: - """Return presentation strings already intentionally shared by a locale.""" - - result: set[str] = set() - if isinstance(english, dict) and isinstance(localized, dict): - for child_key in set(english) & set(localized): - result.update(collect_equal_presentation(english[child_key], localized[child_key], key=child_key)) - elif isinstance(english, list) and isinstance(localized, list): - for english_item, localized_item in zip(english, localized): - result.update(collect_equal_presentation(english_item, localized_item, key=key)) - elif ( - key in {"description", "summary", "title"} - and isinstance(english, str) - and canonical_presentation(english) == canonical_presentation(localized) - ): - result.add(canonical_presentation(english)) - return result - - -def canonical_presentation(value: str) -> str: - """Ignore locale prefixes when comparing otherwise identical prose.""" - - return LOCALIZED_API_LINK_RE.sub("/api-reference/", value) - - -def response_description_fallback(language: str, status: str) -> str: - fallbacks = RESPONSE_DESCRIPTION_FALLBACKS[language] - if status in fallbacks: - return fallbacks[status] - if status.startswith("2"): - return fallbacks["2"] - if status.startswith("5"): - return fallbacks["5"] - return fallbacks["default"] - - -def remove_new_untranslated_presentation( - english: Any, - localized: Any, - allowed_equal: set[str], - language: str, - *, - path: tuple[Any, ...] = (), -) -> Any: - """Avoid introducing raw English prose into zh/ja during migration. - - Existing shared technical labels remain intact. Newly generated optional - presentation fields are omitted until the overlay owns them. OpenAPI - response descriptions are required, so new ones receive a localized - status-level fallback instead. - """ - - if isinstance(english, dict) and isinstance(localized, dict): - result = copy.deepcopy(localized) - for key in list(result): - if key not in english: - continue - english_value = english[key] - localized_value = result[key] - if ( - key in {"description", "summary", "title"} - and isinstance(english_value, str) - and isinstance(localized_value, str) - and canonical_presentation(localized_value) == canonical_presentation(english_value) - and canonical_presentation(english_value) not in allowed_equal - ): - is_response_description = ( - key == "description" - and len(path) >= 2 - and path[-2] == "responses" - and isinstance(path[-1], str) - ) - if is_response_description: - result[key] = response_description_fallback(language, path[-1]) - else: - del result[key] - continue - result[key] = remove_new_untranslated_presentation( - english_value, - localized_value, - allowed_equal, - language, - path=path + (key,), - ) - return result - if isinstance(english, list) and isinstance(localized, list): - return [ - remove_new_untranslated_presentation( - english_item, - localized_item, - allowed_equal, - language, - path=path + (index,), - ) - for index, (english_item, localized_item) in enumerate(zip(english, localized)) - ] - return copy.deepcopy(localized) - - -def prefix_internal_api_links(value: Any, language: str, *, key: str | None = None) -> Any: - """Add the locale prefix to bare internal API reference links.""" - - if isinstance(value, dict): - return { - child_key: prefix_internal_api_links(child, language, key=child_key) - for child_key, child in value.items() - } - if isinstance(value, list): - return [prefix_internal_api_links(child, language, key=key) for child in value] - if key in PRESENTATION_KEYS and isinstance(value, str): - return API_LINK_RE.sub(f"/{language}/api-reference/", value) - return copy.deepcopy(value) - - -def localize_unmatched_tags( - aligned: dict[str, Any], - english_current: dict[str, Any], - localized_current: dict[str, Any], -) -> None: - english_tags = [tag.get("name") for tag in english_current.get("tags", []) if isinstance(tag, dict)] - localized_tags = [tag.get("name") for tag in localized_current.get("tags", []) if isinstance(tag, dict)] - tag_map = { - english: localized - for english, localized in zip(english_tags, localized_tags) - if isinstance(english, str) and isinstance(localized, str) - } - for _, _, operation in iter_operations(aligned): - tags = operation.get("tags") - if isinstance(tags, list): - operation["tags"] = [tag_map.get(tag, tag) for tag in tags] - - -def apply_deprecated_alias_presentation(spec: dict[str, Any], language: str) -> None: - presentation = DEPRECATED_ALIAS_PRESENTATION[language] - for path, _, operation in iter_operations(spec): - if operation.get("deprecated") is not True: - continue - if path in DEPRECATED_ALIAS_PATHS: - operation.pop("x-mint", None) - operation["summary"] = presentation["summary"] - operation["description"] = presentation["description"] - elif path == CANONICAL_DEPRECATED_PATH: - operation["x-mint"] = { - "href": f"/{language}/api-reference/documents/update-document-by-file", - "metadata": { - "title": operation["summary"], - "sidebarTitle": operation["summary"], - }, - } - - -def align_language( - generated: dict[str, Any], - current: dict[str, Any], - language: str, -) -> dict[str, Any]: - aligned = merge_presentation(generated, current) - carry_referenced_presentation(generated, current, aligned) - - # JSON object order is not part of the wire contract, but it controls the - # generated sidebar order. Keep the reviewed docs order, retain the - # generated root path first, and append other generated-only paths. - generated_paths = aligned.get("paths", {}) - current_paths = current.get("paths", {}) - if isinstance(generated_paths, dict) and isinstance(current_paths, dict): - path_order = ( - (["/"] if "/" in generated_paths and "/" not in current_paths else []) - + [path for path in current_paths if path in generated_paths] - + [ - path - for path in generated_paths - if path not in current_paths and path != "/" - ] - ) - ordered_paths = {} - for path in path_order: - path_item = generated_paths[path] - current_path_item = current_paths.get(path) - if isinstance(path_item, dict) and isinstance(current_path_item, dict): - item_order = ( - [key for key in current_path_item if key in path_item] - + [key for key in path_item if key not in current_path_item] - ) - path_item = {key: path_item[key] for key in item_order} - ordered_paths[path] = path_item - aligned["paths"] = ordered_paths - - # These top-level values control the published docs experience rather than - # the request/response wire contract. - for key in ("info", "servers", "tags"): - if key in current: - aligned[key] = copy.deepcopy(current[key]) - - generated_schemes = aligned.get("components", {}).get("securitySchemes", {}) - current_schemes = current.get("components", {}).get("securitySchemes", {}) - if isinstance(generated_schemes, dict) and isinstance(current_schemes, dict): - current_descriptions = [ - scheme.get("description") - for scheme in current_schemes.values() - if isinstance(scheme, dict) and isinstance(scheme.get("description"), str) - ] - if len(current_descriptions) == 1: - for scheme in generated_schemes.values(): - if isinstance(scheme, dict): - scheme["description"] = current_descriptions[0] - - apply_deprecated_alias_presentation(aligned, language) - return aligned - - -def wire_shape(value: Any, *, path: tuple[Any, ...] = ()) -> Any: - """Remove presentation fields before comparing generated ownership.""" - - if isinstance(value, dict): - return { - key: wire_shape(child, path=path + (key,)) - for key, child in value.items() - if not is_presentation_field(key, path) - and not ( - key == "tags" - and len(path) == 3 - and path[0] == "paths" - and path[2] in HTTP_METHODS - ) - } - if isinstance(value, list): - return [wire_shape(child, path=path + (index,)) for index, child in enumerate(value)] - return value - - -def validate_alignment(generated: dict[str, Any], aligned: dict[str, Any]) -> list[str]: - failures: list[str] = [] - generated_ops = {(path, method): operation for path, method, operation in iter_operations(generated)} - aligned_ops = {(path, method): operation for path, method, operation in iter_operations(aligned)} - if set(generated_ops) != set(aligned_ops): - failures.append("operation inventory differs from generated contract") - - for key in sorted(set(generated_ops) & set(aligned_ops)): - generated_operation = generated_ops[key] - aligned_operation = aligned_ops[key] - for field in ("deprecated", "operationId", "parameters", "requestBody", "security"): - if wire_shape(generated_operation.get(field)) != wire_shape(aligned_operation.get(field)): - failures.append(f"{key[1].upper()} {key[0]}: generated {field} changed") - generated_responses = generated_operation.get("responses") or {} - aligned_responses = aligned_operation.get("responses") or {} - if set(generated_responses) != set(aligned_responses): - failures.append(f"{key[1].upper()} {key[0]}: response statuses changed") - elif wire_shape(generated_responses) != wire_shape(aligned_responses): - failures.append(f"{key[1].upper()} {key[0]}: response contract changed") - - if generated.get("openapi") != aligned.get("openapi"): - failures.append("OpenAPI version differs from generated contract") - if generated.get("security") != aligned.get("security"): - failures.append("top-level security differs from generated contract") - if wire_shape(generated.get("paths"), path=("paths",)) != wire_shape( - aligned.get("paths"), path=("paths",) - ): - failures.append("generated path contract changed") - if wire_shape(generated.get("components")) != wire_shape(aligned.get("components")): - failures.append("generated component contract changed") - return failures - - -def main() -> int: - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("generated", type=Path, help="Dify-generated service-openapi.json") - parser.add_argument("--docs-root", type=Path, default=Path(__file__).resolve().parents[2]) - parser.add_argument( - "--presentation-root", - type=Path, - help="optional source root for the pre-alignment locale presentation", - ) - parser.add_argument("--write", action="store_true", help="write aligned locale specs") - args = parser.parse_args() - - generated = load_json(args.generated) - presentation_root = args.presentation_root or args.docs_root - current = { - language: load_json(presentation_root / language / "api-reference" / "openapi_service.json") - for language in LANGUAGES - } - memories = { - language: build_translation_memory(current["en"], current[language]) - for language in ("zh", "ja") - } - allowed_equal = { - language: collect_equal_presentation(current["en"], current[language]) - for language in ("zh", "ja") - } - - aligned = { - language: align_language(generated, current[language], language) - for language in LANGUAGES - } - for language in ("zh", "ja"): - for _ in range(5): - aligned_memory = build_translation_memory(aligned["en"], aligned[language]) - memory = prefer_aligned_memory(memories[language], aligned_memory) - translated = apply_translation_memory(aligned["en"], aligned[language], memory) - if translated == aligned[language]: - break - aligned[language] = translated - localize_unmatched_tags(aligned[language], current["en"], current[language]) - aligned[language] = remove_new_untranslated_presentation( - aligned["en"], - aligned[language], - allowed_equal[language], - language, - ) - - aligned = { - language: prefix_internal_api_links(spec, language) - for language, spec in aligned.items() - } - - failed = False - for language in LANGUAGES: - failures = validate_alignment(generated, aligned[language]) - if failures: - failed = True - print(f"{language}: alignment failures ({len(failures)})") - for failure in failures: - print(f" - {failure}") - continue - - output = args.docs_root / language / "api-reference" / "openapi_service.json" - rendered = render_json(aligned[language]) - if args.write: - output.write_text(rendered, encoding="utf-8") - print(f"{language}: wrote {output}") - elif output.read_text(encoding="utf-8") != rendered: - failed = True - print(f"{language}: aligned output differs from {output}") - else: - print(f"{language}: aligned output is current") - return 1 if failed else 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/tools/api-pipeline/merge_specs.py b/tools/api-pipeline/merge_specs.py index 7776e63891..eeec11bfc2 100644 --- a/tools/api-pipeline/merge_specs.py +++ b/tools/api-pipeline/merge_specs.py @@ -40,10 +40,7 @@ def iter_ops(spec: dict): """Yield (path, method, op) for every operation in a spec.""" for path, item in spec.get("paths", {}).items(): for method, op in item.items(): - if ( - method in HTTP_METHODS - and "x-mint" in op - ): + if method in HTTP_METHODS: yield path, method, op @@ -152,22 +149,8 @@ def wire(langs): # Catch-all last so the KB exceptions win (Mintlify matches sources in order). api_catchall = {"source": "/api-reference/:slug*", "destination": "/en/api-reference/guides/get-started"} - api_indexes = [ - index - for index, redirect in enumerate(existing) - if "/api-reference/" in redirect["source"] - ] - kept = [redirect for redirect in existing if "/api-reference/" not in redirect["source"]] - if api_indexes: - insert_at = sum( - "/api-reference/" not in redirect["source"] - for redirect in existing[:api_indexes[0]] - ) - else: - insert_at = len(kept) - docs["redirects"] = ( - kept[:insert_at] + api_kb + [api_catchall] + kept[insert_at:] - ) + kept = [r for r in existing if "/api-reference/" not in r["source"]] + docs["redirects"] = kept + api_kb + [api_catchall] print(f"redirects: {len(kept)} non-API + {len(api_kb)} KB + 1 catch-all") with open(docs_path, "w", encoding="utf-8") as f: diff --git a/tools/api-pipeline/service_api_source.json b/tools/api-pipeline/service_api_source.json deleted file mode 100644 index 4bee4410bb..0000000000 --- a/tools/api-pipeline/service_api_source.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "repository": "langgenius/dify", - "commit": "c7520d7c71031dfa5764d966a523c5766abdc2d6", - "generated_service_openapi_sha256": "a225c8d13e83232f216d22780ad2e74c747a92dd9797ff07dd8bf5294636fb23" -} diff --git a/tools/api-pipeline/test_align_service_api.py b/tools/api-pipeline/test_align_service_api.py deleted file mode 100644 index 128e4e4f32..0000000000 --- a/tools/api-pipeline/test_align_service_api.py +++ /dev/null @@ -1,287 +0,0 @@ -import copy -import unittest - -from align_service_api import ( - apply_deprecated_alias_presentation, - align_language, - carry_referenced_presentation, - merge_presentation, - prefix_internal_api_links, - remove_new_untranslated_presentation, - validate_alignment, -) - - -class AlignServiceApiTest(unittest.TestCase): - def setUp(self) -> None: - self.generated = { - "openapi": "3.1.0", - "info": {"title": "Generated", "version": "1"}, - "servers": [{"url": "/v1"}], - "security": [{"Bearer": []}], - "tags": [{"name": "service_api"}], - "paths": { - "/": { - "get": { - "operationId": "get_index_api", - "responses": { - "200": { - "description": "Success", - "content": {"application/json": {"schema": {"type": "object"}}}, - } - }, - "security": [], - "summary": "Generated root", - "tags": ["service_api"], - } - }, - "/items": { - "get": { - "operationId": "get_items", - "responses": {"200": {"description": "Success"}, "401": {"description": "Unauthorized"}}, - "summary": "Generated summary", - "tags": ["service_api"], - } - }, - }, - "components": { - "securitySchemes": { - "Bearer": {"type": "http", "scheme": "bearer", "description": "Generated auth"} - } - }, - } - self.current = { - "openapi": "3.0.1", - "info": {"title": "Dify Service API", "version": "1.0.0"}, - "servers": [{"url": "https://{api_base_url}"}], - "security": [{"ApiKeyAuth": []}], - "tags": [{"name": "Applications"}], - "paths": { - "/items": { - "get": { - "operationId": "listItems", - "description": "Curated description.", - "responses": {"200": {"description": "Curated success"}}, - "summary": "List Items", - "tags": ["Applications"], - "x-mint": {"href": "/en/api-reference/applications/list-items"}, - } - } - }, - "components": { - "securitySchemes": { - "ApiKeyAuth": {"type": "http", "scheme": "bearer", "description": "Curated auth"} - } - }, - } - - def test_generated_wire_fields_and_operation_ids_win(self) -> None: - aligned = align_language(copy.deepcopy(self.generated), self.current, "en") - operation = aligned["paths"]["/items"]["get"] - self.assertEqual(operation["operationId"], "get_items") - self.assertEqual(set(operation["responses"]), {"200", "401"}) - self.assertEqual(aligned["security"], [{"Bearer": []}]) - self.assertEqual(validate_alignment(self.generated, aligned), []) - - def test_documentation_presentation_and_server_are_preserved(self) -> None: - aligned = align_language(copy.deepcopy(self.generated), self.current, "en") - operation = aligned["paths"]["/items"]["get"] - self.assertEqual(operation["summary"], "List Items") - self.assertEqual(operation["description"], "Curated description.") - self.assertEqual(operation["tags"], ["Applications"]) - self.assertEqual(operation["x-mint"]["href"], "/en/api-reference/applications/list-items") - self.assertEqual(aligned["servers"], self.current["servers"]) - self.assertEqual(aligned["components"]["securitySchemes"]["Bearer"]["description"], "Curated auth") - - def test_existing_key_order_is_stable_and_new_keys_are_appended(self) -> None: - generated = {"type": "object", "new": True, "description": "Generated"} - current = {"description": "Curated", "type": "object"} - aligned = merge_presentation(generated, current) - self.assertEqual(list(aligned), ["description", "type", "new"]) - - def test_root_operation_keeps_generated_contract_without_docs_metadata(self) -> None: - aligned = align_language(copy.deepcopy(self.generated), self.current, "en") - operation = aligned["paths"]["/"]["get"] - self.assertEqual(operation["summary"], "Generated root") - self.assertEqual(operation["tags"], ["service_api"]) - self.assertNotIn("x-mint", operation) - self.assertNotIn( - "examples", - operation["responses"]["200"]["content"]["application/json"], - ) - - def test_new_untranslated_prose_is_removed_but_response_description_is_localized(self) -> None: - english = { - "description": "New schema prose.", - "responses": {"401": {"description": "Unauthorized - invalid API token"}}, - } - localized = copy.deepcopy(english) - cleaned = remove_new_untranslated_presentation(english, localized, set(), "zh") - self.assertNotIn("description", cleaned) - self.assertEqual(cleaned["responses"]["401"]["description"], "身份验证失败:API 令牌无效。") - - def test_internal_api_links_receive_locale_prefix(self) -> None: - value = { - "description": "See [Upload File](/api-reference/files/upload-file).", - "x-mint": {"href": "/en/api-reference/files/upload-file"}, - } - localized = prefix_internal_api_links(value, "en") - self.assertIn("](/en/api-reference/files/upload-file)", localized["description"]) - self.assertEqual(localized["x-mint"]["href"], "/en/api-reference/files/upload-file") - - def test_deprecated_aliases_are_hidden_but_canonical_page_remains_linkable(self) -> None: - spec = { - "paths": { - "/datasets/{dataset_id}/document/create_by_file": { - "post": {"deprecated": True, "summary": "Alias", "x-mint": {"href": "/alias"}} - }, - "/datasets/{dataset_id}/documents/{document_id}/update-by-file": { - "post": {"deprecated": True, "summary": "Update Document by File"} - }, - } - } - apply_deprecated_alias_presentation(spec, "en") - alias = spec["paths"]["/datasets/{dataset_id}/document/create_by_file"]["post"] - canonical = spec["paths"]["/datasets/{dataset_id}/documents/{document_id}/update-by-file"]["post"] - self.assertNotIn("x-mint", alias) - self.assertEqual( - canonical["x-mint"]["href"], - "/en/api-reference/documents/update-document-by-file", - ) - - def test_component_wire_changes_fail_validation(self) -> None: - aligned = align_language(copy.deepcopy(self.generated), self.current, "en") - aligned["components"]["securitySchemes"]["Bearer"]["scheme"] = "basic" - self.assertIn("generated component contract changed", validate_alignment(self.generated, aligned)) - - def test_schema_property_named_tags_is_wire_owned(self) -> None: - generated = copy.deepcopy(self.generated) - generated["components"]["schemas"] = { - "Item": {"type": "object", "properties": {"tags": {"type": "array"}}} - } - aligned = align_language(copy.deepcopy(generated), self.current, "en") - self.assertEqual( - aligned["components"]["schemas"]["Item"]["properties"]["tags"]["type"], - "array", - ) - aligned["components"]["schemas"]["Item"]["properties"]["tags"]["type"] = "string" - self.assertIn("generated component contract changed", validate_alignment(generated, aligned)) - - def test_schema_properties_named_like_presentation_are_wire_owned(self) -> None: - generated = copy.deepcopy(self.generated) - generated["components"]["schemas"] = { - "Item": { - "type": "object", - "properties": { - "description": {"type": "string"}, - "summary": {"type": "string"}, - "title": {"type": "string"}, - }, - } - } - current = copy.deepcopy(self.current) - current["components"]["schemas"] = { - "Item": { - "type": "object", - "properties": { - "description": {"type": "integer"}, - "summary": {"type": "integer"}, - "title": {"type": "integer"}, - }, - } - } - - aligned = align_language(generated, current, "en") - - properties = aligned["components"]["schemas"]["Item"]["properties"] - self.assertEqual({name: schema["type"] for name, schema in properties.items()}, { - "description": "string", - "summary": "string", - "title": "string", - }) - properties["summary"]["type"] = "integer" - self.assertIn("generated component contract changed", validate_alignment(generated, aligned)) - - def test_presentation_moves_from_inline_schema_to_referenced_component(self) -> None: - generated = copy.deepcopy(self.generated) - generated["paths"]["/items"]["get"]["responses"]["200"] = { - "description": "Success", - "content": { - "application/json": { - "schema": {"$ref": "#/components/schemas/ItemResponse"} - } - }, - } - generated["components"]["schemas"] = { - "ItemResponse": { - "type": "object", - "properties": {"name": {"type": "string", "title": "Name"}}, - } - } - current = copy.deepcopy(self.current) - current["paths"]["/items"]["get"]["responses"]["200"] = { - "description": "Curated success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Human-readable item name.", - } - }, - } - } - }, - } - - aligned = align_language(generated, current, "en") - - self.assertEqual( - aligned["components"]["schemas"]["ItemResponse"]["properties"]["name"]["description"], - "Human-readable item name.", - ) - self.assertNotIn("description", aligned["components"]["schemas"]["ItemResponse"]) - self.assertEqual(validate_alignment(generated, aligned), []) - - def test_conflicting_inline_descriptions_do_not_leak_into_shared_component(self) -> None: - generated = copy.deepcopy(self.generated) - generated["paths"]["/items"]["post"] = copy.deepcopy( - generated["paths"]["/items"]["get"] - ) - generated["components"]["schemas"] = { - "Shared": { - "type": "object", - "properties": {"id": {"type": "string"}}, - } - } - for method in ("get", "post"): - generated["paths"]["/items"][method]["responses"]["200"] = { - "description": "Success", - "content": { - "application/json": { - "schema": {"$ref": "#/components/schemas/Shared"} - } - }, - } - current = copy.deepcopy(generated) - for method, description in (("get", "Read identifier."), ("post", "Created identifier.")): - current["paths"]["/items"][method]["responses"]["200"]["content"]["application/json"][ - "schema" - ] = { - "type": "object", - "properties": {"id": {"type": "string", "description": description}}, - } - aligned = merge_presentation(generated, current) - - carry_referenced_presentation(generated, current, aligned) - - self.assertNotIn( - "description", - aligned["components"]["schemas"]["Shared"]["properties"]["id"], - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/zh/api-reference/openapi_service.json b/zh/api-reference/openapi_service.json index 50ef4354ea..31557969e6 100644 --- a/zh/api-reference/openapi_service.json +++ b/zh/api-reference/openapi_service.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Dify 服务 API", - "description": "用于 Dify 应用与知识库的 REST API。在已发布的应用内创建应用 API 密钥,或从 **知识库 > 服务 API** 创建知识库 API 密钥。请从后端调用 API,并在每个请求中通过 `Authorization: Bearer {API_KEY}` 发送密钥。\n\nDify Cloud 的基础 URL 为 `https://api.dify.ai/v1`;自部署时,请使用部署的服务 API 基础 URL。可用以下命令验证应用密钥:\n\n```bash\ncurl https://api.dify.ai/v1/info \\\n -H \"Authorization: Bearer $DIFY_API_KEY\"\n```\n\n验证知识库 API 密钥时,使用相同的认证方式调用 `GET /datasets`。对于应用,根据 `GET /info` 返回的 `mode` 选择主要接口:`chat`(聊天助手)、`agent-chat`(Agent)、`advanced-chat`(Chatflow)和 `agent`(新 Agent)使用 `POST /chat-messages`;`completion`(文本生成应用)使用 `POST /completion-messages`;`workflow`(Workflow)使用 `POST /workflows/run`。调用 `GET /parameters` 可获取应用配置的输入变量。完整设置流程参见 [快速开始](/zh/api-reference/guides/get-started)。", + "description": "用于 Dify 应用与知识库的 REST API。应用类接口使用应用 API 密钥认证,知识库类接口使用知识库 API 密钥认证。", "version": "1.0.0" }, "servers": [ @@ -109,10 +109,11 @@ } } }, - "description": "请求成功。" + "description": "Success" } }, "security": [], + "summary": "Return public Service API metadata without requiring an API key", "tags": [ "service_api" ] @@ -11774,14 +11775,16 @@ "/datasets/{dataset_id}/document/create_by_file": { "post": { "deprecated": true, - "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + "description": "Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned `batch` ID with [Get Document Indexing Status](/zh/api-reference/documents/get-document-indexing-status) to track progress.", "operationId": "create_document_by_file_75a87285", "parameters": [ { + "description": "Knowledge base ID.", "in": "path", "name": "dataset_id", "required": true, "schema": { + "description": "Knowledge base ID.", "format": "uuid", "type": "string" } @@ -11793,9 +11796,11 @@ "schema": { "properties": { "data": { + "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", "type": "string" }, "file": { + "description": "Document file to upload.", "format": "binary", "type": "string" } @@ -11818,50 +11823,52 @@ } } }, - "description": "文档创建成功。" + "description": "Document created successfully." }, "400": { "content": { "application/json": {} }, - "description": "请求参数无效。" + "description": "- `no_file_uploaded` : Please upload your file.\n- `too_many_files` : Only one file is allowed.\n- `filename_not_exists_error` : The specified filename does not exist.\n- `provider_not_initialize` : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.\n- `invalid_param` : Knowledge base does not exist, external datasets not supported, unsupported file type, missing required fields, or invalid doc_form (must be `text_model`, `hierarchical_model`, or `qa_model`)." }, "401": { "content": { "application/json": {} }, - "description": "身份验证失败:API 令牌无效。" + "description": "Unauthorized - invalid API token" }, "403": { "content": { "application/json": {} }, - "description": "没有访问此资源的权限。" + "description": "Forbidden - dataset API access or workspace access denied" }, "413": { "content": { "application/json": {} }, - "description": "请求失败。" + "description": "`file_too_large` : File size exceeded." } }, - "summary": "已弃用的兼容端点", + "summary": "Create Document by File", "tags": [ - "文档" + "Documents" ] } }, "/datasets/{dataset_id}/document/create_by_text": { "post": { "deprecated": true, - "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + "description": "Deprecated legacy alias for creating a new document by providing text content. Use /datasets/{dataset_id}/document/create-by-text instead.", "operationId": "create_document_by_text_deprecated", "parameters": [ { + "description": "Knowledge base ID.", "in": "path", "name": "dataset_id", "required": true, "schema": { + "description": "Knowledge base ID.", "format": "uuid", "type": "string" } @@ -11886,53 +11893,56 @@ } } }, - "description": "请求成功。" + "description": "Document created successfully" }, "400": { "content": { "application/json": {} }, - "description": "请求参数无效。" + "description": "Bad request - invalid parameters" }, "401": { "content": { "application/json": {} }, - "description": "身份验证失败:API 令牌无效。" + "description": "Unauthorized - invalid API token" }, "403": { "content": { "application/json": {} }, - "description": "没有访问此资源的权限。" + "description": "Forbidden - dataset API access or workspace access denied" } }, "tags": [ "service_api" - ], - "summary": "已弃用的兼容端点" + ] } }, "/datasets/{dataset_id}/documents/{document_id}/update_by_file": { "post": { "deprecated": true, - "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + "description": "Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/zh/api-reference/documents/get-document-indexing-status) to track progress.", "operationId": "update_document_by_file_deprecated_5dc5fe59", "parameters": [ { + "description": "Knowledge base ID.", "in": "path", "name": "dataset_id", "required": true, "schema": { + "description": "Knowledge base ID.", "format": "uuid", "type": "string" } }, { + "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { + "description": "Document ID.", "format": "uuid", "type": "string" } @@ -11944,9 +11954,11 @@ "schema": { "properties": { "data": { + "description": "JSON string containing document update settings such as `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, and `embedding_model_provider`. `name` and `text` are not used for file updates.", "type": "string" }, "file": { + "description": "Replacement document file to upload.", "format": "binary", "type": "string" } @@ -11966,71 +11978,75 @@ } } }, - "description": "文档更新成功。" + "description": "Document updated successfully." }, "400": { "content": { "application/json": {} }, - "description": "请求参数无效。" + "description": "- `too_many_files` : Only one file is allowed.\n- `filename_not_exists_error` : The specified filename does not exist.\n- `provider_not_initialize` : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.\n- `invalid_param` : Knowledge base does not exist, external datasets not supported, unsupported file type, or invalid doc_form (must be `text_model`, `hierarchical_model`, or `qa_model`)." }, "401": { "content": { "application/json": {} }, - "description": "身份验证失败:API 令牌无效。" + "description": "Unauthorized - invalid API token" }, "403": { "content": { "application/json": {} }, - "description": "没有访问此资源的权限。" + "description": "Forbidden - dataset API access or workspace access denied" }, "404": { "content": { "application/json": {} }, - "description": "找不到请求的资源。" + "description": "Document not found" }, "413": { "content": { "application/json": {} }, - "description": "请求失败。" + "description": "`file_too_large` : File size exceeded." }, "415": { "content": { "application/json": {} }, - "description": "请求失败。" + "description": "Unsupported file type" } }, - "summary": "已弃用的兼容端点", + "summary": "Update Document by File", "tags": [ - "文档" + "Documents" ] } }, "/datasets/{dataset_id}/documents/{document_id}/update_by_text": { "post": { "deprecated": true, - "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + "description": "Deprecated legacy alias for updating an existing document by providing text content. Use /datasets/{dataset_id}/documents/{document_id}/update-by-text instead.", "operationId": "update_document_by_text_deprecated", "parameters": [ { + "description": "Knowledge base ID.", "in": "path", "name": "dataset_id", "required": true, "schema": { + "description": "Knowledge base ID.", "format": "uuid", "type": "string" } }, { + "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { + "description": "Document ID.", "format": "uuid", "type": "string" } @@ -12055,44 +12071,45 @@ } } }, - "description": "请求成功。" + "description": "Document updated successfully" }, "401": { "content": { "application/json": {} }, - "description": "身份验证失败:API 令牌无效。" + "description": "Unauthorized - invalid API token" }, "403": { "content": { "application/json": {} }, - "description": "没有访问此资源的权限。" + "description": "Forbidden - dataset API access or workspace access denied" }, "404": { "content": { "application/json": {} }, - "description": "找不到请求的资源。" + "description": "Document not found" } }, "tags": [ "service_api" - ], - "summary": "已弃用的兼容端点" + ] } }, "/datasets/{dataset_id}/hit-testing": { "post": { "deprecated": true, - "description": "用于兼容旧版调用的已弃用端点。请改用对应的连字符路径。", + "description": "Performs a search query against a knowledge base to retrieve the most relevant chunks. This endpoint can be used for both production retrieval and test retrieval.", "operationId": "dataset_hit_testing_f584b2dd", "parameters": [ { + "description": "Knowledge base ID.", "in": "path", "name": "dataset_id", "required": true, "schema": { + "description": "Knowledge base ID.", "format": "uuid", "type": "string" } @@ -12117,42 +12134,42 @@ } } }, - "description": "检索结果。" + "description": "Retrieval results." }, "400": { "content": { "application/json": {} }, - "description": "请求参数无效。" + "description": "- `dataset_not_initialized` : The dataset is still being initialized or indexing. Please wait a moment.\n- `provider_not_initialize` : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.\n- `provider_quota_exceeded` : Your quota for Dify Hosted OpenAI has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials.\n- `model_currently_not_support` : Dify Hosted OpenAI trial currently not support the GPT-4 model.\n- `completion_request_error` : Completion request failed.\n- `invalid_param` : Invalid parameter value." }, "401": { "content": { "application/json": {} }, - "description": "身份验证失败:API 令牌无效。" + "description": "Unauthorized - invalid API token" }, "403": { "content": { "application/json": {} }, - "description": "没有访问此资源的权限。" + "description": "`forbidden` : Insufficient permissions." }, "404": { "content": { "application/json": {} }, - "description": "`not_found` : 知识库未找到。" + "description": "`not_found` : Knowledge base not found." }, "500": { "content": { "application/json": {} }, - "description": "`internal_server_error` : 检索过程中发生内部错误。" + "description": "`internal_server_error` : An internal error occurred during retrieval." } }, - "summary": "已弃用的兼容端点", + "summary": "Retrieve Chunks from a Knowledge Base / Test Retrieval", "tags": [ - "知识库" + "Knowledge Bases" ] } } @@ -18456,32 +18473,27 @@ "items": { "type": "string" }, - "type": "array", - "description": "当 `allowed_file_types` 包含 `custom` 时允许的文件扩展名。扩展名可以包含或省略前导 `.`,匹配时不区分大小写。选择 `custom` 时,此列表必须至少包含一个扩展名。" + "type": "array" }, "allowed_file_types": { "items": { "$ref": "#/components/schemas/FileType" }, - "type": "array", - "description": "接收人可上传的文件类别:`image`、`document`、`audio`、`video` 或 `custom`。" + "type": "array" }, "allowed_file_upload_methods": { "items": { "$ref": "#/components/schemas/FileTransferMethod" }, - "type": "array", - "description": "接收人可使用的上传方式:`local_file` 或 `remote_url`。" + "type": "array" }, "output_variable_name": { - "type": "string", - "description": "用于在工作流中引用该输入提交值的变量名。" + "type": "string" }, "type": { "const": "file", "default": "file", - "type": "string", - "description": "`file`,用于上传单个文件。" + "type": "string" } }, "required": [ @@ -18495,8 +18507,7 @@ "items": { "type": "string" }, - "type": "array", - "description": "当 `allowed_file_types` 包含 `custom` 时允许的文件扩展名。扩展名可以包含或省略前导 `.`,匹配时不区分大小写。选择 `custom` 时,此列表必须至少包含一个扩展名。`file` 和 `file-list` 输入会包含此字段。" + "type": "array" }, "allowed_file_types": { "items": { @@ -18525,8 +18536,7 @@ "type": { "const": "file-list", "default": "file-list", - "type": "string", - "description": "`file-list`,用于上传多个文件。" + "type": "string" } }, "required": [ @@ -20038,8 +20048,7 @@ "type": { "const": "paragraph", "default": "paragraph", - "type": "string", - "description": "`paragraph`,用于输入多行文本。" + "type": "string" } }, "required": [ @@ -22528,18 +22537,15 @@ "SelectInputConfig": { "properties": { "option_source": { - "$ref": "#/components/schemas/StringListSource", - "description": "此下拉选项的来源。`constant` 使用 `value`;`variable` 使用 `selector` 引用的工作流变量。" + "$ref": "#/components/schemas/StringListSource" }, "output_variable_name": { - "type": "string", - "description": "用于在工作流中引用该输入提交值的变量名。" + "type": "string" }, "type": { "const": "select", "default": "select", - "type": "string", - "description": "`select`,用于从列表中单选。" + "type": "string" } }, "required": [ @@ -22881,19 +22887,16 @@ "items": { "type": "string" }, - "type": "array", - "description": "当 `type` 为 `variable` 时使用的工作流变量引用路径。" + "type": "array" }, "type": { - "$ref": "#/components/schemas/ValueSourceType", - "description": "`constant` 使用 `value`;`variable` 使用 `selector` 引用的工作流变量。" + "$ref": "#/components/schemas/ValueSourceType" }, "value": { "items": { "type": "string" }, - "type": "array", - "description": "当 `type` 为 `constant` 时使用的静态选项列表。" + "type": "array" } }, "required": [ @@ -22911,8 +22914,7 @@ "description": "当 `type` 为 `variable` 时的变量选择器路径。" }, "type": { - "$ref": "#/components/schemas/ValueSourceType", - "description": "`constant` 使用 `value`;`variable` 使用 `selector` 引用的工作流变量。" + "$ref": "#/components/schemas/ValueSourceType" }, "value": { "default": "", @@ -23212,19 +23214,16 @@ "properties": { "button_style": { "$ref": "#/components/schemas/ButtonStyle", - "default": "default", - "description": "按钮样式:`primary`、`default`、`accent` 或 `ghost`。" + "default": "default" }, "id": { "maxLength": 20, "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "type": "string", - "description": "操作按钮标识。提交表单时,将其作为 `action` 的值。" + "type": "string" }, "title": { "maxLength": 100, - "type": "string", - "description": "向接收人显示的按钮文本。" + "type": "string" } }, "required": [ @@ -24555,8 +24554,7 @@ "type": "null" } ], - "default": null, - "description": "工作流运行的输入变量。根据存储后端,返回值可能是已解析的 JSON 值,也可能是 JSON 编码字符串(例如 `{\"query\": \"...\"}`);字符串需由客户端解析。也可能为 `null`。" + "default": null }, "outputs": { "additionalProperties": true, From e2281d43e5a68fb2948c3869e3b6c4b01936de2a Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 26 Aug 2026 10:16:34 +0800 Subject: [PATCH 08/10] fix: preserve retained service api presentation --- en/api-reference/openapi_service.json | 202 ++++++++--------- ja/api-reference/openapi_service.json | 298 +++++++++++++++++--------- zh/api-reference/openapi_service.json | 298 +++++++++++++++++--------- 3 files changed, 485 insertions(+), 313 deletions(-) diff --git a/en/api-reference/openapi_service.json b/en/api-reference/openapi_service.json index 2d14c97f33..d1a1f6a114 100644 --- a/en/api-reference/openapi_service.json +++ b/en/api-reference/openapi_service.json @@ -462,7 +462,7 @@ "/chat-messages/{task_id}/stop": { "post": { "summary": "Stop Chat Message Generation", - "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nStops a chat message generation task. Only supported in `streaming` mode.\n\nFor Chatbot, Agent, and New Agent apps, `user` must match the identifier that started the task. A mismatch leaves the task running while the endpoint still returns success.", + "description": "**Available for**: Chatflow, New Agent, Chatbot, Agent apps.\n\nStops a chat message generation task. Only supported in `streaming` mode.", "operationId": "stop_chat_message", "tags": [ "Chat Messages" @@ -514,7 +514,7 @@ } } }, - "description": "Task stopped successfully" + "description": "Operation successful." }, "400": { "description": "- `not_chat_app` : App mode does not match the API route.\n- `invalid_param` : The required `user` field is missing.", @@ -1132,7 +1132,7 @@ } } }, - "description": "Feedback submitted successfully" + "description": "Operation successful." }, "400": { "description": "`invalid_param` : The required `user` field is omitted, or `rating` is `null` but there is no existing feedback to revoke.", @@ -2169,12 +2169,12 @@ "schema": { "properties": { "file": { - "description": "Audio file to transcribe. Supported MIME types: `audio/mp3`, `audio/mpga`, `audio/m4a`, `audio/x-m4a`, `audio/wav`, and `audio/amr`. File size limit is `30 MB`.", + "description": "Audio file to transcribe. Accepted MIME types: `audio/mp3`, `audio/m4a` (also accepted as `audio/x-m4a`), `audio/wav`, `audio/amr`, `audio/mpga`. Other types, including the common `audio/mpeg`, are rejected with `unsupported_audio_type`. Maximum size `30 MB`.", "format": "binary", "type": "string" }, "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", "type": "string" } }, @@ -4632,7 +4632,7 @@ "/workflows/tasks/{task_id}/stop": { "post": { "summary": "Stop Workflow Task", - "description": "**Available for**: Workflow apps.\n\nStops a running workflow task. Only supported in `streaming` mode.", + "description": "**Available for**: Workflow apps.\n\nStop a running workflow task. Only supported in `streaming` mode.", "operationId": "stop_workflow_task", "tags": [ "Workflow Runs" @@ -4684,7 +4684,7 @@ } } }, - "description": "Task stopped successfully" + "description": "Operation successful." }, "400": { "description": "- `not_workflow_app` : App mode does not match the API route.\n- `invalid_param` : A request parameter is missing or invalid, such as a missing `user`.", @@ -4971,7 +4971,7 @@ "/completion-messages/{task_id}/stop": { "post": { "summary": "Stop Completion Message Generation", - "description": "**Available for**: Text Generator apps.\n\nStops a completion message generation task. Only supported in `streaming` mode.\n\n`user` must match the identifier that started the task. If it differs, the task keeps running, but the endpoint still returns success.", + "description": "**Available for**: Text Generator apps.\n\nStops a completion message generation task. Only supported in `streaming` mode.", "operationId": "stop_completion", "tags": [ "Completion Messages" @@ -5023,7 +5023,7 @@ } } }, - "description": "Task stopped successfully" + "description": "Operation successful." }, "400": { "description": "- `app_unavailable` : App unavailable or misconfigured.\n- `invalid_param` : The required `user` field is missing.", @@ -6684,7 +6684,7 @@ "Documents" ], "summary": "Update Document", - "description": "Updates and re-indexes a file-based document. Provide either a replacement `file` or `data` containing a `process_rule`; `data` can accompany `file` to change processing settings. Track progress with the returned `batch` ID via [Get Document Indexing Status](/en/api-reference/documents/get-document-indexing-status).", + "description": "Updates a document by uploading a new file, then re-indexes it. This is the canonical endpoint for file-based document updates. Track progress with the returned `batch` ID via [Get Document Indexing Status](/en/api-reference/documents/get-document-indexing-status).", "operationId": "update_document_by_file", "parameters": [ { @@ -7413,7 +7413,7 @@ "Documents" ], "summary": "Update Document by File", - "description": "Deprecated. Use [Update Document](/en/api-reference/documents/update-document) instead. Provide either a replacement `file` or `data` containing a `process_rule`; `data` can accompany `file` to change processing settings. The document is re-indexed after the update.", + "description": "Deprecated. Use [Update Document](/en/api-reference/documents/update-document) instead. Updates a document by uploading a new file, then re-indexes it.", "operationId": "update_document_by_file_deprecated", "parameters": [ { @@ -13327,12 +13327,12 @@ "AnnotationReplyActionPayload": { "properties": { "embedding_model_name": { - "description": "Name of the embedding model to use for annotation matching.", + "description": "Embedding model used to vectorize annotations for matching (for example, `text-embedding-3-small`).", "title": "Embedding Model Name", "type": "string" }, "embedding_provider_name": { - "description": "Name of the embedding model provider.", + "description": "Embedding model provider (for example, `openai`). Get available providers from [Get Available Models](/en/api-reference/models/get-available-models).", "title": "Embedding Provider Name", "type": "string" }, @@ -14588,7 +14588,7 @@ "properties": { "auto_generate_name": { "default": true, - "description": "Auto-generate the conversation title. If `false`, use the Rename Conversation API with `auto_generate: true` to generate the title asynchronously.", + "description": "Auto-generate conversation title. If `false`, use the [Rename Conversation](/en/api-reference/conversations/rename-conversation) API with `auto_generate: true` for async title generation.", "title": "Auto Generate Name", "type": "boolean" }, @@ -14602,7 +14602,7 @@ } ], "default": null, - "description": "Conversation ID to continue a conversation. Omit this field or pass an empty string to start a new conversation, then pass the returned `conversation_id` in subsequent requests.", + "description": "ID of the conversation to continue. Omit it or pass an empty string to start a new conversation; the response returns a `conversation_id` to send with the next message. To resume an earlier conversation, get its ID from [List Conversations](/en/api-reference/conversations/list-conversations).", "title": "Conversation Id" }, "files": { @@ -14618,7 +14618,7 @@ "type": "string" }, "transfer_method": { - "description": "Transfer method: `remote_url` for a file URL or persisted uploaded-file reference, `local_file` for an uploaded file.", + "description": "Transfer method: `remote_url` for file URL, `local_file` for uploaded file.", "enum": [ "remote_url" ], @@ -14636,11 +14636,11 @@ "type": "string" }, "upload_file_id": { - "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API. Required for `local_file`; also accepted with `remote_url` for compatibility with persisted file references.", + "description": "Uploaded file ID obtained from the [Upload File](/en/api-reference/files/upload-file) API (required when `transfer_method` is `local_file`).", "type": "string" }, "url": { - "description": "File URL when `transfer_method` is `remote_url`.", + "description": "File URL (required when `transfer_method` is `remote_url`).", "format": "url", "type": "string" } @@ -14788,17 +14788,17 @@ } ], "default": null, - "description": "File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`.", + "description": "Files to attach to the message. For a local file, first upload it via [Upload File](/en/api-reference/files/upload-file), then reference the returned `id` as `upload_file_id` with `transfer_method: local_file`. New Agent apps accept file references but do not process their contents.", "title": "Files" }, "inputs": { "additionalProperties": true, - "description": "Values for app-defined variables. Refer to the `user_input_form` field in the [Get App Parameters](/en/api-reference/applications/get-app-parameters) response to discover expected variable names and types.", + "description": "Values for the app's input variables, keyed by variable name. The expected names and types come from the `user_input_form` field of [Get App Parameters](/en/api-reference/applications/get-app-parameters).", "title": "Inputs", "type": "object" }, "query": { - "description": "User input or question content.", + "description": "The user's message.", "title": "Query", "type": "string" }, @@ -14816,11 +14816,11 @@ } ], "default": null, - "description": "Response mode. `streaming` uses Server-Sent Events; `blocking` returns after completion. New Agent app mode supports streaming only. When omitted, non-Agent apps run in blocking mode and new Agent apps stream.", + "description": "Mode of response return. Defaults to blocking when omitted.\n\n- `streaming` (recommended): the reply arrives as Server-Sent Events.\n- `blocking`: returns once generation completes. Long generations risk interruption: on Dify Cloud, the edge proxy may end the connection if the response doesn't arrive within its timeout.\n- Agent and New Agent apps support `streaming` only; a `blocking` request fails with 400.", "title": "Response Mode" }, "user": { - "description": "End-user identifier, defined by your application and unique within it.", + "description": "End-user identifier, defined by your app and unique within it. Conversations, messages, and files are visible only to requests carrying the same `user`. See [End User Identity](/en/api-reference/guides/end-user-identity).", "type": "string" }, "workflow_id": { @@ -14833,7 +14833,7 @@ } ], "default": null, - "description": "Published workflow version ID to execute for advanced chat. If omitted, the app's current published workflow is used.", + "description": "Chatflow apps only. Specify a published workflow version ID to execute. If not provided, the latest published version is used. On Dify Cloud, pinning a version requires a paid plan.", "title": "Workflow Id" } }, @@ -15483,18 +15483,18 @@ } ], "default": null, - "description": "File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`.", + "description": "Files to attach to the request. For a local file, first upload it via [Upload File](/en/api-reference/files/upload-file), then reference the returned `id` as `upload_file_id` with `transfer_method: local_file`.", "title": "Files" }, "inputs": { "additionalProperties": true, - "description": "Values for app-defined variables. Refer to the `user_input_form` field in the [Get App Parameters](/en/api-reference/applications/get-app-parameters) response to discover expected variable names and types.", + "description": "Values for the app's input variables, keyed by variable name. The expected names and types come from the `user_input_form` field of [Get App Parameters](/en/api-reference/applications/get-app-parameters).", "title": "Inputs", "type": "object" }, "query": { "default": "", - "description": "User input or prompt content.", + "description": "The text to process. Legacy field; newer apps pass this inside `inputs` instead.", "title": "Query", "type": "string" }, @@ -15512,11 +15512,11 @@ } ], "default": null, - "description": "Response mode. `streaming` uses Server-Sent Events; `blocking` returns after completion. When omitted, the request runs in blocking mode.", + "description": "Mode of response return. `streaming` (recommended) uses SSE. `blocking` returns after completion (may be interrupted for long processes). Cloudflare timeout is `100 s`. When omitted, defaults to blocking behavior.", "title": "Response Mode" }, "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "description": "End-user identifier, defined by your app and unique within it. Messages and files are visible only to requests carrying the same `user`. See [End User Identity](/en/api-reference/guides/end-user-identity).", "type": "string" } }, @@ -15531,7 +15531,7 @@ "description": "Condition detail", "properties": { "comparison_operator": { - "description": "Comparison to apply. String operators (`contains`, `not contains`, `start with`, `end with`, `is`, `is not`, `empty`, `not empty`, `in`, `not in`) act on string or array metadata; numeric operators (`=`, `≠`, `>`, `<`, `≥`, `≤`) act on numeric metadata; time operators (`before`, `after`) act on time metadata.", + "description": "Comparison to apply, by metadata type:\n\n- String or array metadata: `contains`, `not contains`, `start with`, `end with`, `is`, `is not`, `empty`, `not empty`, `in`, `not in`\n- Numeric metadata: `=`, `≠`, `>`, `<`, `≥`, `≤`\n- Time metadata: `before`, `after`", "enum": [ "<", "=", @@ -15579,7 +15579,7 @@ } ], "default": null, - "description": "Value to compare against. Type depends on `comparison_operator`: string for most string operators, array of strings for `in` and `not in`, number for numeric operators, and omit or use `null` for `empty` and `not empty`.", + "description": "Value to compare against. Type depends on `comparison_operator`: string for most string operators, array of strings for `in` and `not in`, number for numeric operators, and omitted for `empty` and `not empty`.", "title": "Value" } }, @@ -15758,11 +15758,11 @@ } ], "default": null, - "description": "Conversation name. Required when `auto_generate` is `false`.", + "description": "New conversation name. Required unless `auto_generate` is `true`.", "title": "Name" }, "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", "type": "string" } }, @@ -15953,7 +15953,7 @@ "ConversationVariableUpdatePayloadWithUser": { "properties": { "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", "type": "string" }, "value": { @@ -16094,7 +16094,7 @@ } ], "default": null, - "description": "Embedding model provider. Use the `provider` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). A bare name like `openai` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", "title": "Embedding Model Provider" }, "external_knowledge_api_id": { @@ -16107,7 +16107,7 @@ } ], "default": null, - "description": "ID of the external knowledge API.", + "description": "ID of the external knowledge API connection.", "title": "External Knowledge Api Id" }, "external_knowledge_id": { @@ -16157,11 +16157,11 @@ } ], "default": "only_me", - "description": "Controls who can access this knowledge base. `only_me` restricts access to the creator, `all_team_members` grants workspace-wide access, and `partial_members` grants access to specified members." + "description": "Controls who can access this knowledge base. `only_me` restricts to the creator, `all_team_members` grants access to the entire workspace, `partial_members` grants access to specified members." }, "provider": { "default": "vendor", - "description": "Knowledge base provider: `vendor` for internal knowledge bases, `external` for external ones.", + "description": "`vendor` for internal knowledge base, `external` for external knowledge base.", "enum": [ "external", "vendor" @@ -17528,7 +17528,7 @@ } ], "default": null, - "description": "Embedding model provider. Use the `provider` field from [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", + "description": "Embedding model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). A bare name like `openai` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=text-embedding`.", "title": "Embedding Model Provider" }, "external_knowledge_api_id": { @@ -17541,7 +17541,7 @@ } ], "default": null, - "description": "ID of the external knowledge API.", + "description": "ID of the external knowledge API connection.", "title": "External Knowledge Api Id" }, "external_knowledge_id": { @@ -17648,7 +17648,7 @@ } ], "default": null, - "description": "Controls who can access this knowledge base. `only_me` restricts access to the creator, `all_team_members` grants workspace-wide access, and `partial_members` grants access to specified members." + "description": "Controls who can access this knowledge base. `only_me` restricts to the creator, `all_team_members` grants access to the entire workspace, `partial_members` grants access to specified members." }, "retrieval_model": { "anyOf": [ @@ -17806,7 +17806,7 @@ } ], "default": null, - "description": "Datasource credential ID. Uses the default if omitted.", + "description": "ID of the credential to authenticate with the datasource, from the `credentials` array of [List Datasource Plugins](/en/api-reference/knowledge-pipeline/list-datasource-plugins).", "title": "Credential Id" }, "datasource_type": { @@ -17827,7 +17827,7 @@ "type": "object" }, "is_published": { - "description": "Whether to run the published or draft version of the node. `true` runs the published version, `false` runs the draft.", + "description": "Whether to run the published version of the node instead of the draft.", "title": "Is Published", "type": "boolean" } @@ -17969,7 +17969,7 @@ "description": "Request payload for bulk downloading documents as a zip archive.", "properties": { "document_ids": { - "description": "List of document IDs to include in the ZIP download.", + "description": "Document IDs to include in the archive. Get them from [List Documents](/en/api-reference/documents/list-documents).", "items": { "format": "uuid", "type": "string" @@ -18402,13 +18402,13 @@ "DocumentMetadataOperation": { "properties": { "document_id": { - "description": "Document ID whose metadata should be updated.", + "description": "ID of the document to update. See [List Documents](/en/api-reference/documents/list-documents).", "format": "uuid", "title": "Document Id", "type": "string" }, "metadata_list": { - "description": "Metadata fields to update.", + "description": "Metadata fields to set on the document.", "items": { "$ref": "#/components/schemas/MetadataDetail" }, @@ -18791,7 +18791,7 @@ "DocumentStatusPayload": { "properties": { "document_ids": { - "description": "List of document IDs to update.", + "description": "Document IDs to update. Get them from [List Documents](/en/api-reference/documents/list-documents).", "items": { "type": "string" }, @@ -19047,7 +19047,7 @@ } ], "default": null, - "description": "`high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing. Required when adding the first document to a knowledge base; subsequent documents inherit the knowledge base's indexing technique if omitted.", + "description": "Required when adding the first document to a knowledge base. Subsequent documents inherit the knowledge base's indexing technique if omitted. `high_quality` uses embedding models for precise search; `economy` uses keyword-based indexing.", "title": "Indexing Technique" }, "name": { @@ -19065,7 +19065,7 @@ } ], "default": null, - "description": "Original document ID for replacement.", + "description": "Original document ID for versioning. Get it from [List Documents](/en/api-reference/documents/list-documents).", "title": "Original Document Id" }, "process_rule": { @@ -19393,7 +19393,8 @@ "type": "string" }, "title": "Allowed File Extensions", - "type": "array" + "type": "array", + "description": "Allowed file extensions when `allowed_file_types` includes `custom`. Include the leading `.` in each extension, for example `.md`. Present for `file` and `file-list` inputs." }, "allowed_file_types": { "items": { @@ -19427,7 +19428,8 @@ "const": "file-list", "default": "file-list", "title": "Type", - "type": "string" + "type": "string", + "description": "Form input control type. Available values: `paragraph` (multi-line text input), `select` (single-choice from a list), `file` (single file upload), and `file-list` (multiple file uploads)." } }, "required": [ @@ -20301,7 +20303,7 @@ "HumanInputFormSubmitPayloadWithUser": { "properties": { "action": { - "description": "ID of the action button the recipient selected. Must match one of the `id` values from the form's `user_actions` list.", + "description": "ID of the action button the recipient selected. Must match one of the `id` values from the form's `user_actions` list (returned by [Get Human Input Form](/en/api-reference/human-input/get-human-input-form)).", "title": "Action", "type": "string" }, @@ -20309,7 +20311,7 @@ "additionalProperties": { "$ref": "#/components/schemas/JsonValue" }, - "description": "Submitted human input values keyed by output variable name. Use a string for paragraph or select input values, a file mapping for file inputs, and a list of file mappings for file-list inputs. Local file mappings use `transfer_method=local_file` with `upload_file_id`; remote file mappings use `transfer_method=remote_url` with `url` or `remote_url`.", + "description": "Submitted values keyed by each input's `output_variable_name`. Paragraph and select inputs take a string; a `file` input takes one file mapping; a `file-list` input takes an array of file mappings.\n\nA file mapping is `{transfer_method: local_file, upload_file_id, type}` or `{transfer_method: remote_url, url, type}`, where `type` is one of the field's `allowed_file_types`. For `local_file`, `upload_file_id` is the `id` from [Upload File](/en/api-reference/files/upload-file).\n\nUse a consistent `user` across the run, upload, and submit.", "examples": [ { "attachment": { @@ -20336,7 +20338,7 @@ "type": "object" }, "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "description": "End-user identifier, defined by your app and unique within it. Service API and web app user IDs are separate, even when identical. See [End User Identity](/en/api-reference/guides/end-user-identity).", "type": "string" } }, @@ -20525,7 +20527,7 @@ "title": "Rating" }, "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "description": "End-user identifier, defined by your app and unique within it. Must match the `user` that received the message, since feedback is scoped to that end user. See [End User Identity](/en/api-reference/guides/end-user-identity).", "type": "string" } }, @@ -20895,7 +20897,7 @@ "MetadataArgs": { "properties": { "name": { - "description": "Metadata field name.", + "description": "Name for the metadata field. Must be unique among the knowledge base's fields and at most 255 characters.", "title": "Name", "type": "string" }, @@ -20920,7 +20922,7 @@ "MetadataDetail": { "properties": { "id": { - "description": "Metadata field ID.", + "description": "Metadata field ID. See [List Metadata Fields](/en/api-reference/metadata/list-metadata-fields).", "format": "uuid", "title": "Id", "type": "string" @@ -21002,7 +21004,7 @@ "description": "Metadata operation data", "properties": { "operation_data": { - "description": "Array of document metadata update operations. Each entry maps a document ID to its metadata values.", + "description": "Document metadata update operations, one entry per document.", "items": { "$ref": "#/components/schemas/DocumentMetadataOperation" }, @@ -21019,7 +21021,7 @@ "MetadataUpdatePayload": { "properties": { "name": { - "description": "New metadata field name.", + "description": "New name for the field. Must be unique among the knowledge base's fields and at most 255 characters.", "title": "Name", "type": "string" } @@ -21094,7 +21096,7 @@ "OptionalServiceApiUserPayload": { "properties": { "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", "type": "string" } }, @@ -21125,7 +21127,8 @@ "const": "paragraph", "default": "paragraph", "title": "Type", - "type": "string" + "type": "string", + "description": "Form input control type. Available values: `paragraph` (multi-line text input), `select` (single-choice from a list), `file` (single file upload), and `file-list` (multiple file uploads)." } }, "required": [ @@ -22526,7 +22529,7 @@ { "properties": { "name": { - "description": "Document title. Defaults to `untitled`.", + "description": "Document title. Defaults to `\"untitled\"`.", "type": "string" }, "reference": { @@ -22543,7 +22546,7 @@ { "properties": { "credential_id": { - "description": "Credential for authenticating with the external platform. If omitted, the provider's default credential is used.", + "description": "Credential for authenticating with the external platform. Managed via the Dify console. If omitted, the provider's default credential is used.", "type": "string" }, "page": { @@ -22554,11 +22557,11 @@ "type": "string" }, "page_name": { - "description": "Display name. Defaults to `untitled`.", + "description": "Display name. Defaults to `\"untitled\"`.", "type": "string" }, "type": { - "description": "Page type defined by the datasource plugin.", + "description": "Page type defined by the datasource plugin (e.g., `\"page\"`, `\"database\"`).", "type": "string" } }, @@ -22569,7 +22572,7 @@ "type": "object" }, "workspace_id": { - "description": "ID of the workspace or database in the external platform.", + "description": "ID of the workspace or database in the external platform (e.g., a Notion workspace ID).", "type": "string" } }, @@ -22583,7 +22586,7 @@ { "properties": { "title": { - "description": "Used as the document name. Defaults to `untitled`.", + "description": "Used as the document name. Defaults to `\"untitled\"`.", "type": "string" }, "url": { @@ -22600,7 +22603,7 @@ { "properties": { "bucket": { - "description": "Storage bucket name. Required by some drive providers, such as S3-compatible stores; omit if the provider does not use buckets.", + "description": "Storage bucket name. Required by some drive providers (e.g., S3-compatible stores); omit if the provider does not use buckets.", "type": "string" }, "id": { @@ -22608,7 +22611,7 @@ "type": "string" }, "name": { - "description": "File name. Defaults to `untitled`.", + "description": "File name. Defaults to `\"untitled\"`.", "type": "string" }, "type": { @@ -22650,12 +22653,12 @@ "type": "object" }, "is_published": { - "description": "Whether to run the published or draft version of the pipeline. `true` runs the latest published version; `false` runs the current draft (useful for testing unpublished changes).", + "description": "Whether to run the published version of the pipeline instead of the current draft. Run the draft to test unpublished changes.", "title": "Is Published", "type": "boolean" }, "response_mode": { - "description": "Response mode for draft runs. Use `streaming` for SSE or `blocking` for JSON. Published runs are queued and always return batch metadata as JSON.", + "description": "Response mode for the pipeline execution. `streaming` returns a Server-Sent Events stream, `blocking` waits and returns the complete result.", "enum": [ "blocking", "streaming" @@ -22664,7 +22667,7 @@ "type": "string" }, "start_node_id": { - "description": "ID of the datasource node where the run starts.", + "description": "ID of the node to start execution from, from [List Datasource Plugins](/en/api-reference/knowledge-pipeline/list-datasource-plugins).", "title": "Start Node Id", "type": "string" } @@ -23033,7 +23036,7 @@ } ], "default": null, - "description": "Provider name of the reranking model.", + "description": "Reranking model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/cohere/cohere`). A bare name like `cohere` expands to `langgenius//` and works only for langgenius-published plugins.\n\nGet valid values from the `provider` field of [Get Available Models](/en/api-reference/models/get-available-models) with `model_type=rerank`.", "title": "Reranking Provider Name" } }, @@ -23190,7 +23193,7 @@ } ], "default": null, - "description": "Answer content for QA mode.", + "description": "Answer text. Required for Q&A-mode (`qa_model`) documents.", "title": "Answer" }, "attachment_ids": { @@ -23660,7 +23663,7 @@ } ], "default": null, - "description": "Updated answer content for QA mode.", + "description": "Answer text for Q&A-mode (`qa_model`) documents.", "title": "Answer" }, "attachment_ids": { @@ -23689,7 +23692,7 @@ } ], "default": null, - "description": "Updated chunk text content.", + "description": "Chunk text content.", "title": "Content" }, "enabled": { @@ -23718,12 +23721,12 @@ } ], "default": null, - "description": "Updated keywords for the chunk.", + "description": "Keywords for the chunk.", "title": "Keywords" }, "regenerate_child_chunks": { "default": false, - "description": "Whether to regenerate child chunks after updating a parent chunk.", + "description": "Whether to regenerate child chunks.", "title": "Regenerate Child Chunks", "type": "boolean" }, @@ -24267,7 +24270,7 @@ "TagBindingPayload": { "properties": { "tag_ids": { - "description": "Tag IDs to bind.", + "description": "IDs of the tags to bind. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags). Unknown tag IDs are silently ignored.", "items": { "type": "string" }, @@ -24276,7 +24279,7 @@ "type": "array" }, "target_id": { - "description": "Knowledge base ID to bind the tags to.", + "description": "Knowledge base to bind the tags to. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases).", "title": "Target Id", "type": "string" } @@ -24291,7 +24294,7 @@ "TagCreatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "Tag name. Must be unique within the workspace.", "maxLength": 50, "minLength": 1, "title": "Name", @@ -24307,7 +24310,7 @@ "TagDeletePayload": { "properties": { "tag_id": { - "description": "Tag ID to delete.", + "description": "ID of the tag to delete. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags).", "title": "Tag Id", "type": "string" } @@ -24324,11 +24327,11 @@ "properties": { "tag_id": { "deprecated": true, - "description": "Legacy single tag ID accepted by the Service API.", + "description": "Legacy single-tag form. Normalized into `tag_ids` server-side. Use `tag_ids` for new integrations.", "type": "string" }, "tag_ids": { - "description": "Tag IDs to unbind. Use this for new integrations.", + "description": "Tag IDs to unbind. Required unless the legacy `tag_id` is provided. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags).", "items": { "type": "string" }, @@ -24336,7 +24339,7 @@ "type": "array" }, "target_id": { - "description": "Knowledge base ID.", + "description": "Knowledge base to unbind the tags from. See [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases).", "title": "Target Id", "type": "string" } @@ -24388,14 +24391,14 @@ "TagUpdatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "New name for the tag. Must be unique within the workspace.", "maxLength": 50, "minLength": 1, "title": "Name", "type": "string" }, "tag_id": { - "description": "Tag ID to update.", + "description": "ID of the tag to rename. See [List Knowledge Type Tags](/en/api-reference/tags/list-knowledge-tags).", "title": "Tag Id", "type": "string" } @@ -24479,7 +24482,7 @@ } ], "default": null, - "description": "Message ID. Takes priority over `text` when both are provided.", + "description": "ID of the message whose answer to voice. Takes priority over `text` when both are provided. Get message IDs from [List Conversation Messages](/en/api-reference/conversations/list-conversation-messages).", "title": "Message Id" }, "streaming": { @@ -24492,7 +24495,7 @@ } ], "default": null, - "description": "Reserved for compatibility; TTS response streaming is determined by the provider output.", + "description": "Accepted for backward compatibility but has no effect. Whether the audio is streamed is determined by the configured TTS provider's output, not by this field.", "title": "Streaming" }, "text": { @@ -24505,11 +24508,11 @@ } ], "default": null, - "description": "Speech content to convert.", + "description": "Text to synthesize into speech.", "title": "Text" }, "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "description": "End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).", "type": "string" }, "voice": { @@ -24522,7 +24525,7 @@ } ], "default": null, - "description": "Voice to use for text-to-speech. Available voices depend on the TTS provider configured for this app. Omit to use the app's configured voice when available; that value is exposed by [Get App Parameters](/en/api-reference/applications/get-app-parameters) as `text_to_speech.voice`.", + "description": "Voice to use for text-to-speech. Available voices depend on the TTS provider configured for this app. Use the `voice` value from [Get App Parameters](/en/api-reference/applications/get-app-parameters) → `text_to_speech.voice` for the default.", "title": "Voice" } }, @@ -24563,7 +24566,7 @@ "type": "object" }, "UserActionConfig": { - "description": "User action configuration.", + "description": "An action button on a human input form.", "properties": { "button_style": { "$ref": "#/components/schemas/ButtonStyle", @@ -24672,7 +24675,7 @@ "type": "string" }, "vector_weight": { - "description": "Weight assigned to semantic vector search results.", + "description": "Weight assigned to semantic (vector) search results.", "title": "Vector Weight", "type": "number" } @@ -25928,12 +25931,12 @@ } ], "default": null, - "description": "File list for workflow system file inputs. Available when file upload is enabled for the workflow. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`.", + "description": "File list. Suitable when files need to be combined with text for input, available only when the model supports Vision capability. To attach a local file, first upload it via [Upload File](/en/api-reference/files/upload-file) and use the returned `id` as `upload_file_id` with `transfer_method: local_file`.", "title": "Files" }, "inputs": { "additionalProperties": true, - "description": "Key-value pairs for workflow input variables. Values for file-type variables should be arrays of file objects with `type`, `transfer_method`, and either `url` or `upload_file_id`. Refer to the `user_input_form` field in the [Get App Parameters](/en/api-reference/applications/get-app-parameters) response to discover the variable names and types expected by your app.", + "description": "Key-value pairs for workflow input variables. Discover the variable names and types your app expects from the `user_input_form` field of [Get App Parameters](/en/api-reference/applications/get-app-parameters).\n\nFile-type variables take an array of file objects with `type`, `transfer_method`, and either `url` or `upload_file_id`.", "title": "Inputs", "type": "object" }, @@ -25951,11 +25954,11 @@ } ], "default": null, - "description": "Response mode. Use `blocking` for synchronous responses or `streaming` for Server-Sent Events. When omitted, the request runs in blocking mode.", + "description": "Response mode. Use `blocking` for synchronous responses (Cloudflare timeout is `100 s`), or `streaming` for Server-Sent Events. When omitted, defaults to blocking behavior.", "title": "Response Mode" }, "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", + "description": "End-user identifier, defined by your app and unique within it. Scopes data access: a workflow run and its files are only visible to later requests that carry the same `user`. See [End User Identity](/en/api-reference/guides/end-user-identity).", "type": "string" } }, @@ -26059,7 +26062,8 @@ } ], "default": null, - "title": "Inputs" + "title": "Inputs", + "description": "Input variables of the workflow run, returned as a raw JSON string that clients must parse (e.g., `{\"query\": \"...\"}`). May be `null`." }, "outputs": { "additionalProperties": true, diff --git a/ja/api-reference/openapi_service.json b/ja/api-reference/openapi_service.json index 2fdd2777a9..58611263c4 100644 --- a/ja/api-reference/openapi_service.json +++ b/ja/api-reference/openapi_service.json @@ -462,7 +462,7 @@ "/chat-messages/{task_id}/stop": { "post": { "summary": "生成を停止", - "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\nチャットメッセージ生成タスクを停止します。`streaming` モードでのみサポートされます。\n\nチャットボット、Agent、新しい Agent では、`user` をタスク開始時に使用した識別子と一致させる必要があります。一致しない場合、タスクは実行を続けますが、エンドポイントは成功を返します。", + "description": "**対象アプリ**:Chatflow、新しい Agent、チャットボット、Agent。\n\nチャットメッセージ生成タスクを停止します。`streaming` モードでのみサポートされます。", "operationId": "stop_chat_message", "tags": [ "チャットメッセージ" @@ -513,7 +513,7 @@ } } }, - "description": "リクエストが成功しました。" + "description": "操作が成功しました。" }, "400": { "description": "- `not_chat_app` : アプリモードが API ルートと一致しません。\n- `invalid_param` : 必須の `user` フィールドがありません。", @@ -1125,7 +1125,7 @@ } } }, - "description": "リクエストが成功しました。" + "description": "操作が成功しました。" }, "400": { "description": "`invalid_param` : 必須の `user` フィールドが省略されているか、`rating` が `null` であるにもかかわらず取り消す既存のフィードバックがありません。", @@ -2154,11 +2154,12 @@ "properties": { "file": { "format": "binary", - "type": "string" + "type": "string", + "description": "文字起こしする音声ファイルです。受け付ける MIME タイプは `audio/mp3`、`audio/m4a`(`audio/x-m4a` も受け付けます)、`audio/wav`、`audio/amr`、`audio/mpga` です。それ以外のタイプ(一般的な `audio/mpeg` を含む)は `unsupported_audio_type` で拒否されます。最大サイズは `30 MB` です。" }, "user": { "type": "string", - "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" } }, "required": [ @@ -4054,7 +4055,7 @@ } }, "404": { - "description": "`not_found` : ワークフロー実行記録が見つかりません。", + "description": "`not_found` : Workflow run not found.", "content": { "application/json": { "examples": { @@ -4651,7 +4652,7 @@ } } }, - "description": "リクエストが成功しました。" + "description": "操作が成功しました。" }, "400": { "description": "- `not_workflow_app` : アプリモードが API ルートと一致しません。\n- `invalid_param` : リクエストパラメータが不足または無効です(`user` の欠落など)。", @@ -4938,7 +4939,7 @@ "/completion-messages/{task_id}/stop": { "post": { "summary": "生成を停止", - "description": "**対象アプリ**:テキストジェネレーター。\n\nテキスト生成メッセージ生成タスクを停止します。`streaming` モードでのみサポートされています。\n\n`user` は、タスク開始時に使用した識別子と一致する必要があります。一致しない場合、タスクは実行を続けますが、エンドポイントは成功を返します。", + "description": "**対象アプリ**:テキストジェネレーター。\n\nテキスト生成メッセージ生成タスクを停止します。`streaming` モードでのみサポートされています。", "operationId": "stop_completion", "tags": [ "完了メッセージ" @@ -4989,7 +4990,7 @@ } } }, - "description": "リクエストが成功しました。" + "description": "操作が成功しました。" }, "400": { "description": "- `app_unavailable` : アプリケーションが利用できないか、設定が正しくありません。\n- `invalid_param` : 必須の `user` フィールドがありません。", @@ -6637,7 +6638,7 @@ "ドキュメント" ], "summary": "ドキュメントを更新", - "description": "ファイルベースのドキュメントを更新し、再インデックスします。置換用の `file`、または `process_rule` を含む `data` のどちらかが必要です。処理設定も変更する場合は、`file` と `data` を同時に指定できます。返された `batch` ID を使って [ドキュメント埋め込みステータス(進捗)を取得](/ja/api-reference/documents/get-document-indexing-status) で進捗を追跡します。", + "description": "新しいファイルをアップロードしてドキュメントを更新し、再インデックスします。これはファイルベースのドキュメント更新の正規エンドポイントです。返された `batch` ID を使って [ドキュメント埋め込みステータス(進捗)を取得](/ja/api-reference/documents/get-document-indexing-status) で進捗を追跡します。", "operationId": "update_document_by_file", "parameters": [ { @@ -7358,7 +7359,7 @@ "ドキュメント" ], "summary": "ファイルでドキュメントを更新", - "description": "非推奨です。代わりに [ドキュメントを更新](/ja/api-reference/documents/update-document) を使用してください。置換用の `file`、または `process_rule` を含む `data` のどちらかが必要です。処理設定も変更する場合は、`file` と `data` を同時に指定できます。更新後にドキュメントが再インデックスされます。", + "description": "非推奨です。代わりに [ドキュメントを更新](/ja/api-reference/documents/update-document) を使用してください。新しいファイルをアップロードしてドキュメントを更新し、再インデックスします。", "operationId": "update_document_by_file_deprecated", "parameters": [ { @@ -13114,10 +13115,12 @@ "AnnotationReplyActionPayload": { "properties": { "embedding_model_name": { - "type": "string" + "type": "string", + "description": "マッチングのためにアノテーションをベクトル化する埋め込みモデルです(例:`text-embedding-3-small`)。" }, "embedding_provider_name": { - "type": "string" + "type": "string", + "description": "埋め込みモデルプロバイダーです(例:`openai`)。利用可能なプロバイダーは [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) から取得します。" }, "score_threshold": { "description": "アノテーションがマッチとみなされるための最低類似度スコアです。値が高いほど、より正確なマッチが必要になります。", @@ -14235,7 +14238,8 @@ "properties": { "auto_generate_name": { "default": true, - "type": "boolean" + "type": "boolean", + "description": "会話タイトルを自動生成します。`false` の場合、[会話の名前を変更](/ja/api-reference/conversations/rename-conversation) API で `auto_generate: true` を設定して非同期でタイトルを生成します。" }, "conversation_id": { "anyOf": [ @@ -14246,7 +14250,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "継続する会話の ID です。省略するか空文字列を渡すと新しい会話を開始します。レスポンスで `conversation_id` が返されるので、次のメッセージで渡します。以前の会話を再開するには、その ID を [会話一覧を取得](/ja/api-reference/conversations/list-conversations) から取得します。" }, "files": { "anyOf": [ @@ -14263,7 +14268,8 @@ "enum": [ "remote_url" ], - "type": "string" + "type": "string", + "description": "転送方法です。ファイル URL の場合は `remote_url`、アップロードファイルの場合は `local_file` です。" }, "type": { "description": "ファイルタイプ。", @@ -14277,11 +14283,13 @@ "type": "string" }, "upload_file_id": { - "type": "string" + "type": "string", + "description": "[ファイルをアップロード](/ja/api-reference/files/upload-file) API から取得したアップロード済みファイル ID です(`transfer_method` が `local_file` の場合は必須)。" }, "url": { "format": "url", - "type": "string" + "type": "string", + "description": "ファイル URL(`transfer_method` が `remote_url` の場合は必須)です。" } }, "required": [ @@ -14414,14 +14422,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "メッセージに添付するファイルです。ローカルファイルの場合は、まず [ファイルをアップロード](/ja/api-reference/files/upload-file) でアップロードし、返された `id` を `upload_file_id` として `transfer_method: local_file` で参照します。新しい Agent アプリはファイル参照を受け付けますが、その内容は処理しません。" }, "inputs": { "additionalProperties": true, - "type": "object" + "type": "object", + "description": "アプリの入力変数の値を、変数名をキーとして指定します。期待される名前と型は、[アプリケーションのパラメータ情報を取得](/ja/api-reference/applications/get-app-parameters) の `user_input_form` フィールドで確認できます。" }, "query": { - "type": "string" + "type": "string", + "description": "ユーザーのメッセージです。" }, "response_mode": { "anyOf": [ @@ -14436,11 +14447,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "レスポンスの返却モードです。省略した場合はブロッキングになります。\n\n- `streaming`(推奨):応答は Server-Sent Events として届きます。\n- `blocking`:生成の完了後に返します。長時間の生成は中断されるおそれがあります。Dify Cloud では、応答がタイムアウト内に届かないと、エッジプロキシが接続を終了する場合があります。\n- Agent と新しい Agent アプリは `streaming` のみに対応します。`blocking` のリクエストは 400 で失敗します。" }, "user": { "type": "string", - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value." + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。会話、メッセージ、ファイルは、同じ `user` を持つリクエストにのみ表示されます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" }, "workflow_id": { "anyOf": [ @@ -14451,7 +14463,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Chatflow アプリでのみ使用できます。 実行する公開済みワークフローバージョンの ID を指定します。指定しない場合、最新の公開バージョンが使用されます。Dify Cloud では、バージョンの指定には有料プランが必要です。" } }, "required": [ @@ -15024,15 +15037,18 @@ "type": "null" } ], - "default": null + "default": null, + "description": "リクエストに添付するファイルです。ローカルファイルの場合は、まず [ファイルをアップロード](/ja/api-reference/files/upload-file) でアップロードし、返された `id` を `upload_file_id` として `transfer_method: local_file` で参照します。" }, "inputs": { "additionalProperties": true, - "type": "object" + "type": "object", + "description": "アプリの入力変数の値を、変数名をキーとして指定します。期待される名前と型は、[アプリケーションのパラメータ情報を取得](/ja/api-reference/applications/get-app-parameters) の `user_input_form` フィールドで確認できます。" }, "query": { "default": "", - "type": "string" + "type": "string", + "description": "処理するテキストです。レガシーフィールドで、新しいアプリではこの値を `inputs` の中で渡します。" }, "response_mode": { "anyOf": [ @@ -15047,11 +15063,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "レスポンスの返却モード。`streaming`(推奨)は SSE を使用します。`blocking` は完了後に返却します(長時間の処理では中断される場合があります)。Cloudflare のタイムアウトは `100 s` です。省略した場合、デフォルトでブロッキングモードになります。" }, "user": { "type": "string", - "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。メッセージとファイルは、同じ `user` を持つリクエストにのみ表示されます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" } }, "required": [ @@ -15083,7 +15100,8 @@ "≤", "≥" ], - "type": "string" + "type": "string", + "description": "適用する比較方法です。メタデータのタイプ別:\n\n- 文字列または配列のメタデータ:`contains`、`not contains`、`start with`、`end with`、`is`、`is not`、`empty`、`not empty`、`in`、`not in`\n- 数値メタデータ:`=`、`≠`、`>`、`<`、`≥`、`≤`\n- 時刻メタデータ:`before`、`after`" }, "name": { "description": "比較対象とするメタデータフィールド名です。", @@ -15107,7 +15125,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "比較対象の値です。型は `comparison_operator` によって異なります。ほとんどの文字列演算子では文字列、`in` および `not in` では文字列配列、数値演算子では数値、`empty` および `not empty` では省略します。" } }, "required": [ @@ -15263,11 +15282,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "新しい会話名です。`auto_generate` が `true` でない限り必須です。" }, "user": { "type": "string", - "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" } }, "required": [ @@ -15438,7 +15458,7 @@ "properties": { "user": { "type": "string", - "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" }, "value": { "description": "変数の新しい値。変数の期待される型と一致する必要があります。" @@ -15548,7 +15568,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "埋め込みモデル名です。[利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `model` フィールドの値を使用します。" }, "embedding_model_provider": { "anyOf": [ @@ -15559,7 +15580,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。`openai` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `provider` フィールドから取得します。" }, "external_knowledge_api_id": { "anyOf": [ @@ -15570,7 +15592,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部ナレッジ API 接続の ID です。" }, "external_knowledge_id": { "anyOf": [ @@ -15615,7 +15638,8 @@ "type": "null" } ], - "default": "only_me" + "default": "only_me", + "description": "このナレッジベースにアクセスできるユーザーを制御します。`only_me` は作成者のみに制限、`all_team_members` はワークスペース全体にアクセスを許可、`partial_members` は指定されたメンバーにアクセスを許可します。" }, "provider": { "default": "vendor", @@ -15623,7 +15647,8 @@ "external", "vendor" ], - "type": "string" + "type": "string", + "description": "`vendor` は内部ナレッジベース、`external` は外部ナレッジベースです。" }, "retrieval_model": { "anyOf": [ @@ -16827,7 +16852,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "埋め込みモデル名です。[利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `model` フィールドの値を使用します。" }, "embedding_model_provider": { "anyOf": [ @@ -16838,7 +16864,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "埋め込みモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。`openai` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `provider` フィールドから取得します。" }, "external_knowledge_api_id": { "anyOf": [ @@ -16849,7 +16876,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部ナレッジ API 接続の ID です。" }, "external_knowledge_id": { "anyOf": [ @@ -16868,7 +16896,8 @@ { "properties": { "score_threshold": { - "type": "number" + "type": "number", + "description": "結果フィルタリング用の最小関連性スコア閾値です。" }, "score_threshold_enabled": { "description": "スコア閾値フィルタリングが有効かどうかです。", @@ -16948,7 +16977,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このナレッジベースにアクセスできるユーザーを制御します。`only_me` は作成者のみに制限、`all_team_members` はワークスペース全体にアクセスを許可、`partial_members` は指定されたメンバーにアクセスを許可します。" }, "retrieval_model": { "anyOf": [ @@ -17092,7 +17122,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "データソースとの認証に使用する認証情報の ID です。[データソースプラグインリストを取得](/ja/api-reference/knowledge-pipeline/list-datasource-plugins) の `credentials` 配列から取得します。" }, "datasource_type": { "description": "データソースの種類です。", @@ -17110,7 +17141,8 @@ "type": "object" }, "is_published": { - "type": "boolean" + "type": "boolean", + "description": "ドラフトではなくノードの公開バージョンを実行するかどうかを指定します。" } }, "required": [ @@ -17240,7 +17272,8 @@ }, "maxItems": 100, "minItems": 1, - "type": "array" + "type": "array", + "description": "アーカイブに含めるドキュメント ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) から取得します。" } }, "required": [ @@ -17619,13 +17652,15 @@ "properties": { "document_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "更新するドキュメントの ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) を参照してください。" }, "metadata_list": { "items": { "$ref": "#/components/schemas/MetadataDetail" }, - "type": "array" + "type": "array", + "description": "ドキュメントに設定するメタデータフィールドです。" }, "partial_update": { "default": false, @@ -17972,7 +18007,8 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "更新するドキュメント ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) から取得します。" } }, "type": "object" @@ -18173,7 +18209,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "埋め込みモデル名です。[利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `model` フィールドの値を使用します。" }, "embedding_model_provider": { "anyOf": [ @@ -18184,7 +18221,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "埋め込みモデルプロバイダーです。[利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=text-embedding` を指定した際の `provider` フィールドの値を使用します。" }, "indexing_technique": { "anyOf": [ @@ -18199,7 +18237,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ナレッジベースに最初のドキュメントを追加する際に必須です。以降のドキュメントでは省略するとナレッジベースのインデックス方式を継承します。`high_quality` は埋め込みモデルによる精密検索、`economy` はキーワードベースのインデックスを使用します。" }, "name": { "description": "ドキュメント名です。", @@ -18214,7 +18253,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "バージョン管理用の元ドキュメント ID です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents) から取得します。" }, "process_rule": { "anyOf": [ @@ -18507,7 +18547,8 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "`allowed_file_types` に `custom` が含まれる場合に許可されるファイル拡張子。各拡張子には先頭の `.` を含めてください。たとえば `.md` です。`file` および `file-list` 入力に含まれます。" }, "allowed_file_types": { "items": { @@ -18536,7 +18577,8 @@ "type": { "const": "file-list", "default": "file-list", - "type": "string" + "type": "string", + "description": "フォーム入力コントロールの種類。利用可能な値: `paragraph` (複数行テキスト入力)、 `select` (リストからの単一選択)、 `file` (単一ファイルアップロード)、 `file-list` (複数ファイルアップロード)。" } }, "required": [ @@ -18900,10 +18942,11 @@ { "properties": { "score_threshold": { - "type": "number" + "type": "number", + "description": "結果をフィルタリングするための最小類似度スコアのしきい値です。" }, "score_threshold_enabled": { - "description": "スコア閾値フィルタリングが有効かどうかです。", + "description": "スコアしきい値によるフィルタリングを有効にするかどうか。", "type": "boolean" }, "top_k": { @@ -19320,7 +19363,8 @@ "HumanInputFormSubmitPayloadWithUser": { "properties": { "action": { - "type": "string" + "type": "string", + "description": "受信者が選択したアクションボタンの ID。フォームの `user_actions` リスト([人間の入力フォームを取得](/ja/api-reference/human-input/get-human-input-form) エンドポイントから返される)にある `id` のいずれかと一致する必要があります。" }, "inputs": { "additionalProperties": { @@ -19348,11 +19392,12 @@ "decision": "approve" } ], - "type": "object" + "type": "object", + "description": "各入力の `output_variable_name` をキーとして送信する値。段落と選択の入力は文字列、`file` 入力は単一のファイルマッピング、`file-list` 入力はファイルマッピングの配列です。\n\nファイルマッピングは `{transfer_method: local_file, upload_file_id, type}` または `{transfer_method: remote_url, url, type}` で、`type` はそのフィールドの `allowed_file_types` のいずれかです。`local_file` の場合、`upload_file_id` は [ファイルをアップロード](/ja/api-reference/files/upload-file) が返す `id` です。\n\n実行、アップロード、送信の各呼び出しで一貫した `user` を使用してください。" }, "user": { "type": "string", - "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。サービス API と Web アプリのユーザー ID は、たとえ同じでも別物として扱われます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" } }, "required": [ @@ -19520,7 +19565,7 @@ }, "user": { "type": "string", - "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。フィードバックはそのエンドユーザーにスコープされるため、メッセージを受け取った `user` と一致する必要があります。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" } }, "required": [ @@ -19849,7 +19894,7 @@ "MetadataArgs": { "properties": { "name": { - "description": "メタデータフィールド名です。", + "description": "メタデータフィールドの名前です。ナレッジベースのフィールド内で一意であり、255 文字以内である必要があります。", "type": "string" }, "type": { @@ -19872,7 +19917,8 @@ "properties": { "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "メタデータフィールド ID です。[メタデータフィールドリストを取得](/ja/api-reference/metadata/list-metadata-fields) を参照してください。" }, "name": { "description": "メタデータフィールド名です。", @@ -19946,7 +19992,8 @@ "items": { "$ref": "#/components/schemas/DocumentMetadataOperation" }, - "type": "array" + "type": "array", + "description": "ドキュメントメタデータの更新操作です。ドキュメントごとに 1 エントリです。" } }, "required": [ @@ -19957,7 +20004,8 @@ "MetadataUpdatePayload": { "properties": { "name": { - "type": "string" + "type": "string", + "description": "フィールドの新しい名前です。ナレッジベースのフィールド内で一意であり、255 文字以内である必要があります。" } }, "required": [ @@ -20022,7 +20070,7 @@ "properties": { "user": { "type": "string", - "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" } }, "type": "object" @@ -20048,7 +20096,8 @@ "type": { "const": "paragraph", "default": "paragraph", - "type": "string" + "type": "string", + "description": "フォーム入力コントロールの種類。使用可能な値:`paragraph`(複数行テキスト)、`select`(リストからの単一選択)、`file`(単一ファイルのアップロード)、`file-list`(複数ファイルのアップロード)。" } }, "required": [ @@ -21427,10 +21476,12 @@ { "properties": { "name": { - "type": "string" + "type": "string", + "description": "ドキュメントのタイトルです。デフォルトは `\"untitled\"` です。" }, "reference": { - "type": "string" + "type": "string", + "description": "[パイプラインファイルアップロード](/ja/api-reference/knowledge-pipeline/upload-pipeline-file) エンドポイントから返される `id` を使用してください。`related_id` もエイリアスとして使用可能です。" } }, "required": [ @@ -21442,7 +21493,8 @@ { "properties": { "credential_id": { - "type": "string" + "type": "string", + "description": "外部プラットフォームとの認証用クレデンシャルです。Dify コンソールで管理します。省略した場合、プロバイダーのデフォルトクレデンシャルが使用されます。" }, "page": { "description": "ページの詳細です。", @@ -21452,10 +21504,12 @@ "type": "string" }, "page_name": { - "type": "string" + "type": "string", + "description": "表示名です。デフォルトは `\"untitled\"` です。" }, "type": { - "type": "string" + "type": "string", + "description": "データソースプラグインで定義されたページタイプ(例:`\"page\"`、`\"database\"`)。" } }, "required": [ @@ -21465,7 +21519,8 @@ "type": "object" }, "workspace_id": { - "type": "string" + "type": "string", + "description": "外部プラットフォームのワークスペースまたはデータベース ID(例:Notion のワークスペース ID)。" } }, "required": [ @@ -21478,7 +21533,8 @@ { "properties": { "title": { - "type": "string" + "type": "string", + "description": "ドキュメント名として使用されます。デフォルトは `\"untitled\"` です。" }, "url": { "description": "クロール対象の URL です。", @@ -21494,14 +21550,16 @@ { "properties": { "bucket": { - "type": "string" + "type": "string", + "description": "ストレージバケット名です。一部のドライブプロバイダー(S3 互換ストレージなど)で必要です。プロバイダーがバケットを使用しない場合は省略できます。" }, "id": { "description": "ファイルまたはフォルダの ID です。", "type": "string" }, "name": { - "type": "string" + "type": "string", + "description": "ファイル名です。デフォルトは `\"untitled\"` です。" }, "type": { "description": "この項目が単一ファイルか、展開対象のフォルダかを指定します。", @@ -21539,17 +21597,20 @@ "type": "object" }, "is_published": { - "type": "boolean" + "type": "boolean", + "description": "現在のドラフトではなくパイプラインの公開バージョンを実行するかどうかを指定します。未公開の変更をテストするにはドラフトを実行します。" }, "response_mode": { "enum": [ "blocking", "streaming" ], - "type": "string" + "type": "string", + "description": "パイプライン実行のレスポンスモードです。`streaming` は Server-Sent Events ストリームを返し、`blocking` は完了まで待機して完全な結果を返します。" }, "start_node_id": { - "type": "string" + "type": "string", + "description": "実行を開始するノードの ID です。[データソースプラグインリストを取得](/ja/api-reference/knowledge-pipeline/list-datasource-plugins) から取得します。" } }, "required": [ @@ -21876,7 +21937,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "リランクモデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/cohere/cohere`)。`cohere` のような短縮名は `langgenius//` に展開され、langgenius が公開したプラグインでのみ機能します。\n\n有効な値は [利用可能なモデルを取得](/ja/api-reference/models/get-available-models) で `model_type=rerank` を指定した際の `provider` フィールドから取得します。" } }, "type": "object" @@ -22013,7 +22075,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "回答テキストです。Q&A モード(`qa_model`)のドキュメントでは必須です。" }, "attachment_ids": { "anyOf": [ @@ -22428,7 +22491,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "Q&A モード(`qa_model`)のドキュメントの回答テキストです。" }, "attachment_ids": { "anyOf": [ @@ -22454,7 +22518,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "チャンクのテキスト内容です。" }, "enabled": { "anyOf": [ @@ -22480,11 +22545,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "チャンクのキーワードです。" }, "regenerate_child_chunks": { "default": false, - "type": "boolean" + "type": "boolean", + "description": "子チャンクを再生成するかどうかです。" }, "summary": { "anyOf": [ @@ -22966,10 +23033,12 @@ "type": "string" }, "minItems": 1, - "type": "array" + "type": "array", + "description": "バインドするタグの ID です。[ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) を参照してください。 不明なタグ ID はエラーにならず無視されます。" }, "target_id": { - "type": "string" + "type": "string", + "description": "タグをバインドするナレッジベースです。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) を参照してください。" } }, "required": [ @@ -22981,7 +23050,7 @@ "TagCreatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "タグ名です。ワークスペース内で一意である必要があります。", "maxLength": 50, "minLength": 1, "type": "string" @@ -22995,7 +23064,8 @@ "TagDeletePayload": { "properties": { "tag_id": { - "type": "string" + "type": "string", + "description": "削除するタグの ID です。[ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) を参照してください。" } }, "required": [ @@ -23009,17 +23079,20 @@ "properties": { "tag_id": { "deprecated": true, - "type": "string" + "type": "string", + "description": "旧版の単一タグ用フィールドです。サーバーサイドで `tag_ids` に正規化されます。新規連携では `tag_ids` を使用してください。" }, "tag_ids": { "items": { "type": "string" }, "minItems": 1, - "type": "array" + "type": "array", + "description": "バインド解除するタグ ID のリストです。旧版の `tag_id` を指定しない限り必須です。[ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) を参照してください。" }, "target_id": { - "type": "string" + "type": "string", + "description": "タグのバインドを解除するナレッジベースです。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases) を参照してください。" } }, "required": [ @@ -23063,13 +23136,14 @@ "TagUpdatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "タグの新しい名前です。ワークスペース内で一意である必要があります。", "maxLength": 50, "minLength": 1, "type": "string" }, "tag_id": { - "type": "string" + "type": "string", + "description": "名前を変更するタグの ID です。[ナレッジベースタグリストを取得](/ja/api-reference/tags/list-knowledge-tags) を参照してください。" } }, "required": [ @@ -23140,7 +23214,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "回答を音声化するメッセージの ID です。両方が指定された場合、`text` よりも優先されます。メッセージ ID は [会話履歴メッセージ一覧を取得](/ja/api-reference/conversations/list-conversation-messages) から取得します。" }, "streaming": { "anyOf": [ @@ -23151,7 +23226,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "後方互換性のために受け付けられますが、効果はありません。音声がストリーミングされるかどうかは、設定された TTS プロバイダーの出力によって決まり、このフィールドでは制御されません。" }, "text": { "anyOf": [ @@ -23162,11 +23238,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "音声に合成するテキストです。" }, "user": { "type": "string", - "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" }, "voice": { "anyOf": [ @@ -23177,7 +23254,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "テキスト読み上げに使用する音声。利用可能な音声は、このアプリに設定された TTS プロバイダーによって異なります。デフォルトには[アプリケーションのパラメータ情報を取得](/ja/api-reference/applications/get-app-parameters) → `text_to_speech.voice` の `voice` 値を使用してください。" } }, "type": "object", @@ -23230,7 +23308,8 @@ "id", "title" ], - "type": "object" + "type": "object", + "description": "人間の入力フォーム上のアクションボタンです。" }, "ValueSourceType": { "enum": [ @@ -23308,7 +23387,8 @@ "type": "string" }, "vector_weight": { - "type": "number" + "type": "number", + "description": "セマンティック(ベクトル)検索結果に割り当てられた重みです。" } }, "required": [ @@ -24435,11 +24515,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ファイルリストです。ファイルとテキストを組み合わせて入力する場合に適しており、モデルが Vision 機能をサポートしている場合にのみ使用できます。ローカルファイルを添付するには、まず [ファイルをアップロード](/ja/api-reference/files/upload-file) でアップロードし、返された `id` を `upload_file_id` として `transfer_method: local_file` で使用します。" }, "inputs": { "additionalProperties": true, - "type": "object" + "type": "object", + "description": "ワークフロー入力変数のキーと値のペアです。アプリが期待する変数名と型は、[アプリケーションのパラメータ情報を取得](/ja/api-reference/applications/get-app-parameters) の `user_input_form` フィールドで確認できます。\n\nファイル型の変数には、`type`、`transfer_method`、および `url` または `upload_file_id` を持つファイルオブジェクトの配列を渡します。" }, "response_mode": { "anyOf": [ @@ -24454,11 +24536,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "レスポンスモードです。同期レスポンスには `blocking`(Cloudflare タイムアウトは `100 s`)、サーバー送信イベントには `streaming` を使用します。省略した場合、デフォルトはブロッキング動作になります。" }, "user": { "type": "string", - "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。" + "description": "エンドユーザーの識別子。アプリ側で定義し、アプリ内で一意にします。データアクセスをスコープします。ワークフロー実行とそのファイルは、同じ `user` を持つ後続のリクエストにのみ表示されます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" } }, "required": [ @@ -24554,7 +24637,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "ワークフロー実行の入力変数です。生の JSON 文字列として返されるため(例:`{\"query\": \"...\"}`)、クライアント側でパースする必要があります。`null` の場合もあります。" }, "outputs": { "additionalProperties": true, diff --git a/zh/api-reference/openapi_service.json b/zh/api-reference/openapi_service.json index 31557969e6..09c1d2b72a 100644 --- a/zh/api-reference/openapi_service.json +++ b/zh/api-reference/openapi_service.json @@ -462,7 +462,7 @@ "/chat-messages/{task_id}/stop": { "post": { "summary": "停止响应", - "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n停止聊天消息生成任务。仅在 `streaming` 模式下支持。\n\n对于聊天助手、Agent 和新 Agent,`user` 必须与启动任务时使用的标识一致。不一致时,任务会继续运行,但接口仍返回成功。", + "description": "**适用于**:Chatflow、新 Agent、聊天助手、Agent。\n\n停止聊天消息生成任务。仅在 `streaming` 模式下支持。", "operationId": "stop_chat_message", "tags": [ "对话消息" @@ -513,7 +513,7 @@ } } }, - "description": "请求成功。" + "description": "操作成功。" }, "400": { "description": "- `not_chat_app` : 应用模式与 API 路由不匹配。\n- `invalid_param` : 缺少必填的 `user` 字段。", @@ -1125,7 +1125,7 @@ } } }, - "description": "请求成功。" + "description": "操作成功。" }, "400": { "description": "`invalid_param` : 缺少必填的 `user` 字段,或 `rating` 为 `null` 但没有可撤销的已有反馈。", @@ -2154,11 +2154,12 @@ "properties": { "file": { "format": "binary", - "type": "string" + "type": "string", + "description": "要转写的音频文件。接受的 MIME 类型:`audio/mp3`、`audio/m4a`(也接受 `audio/x-m4a`)、`audio/wav`、`audio/amr`、`audio/mpga`。其他类型(包括常见的 `audio/mpeg`)会返回 `unsupported_audio_type` 错误。最大 `30 MB`。" }, "user": { "type": "string", - "description": "由你的应用定义且在应用内唯一的终端用户标识。" + "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" } }, "required": [ @@ -4054,7 +4055,7 @@ } }, "404": { - "description": "`not_found` : 未找到工作流运行记录。", + "description": "`not_found` : Workflow run not found.", "content": { "application/json": { "examples": { @@ -4651,7 +4652,7 @@ } } }, - "description": "请求成功。" + "description": "操作成功。" }, "400": { "description": "- `not_workflow_app` : 应用模式与 API 路由不匹配。\n- `invalid_param` : 请求参数缺失或无效,例如缺少 `user`。", @@ -4938,7 +4939,7 @@ "/completion-messages/{task_id}/stop": { "post": { "summary": "停止响应", - "description": "**适用于**:文本生成应用。\n\n停止文本生成消息生成任务。仅在 `streaming` 模式下支持。\n\n`user` 必须与启动该任务时使用的标识一致。不一致时,任务会继续运行,但接口仍返回成功。", + "description": "**适用于**:文本生成应用。\n\n停止文本生成消息生成任务。仅在 `streaming` 模式下支持。", "operationId": "stop_completion", "tags": [ "文本生成消息" @@ -4989,7 +4990,7 @@ } } }, - "description": "请求成功。" + "description": "操作成功。" }, "400": { "description": "- `app_unavailable` : 应用不可用或配置错误。\n- `invalid_param` : 缺少必填的 `user` 字段。", @@ -6637,7 +6638,7 @@ "文档" ], "summary": "更新文档", - "description": "更新并重新索引基于文件的文档。必须提供替换文件 `file`,或提供包含 `process_rule` 的 `data`;也可以同时提供 `file` 和 `data` 以更改处理设置。使用返回的 `batch` ID 通过 [获取文档嵌入状态(进度)](/zh/api-reference/documents/get-document-indexing-status) 跟踪进度。", + "description": "通过上传新文件更新文档,然后重新索引。这是基于文件更新文档的规范端点。使用返回的 `batch` ID 通过 [获取文档嵌入状态(进度)](/zh/api-reference/documents/get-document-indexing-status) 跟踪进度。", "operationId": "update_document_by_file", "parameters": [ { @@ -7358,7 +7359,7 @@ "文档" ], "summary": "用文件更新文档", - "description": "已弃用。改用 [更新文档](/zh/api-reference/documents/update-document)。必须提供替换文件 `file`,或提供包含 `process_rule` 的 `data`;也可以同时提供 `file` 和 `data` 以更改处理设置。更新后会重新索引文档。", + "description": "已弃用。改用 [更新文档](/zh/api-reference/documents/update-document)。通过上传新文件更新文档,然后重新索引。", "operationId": "update_document_by_file_deprecated", "parameters": [ { @@ -13114,10 +13115,12 @@ "AnnotationReplyActionPayload": { "properties": { "embedding_model_name": { - "type": "string" + "type": "string", + "description": "用于将标注向量化以进行匹配的嵌入模型(例如 `text-embedding-3-small`)。" }, "embedding_provider_name": { - "type": "string" + "type": "string", + "description": "嵌入模型供应商(例如 `openai`)。可用供应商从 [获取可用模型](/zh/api-reference/models/get-available-models) 获取。" }, "score_threshold": { "description": "标注被视为匹配的最低相似度分数。值越高,要求匹配越精确。", @@ -14235,7 +14238,8 @@ "properties": { "auto_generate_name": { "default": true, - "type": "boolean" + "type": "boolean", + "description": "自动生成会话标题。如果为 `false`,请使用 [重命名会话](/zh/api-reference/conversations/rename-conversation) API 并设置 `auto_generate: true` 来异步生成标题。" }, "conversation_id": { "anyOf": [ @@ -14246,7 +14250,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "要继续的会话 ID。省略此字段或传入空字符串可开始新会话;响应会返回一个 `conversation_id`,在下一条消息中带上它即可。要恢复较早的会话,可从 [获取会话列表](/zh/api-reference/conversations/list-conversations) 获取其 ID。" }, "files": { "anyOf": [ @@ -14263,7 +14268,8 @@ "enum": [ "remote_url" ], - "type": "string" + "type": "string", + "description": "传输方式:文件 URL 使用 `remote_url`,上传文件使用 `local_file`。" }, "type": { "description": "文件类型。", @@ -14277,11 +14283,13 @@ "type": "string" }, "upload_file_id": { - "type": "string" + "type": "string", + "description": "通过 [上传文件](/zh/api-reference/files/upload-file) API 获取的已上传文件 ID(当 `transfer_method` 为 `local_file` 时必填)。" }, "url": { "format": "url", - "type": "string" + "type": "string", + "description": "文件 URL(当 `transfer_method` 为 `remote_url` 时必填)。" } }, "required": [ @@ -14414,14 +14422,17 @@ "type": "null" } ], - "default": null + "default": null, + "description": "要附加到消息的文件。本地文件需先通过 [上传文件](/zh/api-reference/files/upload-file) 上传,再将返回的 `id` 作为 `upload_file_id` 引用,并设置 `transfer_method: local_file`。新 Agent 应用接受文件引用,但不会处理其内容。" }, "inputs": { "additionalProperties": true, - "type": "object" + "type": "object", + "description": "应用输入变量的值,以变量名为键。变量名称和类型可从 [获取应用参数](/zh/api-reference/applications/get-app-parameters) 响应中的 `user_input_form` 字段获取。" }, "query": { - "type": "string" + "type": "string", + "description": "用户发送的消息。" }, "response_mode": { "anyOf": [ @@ -14436,11 +14447,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "响应返回模式。省略时默认为阻塞模式。\n\n- `streaming`(推荐):回复以 Server-Sent Events 形式返回。\n- `blocking`:生成完成后一次性返回。生成时间较长时有中断风险:在 Dify Cloud 上,如果边缘代理在超时时间内未收到响应,就可能中断连接。\n- Agent 和新 Agent 应用仅支持 `streaming`;使用 `blocking` 会返回 400。" }, "user": { "type": "string", - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value." + "description": "终端用户标识,由你的应用定义,需在应用内唯一。会话、消息和文件仅对携带相同 `user` 的请求可见。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" }, "workflow_id": { "anyOf": [ @@ -14451,7 +14463,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "仅适用于 Chatflow 应用。 指定要执行的已发布工作流版本 ID。如果未提供,将使用最新发布的版本。在 Dify Cloud 上,指定版本需要付费套餐。" } }, "required": [ @@ -15024,15 +15037,18 @@ "type": "null" } ], - "default": null + "default": null, + "description": "要附加到请求的文件。本地文件需先通过 [上传文件](/zh/api-reference/files/upload-file) 上传,再将返回的 `id` 作为 `upload_file_id` 引用,并设置 `transfer_method: local_file`。" }, "inputs": { "additionalProperties": true, - "type": "object" + "type": "object", + "description": "应用输入变量的值,以变量名为键。变量名称和类型可从 [获取应用参数](/zh/api-reference/applications/get-app-parameters) 响应中的 `user_input_form` 字段获取。" }, "query": { "default": "", - "type": "string" + "type": "string", + "description": "要处理的文本。旧版字段;较新的应用改为在 `inputs` 中传递。" }, "response_mode": { "anyOf": [ @@ -15047,11 +15063,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "响应返回模式。`streaming`(推荐)使用 SSE。`blocking` 等待完成后返回(长时间处理可能会被中断)。Cloudflare 超时为 `100 s`。省略时默认为阻塞模式。" }, "user": { "type": "string", - "description": "由你的应用定义且在应用内唯一的终端用户标识。" + "description": "终端用户标识,由你的应用定义,需在应用内唯一。消息和文件仅对携带相同 `user` 的请求可见。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" } }, "required": [ @@ -15083,7 +15100,8 @@ "≤", "≥" ], - "type": "string" + "type": "string", + "description": "按元数据类型选择要应用的比较方式:\n\n- 字符串或数组类型元数据:`contains`、`not contains`、`start with`、`end with`、`is`、`is not`、`empty`、`not empty`、`in`、`not in`\n- 数值类型元数据:`=`、`≠`、`>`、`<`、`≥`、`≤`\n- 时间类型元数据:`before`、`after`" }, "name": { "description": "用于比较的元数据字段名称。", @@ -15107,7 +15125,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "用于比较的值。类型取决于 `comparison_operator`:大多数字符串运算符使用字符串;`in` 和 `not in` 使用字符串数组;数值运算符使用数字;`empty` 和 `not empty` 时省略。" } }, "required": [ @@ -15263,11 +15282,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "新的会话名称。除非 `auto_generate` 为 `true`,否则必填。" }, "user": { "type": "string", - "description": "由你的应用定义且在应用内唯一的终端用户标识。" + "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" } }, "required": [ @@ -15438,7 +15458,7 @@ "properties": { "user": { "type": "string", - "description": "由你的应用定义且在应用内唯一的终端用户标识。" + "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" }, "value": { "description": "变量的新值。必须与变量的预期类型匹配。" @@ -15548,7 +15568,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "嵌入模型名称。使用 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `model` 字段值。" }, "embedding_model_provider": { "anyOf": [ @@ -15559,7 +15580,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。`openai` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `provider` 字段获取。" }, "external_knowledge_api_id": { "anyOf": [ @@ -15570,7 +15592,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部知识库 API 连接的 ID。" }, "external_knowledge_id": { "anyOf": [ @@ -15615,7 +15638,8 @@ "type": "null" } ], - "default": "only_me" + "default": "only_me", + "description": "控制谁可以访问此知识库。`only_me` 仅限创建者,`all_team_members` 授权整个工作区访问,`partial_members` 授权指定成员访问。" }, "provider": { "default": "vendor", @@ -15623,7 +15647,8 @@ "external", "vendor" ], - "type": "string" + "type": "string", + "description": "`vendor` 为内部知识库,`external` 为外部知识库。" }, "retrieval_model": { "anyOf": [ @@ -16827,7 +16852,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "嵌入模型名称。使用 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `model` 字段值。" }, "embedding_model_provider": { "anyOf": [ @@ -16838,7 +16864,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "嵌入模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。`openai` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `provider` 字段获取。" }, "external_knowledge_api_id": { "anyOf": [ @@ -16849,7 +16876,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "外部知识库 API 连接的 ID。" }, "external_knowledge_id": { "anyOf": [ @@ -16868,7 +16896,8 @@ { "properties": { "score_threshold": { - "type": "number" + "type": "number", + "description": "用于过滤结果的最低相关性分数阈值。" }, "score_threshold_enabled": { "description": "是否启用分数阈值过滤。", @@ -16948,7 +16977,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "控制谁可以访问此知识库。`only_me` 仅限创建者,`all_team_members` 授权整个工作区访问,`partial_members` 授权指定成员访问。" }, "retrieval_model": { "anyOf": [ @@ -17092,7 +17122,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "用于向数据源认证的凭证 ID,来自 [获取数据源插件列表](/zh/api-reference/knowledge-pipeline/list-datasource-plugins) 的 `credentials` 数组。" }, "datasource_type": { "description": "数据源类型。", @@ -17110,7 +17141,8 @@ "type": "object" }, "is_published": { - "type": "boolean" + "type": "boolean", + "description": "是否运行节点的已发布版本,而非草稿版本。" } }, "required": [ @@ -17240,7 +17272,8 @@ }, "maxItems": 100, "minItems": 1, - "type": "array" + "type": "array", + "description": "要包含在压缩包中的文档 ID。从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" } }, "required": [ @@ -17619,13 +17652,15 @@ "properties": { "document_id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "要更新的文档 ID。参见 [获取知识库的文档列表](/zh/api-reference/documents/list-documents)。" }, "metadata_list": { "items": { "$ref": "#/components/schemas/MetadataDetail" }, - "type": "array" + "type": "array", + "description": "要设置到文档的元数据字段。" }, "partial_update": { "default": false, @@ -17972,7 +18007,8 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "要更新的文档 ID。文档 ID 从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" } }, "type": "object" @@ -18173,7 +18209,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "嵌入模型名称。使用 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `model` 字段值。" }, "embedding_model_provider": { "anyOf": [ @@ -18184,7 +18221,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "嵌入模型供应商。使用 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=text-embedding` 返回的 `provider` 字段值。" }, "indexing_technique": { "anyOf": [ @@ -18199,7 +18237,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "向知识库添加首个文档时必填。后续文档如果省略此字段,将继承知识库的索引方式。`high_quality` 使用嵌入模型进行精确搜索;`economy` 使用基于关键词的索引。" }, "name": { "description": "文档名称。", @@ -18214,7 +18253,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "用于版本控制的原始文档 ID。从 [获取知识库的文档列表](/zh/api-reference/documents/list-documents) 获取。" }, "process_rule": { "anyOf": [ @@ -18507,7 +18547,8 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "当 `allowed_file_types` 包含 `custom` 时允许的文件扩展名。每个扩展名都需要包含前导 `.`,例如 `.md`。`file` 和 `file-list` 输入会包含此字段。" }, "allowed_file_types": { "items": { @@ -18536,7 +18577,8 @@ "type": { "const": "file-list", "default": "file-list", - "type": "string" + "type": "string", + "description": "表单输入控件类型。可用值:`paragraph`(多行文本输入)、`select`(从列表中单选)、`file`(单个文件上传)和 `file-list`(多个文件上传)。" } }, "required": [ @@ -18900,14 +18942,15 @@ { "properties": { "score_threshold": { - "type": "number" + "type": "number", + "description": "用于过滤结果的最小相似度分数阈值。" }, "score_threshold_enabled": { "description": "是否启用分数阈值过滤。", "type": "boolean" }, "top_k": { - "description": "返回的最大结果数。", + "description": "返回结果的最大数量。", "type": "integer" } }, @@ -19320,7 +19363,8 @@ "HumanInputFormSubmitPayloadWithUser": { "properties": { "action": { - "type": "string" + "type": "string", + "description": "接收人选择的操作按钮 ID。必须与表单的 `user_actions` 列表(由 [获取人工介入表单](/zh/api-reference/human-input/get-human-input-form) 接口返回)中的某个 `id` 值匹配。" }, "inputs": { "additionalProperties": { @@ -19348,11 +19392,12 @@ "decision": "approve" } ], - "type": "object" + "type": "object", + "description": "按各输入的 `output_variable_name` 作为键提交的值。段落和下拉选项输入为字符串;`file` 输入为单个文件映射;`file-list` 输入为文件映射数组。\n\n文件映射为 `{transfer_method: local_file, upload_file_id, type}` 或 `{transfer_method: remote_url, url, type}`,其中 `type` 为该字段 `allowed_file_types` 中的一种。对于 `local_file`,`upload_file_id` 为 [上传文件](/zh/api-reference/files/upload-file) 返回的 `id`。\n\n在执行、上传和提交各次调用中使用一致的 `user`。" }, "user": { "type": "string", - "description": "由你的应用定义且在应用内唯一的终端用户标识。" + "description": "终端用户标识,由你的应用定义,需在应用内唯一。Service API 与 Web 应用的用户 ID 相互独立,即使取值相同也不指向同一用户。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" } }, "required": [ @@ -19520,7 +19565,7 @@ }, "user": { "type": "string", - "description": "由你的应用定义且在应用内唯一的终端用户标识。" + "description": "终端用户标识,由你的应用定义,需在应用内唯一。反馈按终端用户隔离,必须与收到该消息的 `user` 一致。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" } }, "required": [ @@ -19849,7 +19894,7 @@ "MetadataArgs": { "properties": { "name": { - "description": "元数据字段名称。", + "description": "元数据字段的名称。在知识库的字段中必须唯一,且不超过 255 个字符。", "type": "string" }, "type": { @@ -19872,7 +19917,8 @@ "properties": { "id": { "format": "uuid", - "type": "string" + "type": "string", + "description": "元数据字段 ID。参见 [获取元数据字段列表](/zh/api-reference/metadata/list-metadata-fields)。" }, "name": { "description": "元数据字段名称。", @@ -19946,7 +19992,8 @@ "items": { "$ref": "#/components/schemas/DocumentMetadataOperation" }, - "type": "array" + "type": "array", + "description": "文档元数据更新操作,每个文档一个条目。" } }, "required": [ @@ -19957,7 +20004,8 @@ "MetadataUpdatePayload": { "properties": { "name": { - "type": "string" + "type": "string", + "description": "字段的新名称。在知识库的字段中必须唯一,且不超过 255 个字符。" } }, "required": [ @@ -20022,7 +20070,7 @@ "properties": { "user": { "type": "string", - "description": "由你的应用定义且在应用内唯一的终端用户标识。" + "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" } }, "type": "object" @@ -20048,7 +20096,8 @@ "type": { "const": "paragraph", "default": "paragraph", - "type": "string" + "type": "string", + "description": "表单输入控件类型。可用值:`paragraph`(多行文本输入)、`select`(从列表中单选)、`file`(单文件上传)和 `file-list`(多文件上传)。" } }, "required": [ @@ -21427,10 +21476,12 @@ { "properties": { "name": { - "type": "string" + "type": "string", + "description": "文档标题。默认为 `\"untitled\"`。" }, "reference": { - "type": "string" + "type": "string", + "description": "使用 [上传流水线文件](/zh/api-reference/knowledge-pipeline/upload-pipeline-file) 端点返回的 `id`。`related_id` 可作为别名使用。" } }, "required": [ @@ -21442,7 +21493,8 @@ { "properties": { "credential_id": { - "type": "string" + "type": "string", + "description": "用于与外部平台认证的凭证。通过 Dify 控制台管理。如省略,则使用该供应商的默认凭证。" }, "page": { "description": "页面详情。", @@ -21452,10 +21504,12 @@ "type": "string" }, "page_name": { - "type": "string" + "type": "string", + "description": "显示名称。默认为 `\"untitled\"`。" }, "type": { - "type": "string" + "type": "string", + "description": "由数据源插件定义的页面类型(例如 `\"page\"`、`\"database\"`)。" } }, "required": [ @@ -21465,7 +21519,8 @@ "type": "object" }, "workspace_id": { - "type": "string" + "type": "string", + "description": "外部平台中的工作空间或数据库 ID(例如 Notion 工作空间 ID)。" } }, "required": [ @@ -21478,7 +21533,8 @@ { "properties": { "title": { - "type": "string" + "type": "string", + "description": "用作文档名称。默认为 `\"untitled\"`。" }, "url": { "description": "待爬取的 URL。", @@ -21494,14 +21550,16 @@ { "properties": { "bucket": { - "type": "string" + "type": "string", + "description": "存储桶名称。部分存储供应商需要此字段(例如 S3 兼容存储);如果供应商不使用存储桶,可省略。" }, "id": { "description": "文件或文件夹 ID。", "type": "string" }, "name": { - "type": "string" + "type": "string", + "description": "文件名称。默认为 `\"untitled\"`。" }, "type": { "description": "该条目是单个文件还是待展开的文件夹。", @@ -21539,17 +21597,20 @@ "type": "object" }, "is_published": { - "type": "boolean" + "type": "boolean", + "description": "是否运行流水线的已发布版本,而非当前草稿。运行草稿可测试未发布的更改。" }, "response_mode": { "enum": [ "blocking", "streaming" ], - "type": "string" + "type": "string", + "description": "流水线执行的响应模式。`streaming` 返回服务器发送事件流,`blocking` 等待并返回完整结果。" }, "start_node_id": { - "type": "string" + "type": "string", + "description": "开始执行的节点 ID,来自 [获取数据源插件列表](/zh/api-reference/knowledge-pipeline/list-datasource-plugins)。" } }, "required": [ @@ -21876,7 +21937,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "重排序模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/cohere/cohere`)。`cohere` 这类简写会展开为 `langgenius//`,仅对 langgenius 发布的插件有效。\n\n有效取值从 [获取可用模型](/zh/api-reference/models/get-available-models) 中 `model_type=rerank` 返回的 `provider` 字段获取。" } }, "type": "object" @@ -22013,7 +22075,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "答案文本。问答模式(`qa_model`)文档必填。" }, "attachment_ids": { "anyOf": [ @@ -22428,7 +22491,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "问答模式(`qa_model`)文档的答案文本。" }, "attachment_ids": { "anyOf": [ @@ -22454,7 +22518,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "分段文本内容。" }, "enabled": { "anyOf": [ @@ -22480,11 +22545,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "分段的关键词。" }, "regenerate_child_chunks": { "default": false, - "type": "boolean" + "type": "boolean", + "description": "是否重新生成子分段。" }, "summary": { "anyOf": [ @@ -22966,10 +23033,12 @@ "type": "string" }, "minItems": 1, - "type": "array" + "type": "array", + "description": "要绑定的标签 ID。参见 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags)。 未知的标签 ID 会被忽略,不会报错。" }, "target_id": { - "type": "string" + "type": "string", + "description": "要绑定标签的知识库。参见 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases)。" } }, "required": [ @@ -22981,7 +23050,7 @@ "TagCreatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "标签名称。在工作空间内必须唯一。", "maxLength": 50, "minLength": 1, "type": "string" @@ -22995,7 +23064,8 @@ "TagDeletePayload": { "properties": { "tag_id": { - "type": "string" + "type": "string", + "description": "要删除的标签 ID。参见 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags)。" } }, "required": [ @@ -23009,17 +23079,20 @@ "properties": { "tag_id": { "deprecated": true, - "type": "string" + "type": "string", + "description": "旧版单标签字段。服务端将其归一化为 `tag_ids`。新接入应使用 `tag_ids`。" }, "tag_ids": { "items": { "type": "string" }, "minItems": 1, - "type": "array" + "type": "array", + "description": "要解绑的标签 ID 列表。未提供旧版 `tag_id` 时必填。参见 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags)。" }, "target_id": { - "type": "string" + "type": "string", + "description": "要解绑标签的知识库。参见 [获取知识库列表](/zh/api-reference/knowledge-bases/list-knowledge-bases)。" } }, "required": [ @@ -23063,13 +23136,14 @@ "TagUpdatePayload": { "properties": { "name": { - "description": "Tag name.", + "description": "标签的新名称。在工作空间内必须唯一。", "maxLength": 50, "minLength": 1, "type": "string" }, "tag_id": { - "type": "string" + "type": "string", + "description": "要重命名的标签 ID。参见 [获取知识库标签列表](/zh/api-reference/tags/list-knowledge-tags)。" } }, "required": [ @@ -23140,7 +23214,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "要转为语音的消息答案的 ID。同时提供 `text` 时,优先使用 `message_id`。消息 ID 从 [获取会话历史消息](/zh/api-reference/conversations/list-conversation-messages) 获取。" }, "streaming": { "anyOf": [ @@ -23151,7 +23226,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "为向后兼容而保留,但不产生任何效果。音频是否以流式返回由配置的 TTS 供应商的输出决定,而非此字段。" }, "text": { "anyOf": [ @@ -23162,11 +23238,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "要合成为语音的文本。" }, "user": { "type": "string", - "description": "由你的应用定义且在应用内唯一的终端用户标识。" + "description": "终端用户标识,由你的应用定义,需在应用内唯一。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" }, "voice": { "anyOf": [ @@ -23177,7 +23254,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文字转语音使用的声音。可用声音取决于为此应用配置的 TTS 提供商。使用[获取应用参数](/zh/api-reference/applications/get-app-parameters) → `text_to_speech.voice` 中的 `voice` 值作为默认值。" } }, "type": "object", @@ -23230,7 +23308,8 @@ "id", "title" ], - "type": "object" + "type": "object", + "description": "人工介入表单上的操作按钮。" }, "ValueSourceType": { "enum": [ @@ -23308,7 +23387,8 @@ "type": "string" }, "vector_weight": { - "type": "number" + "type": "number", + "description": "分配给语义(向量)搜索结果的权重。" } }, "required": [ @@ -24435,11 +24515,13 @@ "type": "null" } ], - "default": null + "default": null, + "description": "文件列表。适用于需要将文件与文本组合输入的场景,仅在模型支持 Vision 能力时可用。要附加本地文件,请先通过 [上传文件](/zh/api-reference/files/upload-file) 上传,然后将返回的 `id` 作为 `upload_file_id`,并设置 `transfer_method: local_file`。" }, "inputs": { "additionalProperties": true, - "type": "object" + "type": "object", + "description": "工作流输入变量的键值对。变量名称和类型可从 [获取应用参数](/zh/api-reference/applications/get-app-parameters) 响应中的 `user_input_form` 字段获取。\n\n文件类型变量的值为文件对象数组,包含 `type`、`transfer_method` 以及 `url` 或 `upload_file_id`。" }, "response_mode": { "anyOf": [ @@ -24454,11 +24536,12 @@ "type": "null" } ], - "default": null + "default": null, + "description": "响应模式。使用 `blocking` 获取同步响应(Cloudflare 超时时间为 `100 s`),使用 `streaming` 获取服务器发送事件。未指定时默认为阻塞模式。" }, "user": { "type": "string", - "description": "由你的应用定义且在应用内唯一的终端用户标识。" + "description": "终端用户标识,由你的应用定义,需在应用内唯一。用于限定数据访问范围:工作流运行及其文件仅对携带相同 `user` 的后续请求可见。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" } }, "required": [ @@ -24554,7 +24637,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "工作流运行的输入变量,以原始 JSON 字符串返回(例如 `{\"query\": \"...\"}`),客户端需自行解析;可能为 `null`。" }, "outputs": { "additionalProperties": true, From fa2fc6ea661e0789ab82c7de1973f1c35630f690 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 26 Aug 2026 10:25:29 +0800 Subject: [PATCH 09/10] fix: restore unambiguous service api descriptions --- en/api-reference/openapi_service.json | 98 +++++++++++++++--------- ja/api-reference/openapi_service.json | 105 +++++++++++++++++--------- zh/api-reference/openapi_service.json | 105 +++++++++++++++++--------- 3 files changed, 203 insertions(+), 105 deletions(-) diff --git a/en/api-reference/openapi_service.json b/en/api-reference/openapi_service.json index d1a1f6a114..e9deb8f54d 100644 --- a/en/api-reference/openapi_service.json +++ b/en/api-reference/openapi_service.json @@ -13107,7 +13107,8 @@ "description": "Input of tools in JSON format." }, "tool_labels": { - "$ref": "#/components/schemas/JSONValue" + "$ref": "#/components/schemas/JSONValue", + "description": "Labels for tools used." } }, "required": [ @@ -15047,7 +15048,8 @@ "description": "Unique message ID. Use this as the `message_id` parameter when calling feedback or suggested questions endpoints." }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "Metadata including usage and retriever resources." }, "mode": { "title": "Mode", @@ -16179,7 +16181,7 @@ } ], "default": null, - "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + "description": "Retrieval model configuration. Controls how chunks are searched and ranked when querying this knowledge base." }, "summary_index_setting": { "anyOf": [ @@ -16357,7 +16359,8 @@ "description": "Whether API access is enabled for this knowledge base." }, "external_knowledge_info": { - "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", + "description": "Connection details for external knowledge bases. Present when `provider` is `external`." }, "external_retrieval_model": { "anyOf": [ @@ -16371,7 +16374,8 @@ "description": "Retrieval settings for external knowledge bases. `null` for internal knowledge bases." }, "icon_info": { - "$ref": "#/components/schemas/DatasetIconInfoResponse" + "$ref": "#/components/schemas/DatasetIconInfoResponse", + "description": "Icon display configuration for the knowledge base." }, "id": { "title": "Id", @@ -16448,7 +16452,8 @@ "description": "Provider type. `vendor` for internally managed, `external` for external knowledge base connections." }, "retrieval_model_dict": { - "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + "$ref": "#/components/schemas/DatasetRetrievalModelResponse", + "description": "Retrieval configuration for the knowledge base." }, "runtime_mode": { "anyOf": [ @@ -16463,7 +16468,8 @@ "description": "Runtime processing mode." }, "summary_index_setting": { - "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse", + "description": "Summary index configuration." }, "tags": { "items": { @@ -16680,7 +16686,8 @@ "description": "Whether API access is enabled for this knowledge base." }, "external_knowledge_info": { - "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", + "description": "Connection details for external knowledge bases. Present when `provider` is `external`." }, "external_retrieval_model": { "anyOf": [ @@ -16694,7 +16701,8 @@ "description": "Retrieval settings for external knowledge bases. `null` for internal knowledge bases." }, "icon_info": { - "$ref": "#/components/schemas/DatasetIconInfoResponse" + "$ref": "#/components/schemas/DatasetIconInfoResponse", + "description": "Icon display configuration for the knowledge base." }, "id": { "title": "Id", @@ -16787,7 +16795,8 @@ "description": "Provider type. `vendor` for internally managed, `external` for external knowledge base connections." }, "retrieval_model_dict": { - "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + "$ref": "#/components/schemas/DatasetRetrievalModelResponse", + "description": "Retrieval configuration for the knowledge base." }, "runtime_mode": { "anyOf": [ @@ -16802,7 +16811,8 @@ "description": "Runtime processing mode." }, "summary_index_setting": { - "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse", + "description": "Summary index configuration." }, "tags": { "items": { @@ -17353,7 +17363,8 @@ "description": "Reranking mode. `reranking_model` for model-based reranking, `weighted_score` for score-based weighting. `null` if reranking is disabled." }, "reranking_model": { - "$ref": "#/components/schemas/DatasetRerankingModelResponse" + "$ref": "#/components/schemas/DatasetRerankingModelResponse", + "description": "Reranking model configuration." }, "score_threshold": { "anyOf": [ @@ -17660,7 +17671,7 @@ } ], "default": null, - "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + "description": "Retrieval model configuration. Controls how chunks are searched and ranked when querying this knowledge base." } }, "title": "DatasetUpdatePayload", @@ -17714,10 +17725,12 @@ "DatasetWeightedScoreResponse": { "properties": { "keyword_setting": { - "$ref": "#/components/schemas/DatasetKeywordSettingResponse" + "$ref": "#/components/schemas/DatasetKeywordSettingResponse", + "description": "Keyword search weight settings." }, "vector_setting": { - "$ref": "#/components/schemas/DatasetVectorSettingResponse" + "$ref": "#/components/schemas/DatasetVectorSettingResponse", + "description": "Semantic search weight settings." }, "weight_type": { "anyOf": [ @@ -19090,7 +19103,7 @@ } ], "default": null, - "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + "description": "Controls how chunks are searched and ranked when querying this knowledge base." }, "text": { "description": "Document text content.", @@ -19872,7 +19885,7 @@ } ], "default": null, - "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + "description": "Retrieval model configuration. Controls how chunks are searched and ranked when querying this knowledge base." } }, "required": [ @@ -19926,7 +19939,8 @@ "description": "Similarity score." }, "segment": { - "$ref": "#/components/schemas/HitTestingSegment" + "$ref": "#/components/schemas/HitTestingSegment", + "description": "Matched chunk from the knowledge base." }, "summary": { "anyOf": [ @@ -19965,7 +19979,8 @@ "HitTestingResponse": { "properties": { "query": { - "$ref": "#/components/schemas/HitTestingQuery" + "$ref": "#/components/schemas/HitTestingQuery", + "description": "The original query object." }, "records": { "items": { @@ -20049,7 +20064,8 @@ "description": "ID of the user who disabled the chunk. `null` if enabled." }, "document": { - "$ref": "#/components/schemas/HitTestingDocument" + "$ref": "#/components/schemas/HitTestingDocument", + "description": "Parent document information for the matched chunk." }, "document_id": { "title": "Document Id", @@ -21286,7 +21302,8 @@ "description": "Configuration for suggested questions after an answer." }, "system_parameters": { - "$ref": "#/components/schemas/SystemParameters" + "$ref": "#/components/schemas/SystemParameters", + "description": "System-level parameter limits." }, "text_to_speech": { "properties": { @@ -22692,7 +22709,7 @@ "$ref": "#/components/schemas/WorkflowBlockingResponse" } ], - "description": "JSON responses returned by published and draft knowledge pipeline runs.", + "description": "Complete pipeline execution result. Returned when `response_mode` is `blocking`.", "title": "PipelineRunJsonResponse" }, "PipelineUploadFileResponse": { @@ -22788,7 +22805,7 @@ "properties": { "mode": { "$ref": "#/components/schemas/ProcessRuleMode", - "description": "Processing mode. `automatic` uses built-in rules, `custom` allows manual configuration, and `hierarchical` enables parent-child chunk structure for `doc_form: hierarchical_model`." + "description": "`automatic` uses built-in rules, `custom` allows manual configuration, `hierarchical` enables parent-child chunk structure (use with `doc_form: hierarchical_model`)." }, "rules": { "anyOf": [ @@ -22845,7 +22862,8 @@ "description": "Supported features of the model, `null` if none." }, "fetch_from": { - "$ref": "#/components/schemas/FetchFrom" + "$ref": "#/components/schemas/FetchFrom", + "description": "Where the model definition comes from. `predefined-model` for built-in models, `customizable-model` for user-configured models." }, "has_invalid_load_balancing_configs": { "default": false, @@ -22854,7 +22872,8 @@ "description": "Whether the model has invalid load-balancing configurations." }, "label": { - "$ref": "#/components/schemas/I18nObject" + "$ref": "#/components/schemas/I18nObject", + "description": "Localized display name of the model." }, "load_balancing_enabled": { "default": false, @@ -22877,10 +22896,12 @@ "description": "Model-specific properties such as `context_size`." }, "model_type": { - "$ref": "#/components/schemas/ModelType" + "$ref": "#/components/schemas/ModelType", + "description": "Type of the model, matching the `model_type` path parameter." }, "status": { - "$ref": "#/components/schemas/ModelStatus" + "$ref": "#/components/schemas/ModelStatus", + "description": "Model availability status. `active` when ready to use." } }, "required": [ @@ -22939,7 +22960,8 @@ "description": "Dark-mode icon URLs; `null` when the provider has none." }, "label": { - "$ref": "#/components/schemas/I18nObject" + "$ref": "#/components/schemas/I18nObject", + "description": "Localized display name of the provider." }, "models": { "items": { @@ -22955,7 +22977,8 @@ "description": "Model provider identifier, formatted as `organization/plugin_name/provider_name` (e.g. `langgenius/openai/openai`). Legacy providers may return the bare short form (e.g. `openai`)." }, "status": { - "$ref": "#/components/schemas/CustomConfigurationStatus" + "$ref": "#/components/schemas/CustomConfigurationStatus", + "description": "Provider status. `active` when credentials are configured and valid." }, "tenant_id": { "title": "Tenant Id", @@ -23751,7 +23774,7 @@ "properties": { "segment": { "$ref": "#/components/schemas/SegmentUpdateArgs", - "description": "Chunk update payload." + "description": "Chunk data to update." } }, "required": [ @@ -23789,7 +23812,8 @@ "SelectInputConfig": { "properties": { "option_source": { - "$ref": "#/components/schemas/StringListSource" + "$ref": "#/components/schemas/StringListSource", + "description": "Source of options for `select` inputs. Present only when `type` is `select`." }, "output_variable_name": { "title": "Output Variable Name", @@ -23974,7 +23998,8 @@ "properties": { "result": { "title": "Result", - "type": "string" + "type": "string", + "description": "Operation result." } }, "required": [ @@ -24183,17 +24208,20 @@ "type": "string" }, "title": "Selector", - "type": "array" + "type": "array", + "description": "Variable reference path when `type` is `variable`." }, "type": { - "$ref": "#/components/schemas/ValueSourceType" + "$ref": "#/components/schemas/ValueSourceType", + "description": "Origin of the options. `constant` means `value` lists the options literally; `variable` means `selector` points to an `array[string]` workflow variable that provides them." }, "value": { "items": { "type": "string" }, "title": "Value", - "type": "array" + "type": "array", + "description": "Literal option list when `type` is `constant`." } }, "required": [ diff --git a/ja/api-reference/openapi_service.json b/ja/api-reference/openapi_service.json index 58611263c4..b92ff5705e 100644 --- a/ja/api-reference/openapi_service.json +++ b/ja/api-reference/openapi_service.json @@ -12925,7 +12925,8 @@ "description": "ツールの入力(JSON 形式)です。" }, "tool_labels": { - "$ref": "#/components/schemas/JSONValue" + "$ref": "#/components/schemas/JSONValue", + "description": "使用されたツールのラベルです。" } }, "required": [ @@ -14646,7 +14647,8 @@ "description": "一意のメッセージ ID です。フィードバックや推奨質問のエンドポイントを呼び出す際に `message_id` パラメータとして使用します。" }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "使用量と検索リソースを含むメタデータ。" }, "mode": { "type": "string", @@ -15659,7 +15661,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "検索モデルの設定です。このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" }, "summary_index_setting": { "anyOf": [ @@ -15820,7 +15823,8 @@ "description": "このナレッジベースで API アクセスが有効かどうかです。" }, "external_knowledge_info": { - "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", + "description": "外部ナレッジベースの接続詳細です。`provider` が `external` の場合に存在します。" }, "external_retrieval_model": { "anyOf": [ @@ -15834,7 +15838,8 @@ "description": "外部ナレッジベースの検索設定です。内部ナレッジベースの場合は `null` です。" }, "icon_info": { - "$ref": "#/components/schemas/DatasetIconInfoResponse" + "$ref": "#/components/schemas/DatasetIconInfoResponse", + "description": "ナレッジベースのアイコン表示設定です。" }, "id": { "type": "string", @@ -15901,7 +15906,8 @@ "description": "プロバイダータイプです。内部管理の場合は `vendor`、外部ナレッジベース接続の場合は `external` です。" }, "retrieval_model_dict": { - "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + "$ref": "#/components/schemas/DatasetRetrievalModelResponse", + "description": "ナレッジベースの検索設定です。" }, "runtime_mode": { "anyOf": [ @@ -15915,7 +15921,8 @@ "description": "ランタイム処理モードです。" }, "summary_index_setting": { - "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse", + "description": "サマリーインデックスの設定です。" }, "tags": { "items": { @@ -16110,7 +16117,8 @@ "description": "このナレッジベースで API アクセスが有効かどうかです。" }, "external_knowledge_info": { - "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", + "description": "外部ナレッジベースの接続詳細です。`provider` が `external` の場合に存在します。" }, "external_retrieval_model": { "anyOf": [ @@ -16124,7 +16132,8 @@ "description": "外部ナレッジベースの検索設定です。内部ナレッジベースの場合は `null` です。" }, "icon_info": { - "$ref": "#/components/schemas/DatasetIconInfoResponse" + "$ref": "#/components/schemas/DatasetIconInfoResponse", + "description": "ナレッジベースのアイコン表示設定です。" }, "id": { "type": "string", @@ -16206,7 +16215,8 @@ "description": "プロバイダータイプです。内部管理の場合は `vendor`、外部ナレッジベース接続の場合は `external` です。" }, "retrieval_model_dict": { - "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + "$ref": "#/components/schemas/DatasetRetrievalModelResponse", + "description": "ナレッジベースの検索設定です。" }, "runtime_mode": { "anyOf": [ @@ -16220,7 +16230,8 @@ "description": "ランタイム処理モードです。" }, "summary_index_setting": { - "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse", + "description": "サマリーインデックスの設定です。" }, "tags": { "items": { @@ -16706,7 +16717,8 @@ "description": "リランキングモードです。`reranking_model` はモデルベースのリランキング、`weighted_score` はスコアベースの重み付けを示します。リランキングが無効の場合は `null` です。" }, "reranking_model": { - "$ref": "#/components/schemas/DatasetRerankingModelResponse" + "$ref": "#/components/schemas/DatasetRerankingModelResponse", + "description": "リランキングモデルの設定です。" }, "score_threshold": { "anyOf": [ @@ -16989,7 +17001,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "検索モデルの設定です。このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" } }, "type": "object" @@ -17038,10 +17051,12 @@ "DatasetWeightedScoreResponse": { "properties": { "keyword_setting": { - "$ref": "#/components/schemas/DatasetKeywordSettingResponse" + "$ref": "#/components/schemas/DatasetKeywordSettingResponse", + "description": "キーワード検索の重み設定です。" }, "vector_setting": { - "$ref": "#/components/schemas/DatasetVectorSettingResponse" + "$ref": "#/components/schemas/DatasetVectorSettingResponse", + "description": "セマンティック検索の重み設定です。" }, "weight_type": { "anyOf": [ @@ -18277,7 +18292,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" }, "text": { "description": "ドキュメントのテキスト内容です。", @@ -18977,7 +18993,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "検索モデルの設定です。このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" } }, "required": [ @@ -19025,7 +19042,8 @@ "description": "関連性スコアです。" }, "segment": { - "$ref": "#/components/schemas/HitTestingSegment" + "$ref": "#/components/schemas/HitTestingSegment", + "description": "ナレッジベースから一致したチャンクです。" }, "summary": { "anyOf": [ @@ -19061,7 +19079,8 @@ "HitTestingResponse": { "properties": { "query": { - "$ref": "#/components/schemas/HitTestingQuery" + "$ref": "#/components/schemas/HitTestingQuery", + "description": "元のクエリオブジェクトです。" }, "records": { "items": { @@ -19136,7 +19155,8 @@ "description": "チャンクを無効化したユーザーの ID です。有効な場合は `null` です。" }, "document": { - "$ref": "#/components/schemas/HitTestingDocument" + "$ref": "#/components/schemas/HitTestingDocument", + "description": "マッチしたチャンクの親ドキュメント情報です。" }, "document_id": { "type": "string", @@ -20252,7 +20272,8 @@ "description": "回答後の提案質問の設定です。" }, "system_parameters": { - "$ref": "#/components/schemas/SystemParameters" + "$ref": "#/components/schemas/SystemParameters", + "description": "システムレベルのパラメータ制限です。" }, "text_to_speech": { "properties": { @@ -21631,7 +21652,8 @@ { "$ref": "#/components/schemas/WorkflowBlockingResponse" } - ] + ], + "description": "パイプライン実行の完全な結果です。`response_mode` が `blocking` の場合に返されます。" }, "PipelineUploadFileResponse": { "properties": { @@ -21714,7 +21736,8 @@ "ProcessRule": { "properties": { "mode": { - "$ref": "#/components/schemas/ProcessRuleMode" + "$ref": "#/components/schemas/ProcessRuleMode", + "description": "`automatic` は組み込みルールを使用、`custom` は手動設定が可能、`hierarchical` は親子チャンク構造を有効にします(`doc_form: hierarchical_model` と組み合わせて使用)。" }, "rules": { "anyOf": [ @@ -21764,7 +21787,8 @@ "description": "モデルがサポートする機能です。なしの場合は `null` です。" }, "fetch_from": { - "$ref": "#/components/schemas/FetchFrom" + "$ref": "#/components/schemas/FetchFrom", + "description": "モデル定義の取得元です。`predefined-model` は組み込みモデル、`customizable-model` はユーザー設定モデルを示します。" }, "has_invalid_load_balancing_configs": { "default": false, @@ -21772,7 +21796,8 @@ "description": "モデルに無効なロードバランシング設定があるかどうか。" }, "label": { - "$ref": "#/components/schemas/I18nObject" + "$ref": "#/components/schemas/I18nObject", + "description": "モデルのローカライズ表示名です。" }, "load_balancing_enabled": { "default": false, @@ -21792,10 +21817,12 @@ "description": "`context_size` などのモデル固有のプロパティです。" }, "model_type": { - "$ref": "#/components/schemas/ModelType" + "$ref": "#/components/schemas/ModelType", + "description": "モデルのタイプです。`model_type` パスパラメータと一致します。" }, "status": { - "$ref": "#/components/schemas/ModelStatus" + "$ref": "#/components/schemas/ModelStatus", + "description": "モデルの利用可能ステータスです。使用可能な場合は `active` です。" } }, "required": [ @@ -21850,7 +21877,8 @@ "description": "ダークモード用アイコンの URL。プロバイダーにない場合は `null`。" }, "label": { - "$ref": "#/components/schemas/I18nObject" + "$ref": "#/components/schemas/I18nObject", + "description": "プロバイダーのローカライズ表示名です。" }, "models": { "items": { @@ -21864,7 +21892,8 @@ "description": "モデルプロバイダーの識別子です。`organization/plugin_name/provider_name` の形式です(例:`langgenius/openai/openai`)。以前のプロバイダーでは短縮形(例:`openai`)が返される場合があります。" }, "status": { - "$ref": "#/components/schemas/CustomConfigurationStatus" + "$ref": "#/components/schemas/CustomConfigurationStatus", + "description": "プロバイダーのステータスです。認証情報が設定済みで有効な場合は `active` です。" }, "tenant_id": { "type": "string", @@ -22571,7 +22600,8 @@ "SegmentUpdatePayload": { "properties": { "segment": { - "$ref": "#/components/schemas/SegmentUpdateArgs" + "$ref": "#/components/schemas/SegmentUpdateArgs", + "description": "更新するチャンクデータです。" } }, "required": [ @@ -22604,7 +22634,8 @@ "SelectInputConfig": { "properties": { "option_source": { - "$ref": "#/components/schemas/StringListSource" + "$ref": "#/components/schemas/StringListSource", + "description": "`select` 入力の選択肢のソース。 `type` が `select` の場合のみ含まれます。" }, "output_variable_name": { "type": "string" @@ -22766,7 +22797,8 @@ "SimpleResultResponse": { "properties": { "result": { - "type": "string" + "type": "string", + "description": "操作結果です。" } }, "required": [ @@ -22954,16 +22986,19 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "`type` が `variable` の場合の変数参照パス。" }, "type": { - "$ref": "#/components/schemas/ValueSourceType" + "$ref": "#/components/schemas/ValueSourceType", + "description": "選択肢のソース。 `constant` は `value` に選択肢を直接列挙することを示します。 `variable` は `selector` が選択肢を提供する `array[string]` 型のワークフロー変数を指すことを示します。" }, "value": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "`type` が `constant` の場合のリテラルな選択肢リスト。" } }, "required": [ diff --git a/zh/api-reference/openapi_service.json b/zh/api-reference/openapi_service.json index 09c1d2b72a..a65c8da8fc 100644 --- a/zh/api-reference/openapi_service.json +++ b/zh/api-reference/openapi_service.json @@ -12925,7 +12925,8 @@ "description": "工具输入(JSON 格式)。" }, "tool_labels": { - "$ref": "#/components/schemas/JSONValue" + "$ref": "#/components/schemas/JSONValue", + "description": "已使用工具的标签。" } }, "required": [ @@ -14646,7 +14647,8 @@ "description": "唯一的消息 ID。调用反馈或推荐问题接口时,将此值作为 `message_id` 参数使用。" }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "包含用量和检索资源的元数据。" }, "mode": { "type": "string", @@ -15659,7 +15661,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "检索模型配置。控制查询此知识库时如何搜索和排序分段。" }, "summary_index_setting": { "anyOf": [ @@ -15820,7 +15823,8 @@ "description": "该知识库是否启用 API 访问。" }, "external_knowledge_info": { - "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", + "description": "外部知识库的连接详情。当 `provider` 为 `external` 时存在。" }, "external_retrieval_model": { "anyOf": [ @@ -15834,7 +15838,8 @@ "description": "外部知识库的检索设置。内部知识库时为 `null`。" }, "icon_info": { - "$ref": "#/components/schemas/DatasetIconInfoResponse" + "$ref": "#/components/schemas/DatasetIconInfoResponse", + "description": "知识库的图标显示配置。" }, "id": { "type": "string", @@ -15901,7 +15906,8 @@ "description": "供应商类型。内部管理为 `vendor`,外部知识库连接为 `external`。" }, "retrieval_model_dict": { - "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + "$ref": "#/components/schemas/DatasetRetrievalModelResponse", + "description": "知识库的检索配置。" }, "runtime_mode": { "anyOf": [ @@ -15915,7 +15921,8 @@ "description": "运行时处理模式。" }, "summary_index_setting": { - "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse", + "description": "摘要索引配置。" }, "tags": { "items": { @@ -16110,7 +16117,8 @@ "description": "该知识库是否启用 API 访问。" }, "external_knowledge_info": { - "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse" + "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", + "description": "外部知识库的连接详情。当 `provider` 为 `external` 时存在。" }, "external_retrieval_model": { "anyOf": [ @@ -16124,7 +16132,8 @@ "description": "外部知识库的检索设置。内部知识库时为 `null`。" }, "icon_info": { - "$ref": "#/components/schemas/DatasetIconInfoResponse" + "$ref": "#/components/schemas/DatasetIconInfoResponse", + "description": "知识库的图标显示配置。" }, "id": { "type": "string", @@ -16206,7 +16215,8 @@ "description": "供应商类型。内部管理为 `vendor`,外部知识库连接为 `external`。" }, "retrieval_model_dict": { - "$ref": "#/components/schemas/DatasetRetrievalModelResponse" + "$ref": "#/components/schemas/DatasetRetrievalModelResponse", + "description": "知识库的检索配置。" }, "runtime_mode": { "anyOf": [ @@ -16220,7 +16230,8 @@ "description": "运行时处理模式。" }, "summary_index_setting": { - "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse" + "$ref": "#/components/schemas/DatasetSummaryIndexSettingResponse", + "description": "摘要索引配置。" }, "tags": { "items": { @@ -16706,7 +16717,8 @@ "description": "重排序模式。`reranking_model` 表示基于模型的重排序,`weighted_score` 表示基于分数的加权。重排序禁用时为 `null`。" }, "reranking_model": { - "$ref": "#/components/schemas/DatasetRerankingModelResponse" + "$ref": "#/components/schemas/DatasetRerankingModelResponse", + "description": "重排序模型配置。" }, "score_threshold": { "anyOf": [ @@ -16989,7 +17001,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "检索模型配置。控制查询此知识库时如何搜索和排序分段。" } }, "type": "object" @@ -17038,10 +17051,12 @@ "DatasetWeightedScoreResponse": { "properties": { "keyword_setting": { - "$ref": "#/components/schemas/DatasetKeywordSettingResponse" + "$ref": "#/components/schemas/DatasetKeywordSettingResponse", + "description": "关键词搜索权重设置。" }, "vector_setting": { - "$ref": "#/components/schemas/DatasetVectorSettingResponse" + "$ref": "#/components/schemas/DatasetVectorSettingResponse", + "description": "语义搜索权重设置。" }, "weight_type": { "anyOf": [ @@ -18277,7 +18292,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "控制查询此知识库时如何搜索和排序分段。" }, "text": { "description": "文档文本内容。", @@ -18977,7 +18993,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "检索模型配置。控制查询此知识库时如何搜索和排序分段。" } }, "required": [ @@ -19025,7 +19042,8 @@ "description": "相关性得分。" }, "segment": { - "$ref": "#/components/schemas/HitTestingSegment" + "$ref": "#/components/schemas/HitTestingSegment", + "description": "从知识库中匹配的分段。" }, "summary": { "anyOf": [ @@ -19061,7 +19079,8 @@ "HitTestingResponse": { "properties": { "query": { - "$ref": "#/components/schemas/HitTestingQuery" + "$ref": "#/components/schemas/HitTestingQuery", + "description": "原始查询对象。" }, "records": { "items": { @@ -19136,7 +19155,8 @@ "description": "禁用该分段的用户 ID。启用时为 `null`。" }, "document": { - "$ref": "#/components/schemas/HitTestingDocument" + "$ref": "#/components/schemas/HitTestingDocument", + "description": "匹配分段的父文档信息。" }, "document_id": { "type": "string", @@ -20252,7 +20272,8 @@ "description": "回答后建议问题的配置。" }, "system_parameters": { - "$ref": "#/components/schemas/SystemParameters" + "$ref": "#/components/schemas/SystemParameters", + "description": "系统级参数限制。" }, "text_to_speech": { "properties": { @@ -21631,7 +21652,8 @@ { "$ref": "#/components/schemas/WorkflowBlockingResponse" } - ] + ], + "description": "完整的流水线执行结果。当 `response_mode` 为 `blocking` 时返回。" }, "PipelineUploadFileResponse": { "properties": { @@ -21714,7 +21736,8 @@ "ProcessRule": { "properties": { "mode": { - "$ref": "#/components/schemas/ProcessRuleMode" + "$ref": "#/components/schemas/ProcessRuleMode", + "description": "`automatic` 使用内置规则,`custom` 允许手动配置,`hierarchical` 启用父子分段结构(配合 `doc_form: hierarchical_model` 使用)。" }, "rules": { "anyOf": [ @@ -21764,7 +21787,8 @@ "description": "模型支持的功能,无功能时为 `null`。" }, "fetch_from": { - "$ref": "#/components/schemas/FetchFrom" + "$ref": "#/components/schemas/FetchFrom", + "description": "模型定义的来源。`predefined-model` 表示内置模型,`customizable-model` 表示用户自配置的模型。" }, "has_invalid_load_balancing_configs": { "default": false, @@ -21772,7 +21796,8 @@ "description": "模型是否存在无效的负载均衡配置。" }, "label": { - "$ref": "#/components/schemas/I18nObject" + "$ref": "#/components/schemas/I18nObject", + "description": "模型的本地化显示名称。" }, "load_balancing_enabled": { "default": false, @@ -21792,10 +21817,12 @@ "description": "模型特定的属性,例如 `context_size`。" }, "model_type": { - "$ref": "#/components/schemas/ModelType" + "$ref": "#/components/schemas/ModelType", + "description": "模型类型,与 `model_type` 路径参数匹配。" }, "status": { - "$ref": "#/components/schemas/ModelStatus" + "$ref": "#/components/schemas/ModelStatus", + "description": "模型可用状态。就绪时为 `active`。" } }, "required": [ @@ -21850,7 +21877,8 @@ "description": "深色模式图标 URL;供应商没有时为 `null`。" }, "label": { - "$ref": "#/components/schemas/I18nObject" + "$ref": "#/components/schemas/I18nObject", + "description": "供应商的本地化显示名称。" }, "models": { "items": { @@ -21864,7 +21892,8 @@ "description": "模型供应商标识符,格式为 `organization/plugin_name/provider_name`(例如 `langgenius/openai/openai`)。旧版供应商可能返回简写形式(例如 `openai`)。" }, "status": { - "$ref": "#/components/schemas/CustomConfigurationStatus" + "$ref": "#/components/schemas/CustomConfigurationStatus", + "description": "供应商状态。凭证已配置且有效时为 `active`。" }, "tenant_id": { "type": "string", @@ -22571,7 +22600,8 @@ "SegmentUpdatePayload": { "properties": { "segment": { - "$ref": "#/components/schemas/SegmentUpdateArgs" + "$ref": "#/components/schemas/SegmentUpdateArgs", + "description": "要更新的分段数据。" } }, "required": [ @@ -22604,7 +22634,8 @@ "SelectInputConfig": { "properties": { "option_source": { - "$ref": "#/components/schemas/StringListSource" + "$ref": "#/components/schemas/StringListSource", + "description": "`select` 输入的选项来源。仅当 `type` 为 `select` 时出现。" }, "output_variable_name": { "type": "string" @@ -22766,7 +22797,8 @@ "SimpleResultResponse": { "properties": { "result": { - "type": "string" + "type": "string", + "description": "操作结果。" } }, "required": [ @@ -22954,16 +22986,19 @@ "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "当 `type` 为 `variable` 时的变量引用路径。" }, "type": { - "$ref": "#/components/schemas/ValueSourceType" + "$ref": "#/components/schemas/ValueSourceType", + "description": "选项来源。`constant` 表示 `value` 直接列出选项;`variable` 表示 `selector` 指向提供选项的 `array[string]` 工作流变量。" }, "value": { "items": { "type": "string" }, - "type": "array" + "type": "array", + "description": "当 `type` 为 `constant` 时的字面选项列表。" } }, "required": [ From 7ed0d6658ac0eebf4e676cd6054c659c4b5e8a46 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 26 Aug 2026 13:39:37 +0800 Subject: [PATCH 10/10] fix: refresh service api from merged contract --- en/api-reference/openapi_service.json | 351 ++++++++++++++++++++++---- ja/api-reference/openapi_service.json | 347 +++++++++++++++++++++---- zh/api-reference/openapi_service.json | 347 +++++++++++++++++++++---- 3 files changed, 910 insertions(+), 135 deletions(-) diff --git a/en/api-reference/openapi_service.json b/en/api-reference/openapi_service.json index e9deb8f54d..17a398dc70 100644 --- a/en/api-reference/openapi_service.json +++ b/en/api-reference/openapi_service.json @@ -484,7 +484,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequiredServiceApiUserPayload" + "$ref": "#/components/schemas/ScopedTaskStopPayload" }, "examples": { "example": { @@ -552,12 +552,6 @@ "application/json": {} }, "description": "Forbidden - token scope, app, dataset, or workspace access denied" - }, - "404": { - "content": { - "application/json": {} - }, - "description": "Task not found" } }, "x-mint": { @@ -4654,7 +4648,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequiredServiceApiUserPayload" + "$ref": "#/components/schemas/WorkflowTaskStopPayload" }, "examples": { "example": { @@ -4722,12 +4716,6 @@ "application/json": {} }, "description": "Forbidden - token scope, app, dataset, or workspace access denied" - }, - "404": { - "content": { - "application/json": {} - }, - "description": "Task not found" } }, "x-mint": { @@ -4993,7 +4981,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequiredServiceApiUserPayload" + "$ref": "#/components/schemas/ScopedTaskStopPayload" }, "examples": { "example": { @@ -5061,12 +5049,6 @@ "application/json": {} }, "description": "Forbidden - token scope, app, dataset, or workspace access denied" - }, - "404": { - "content": { - "application/json": {} - }, - "description": "Task not found" } }, "x-mint": { @@ -5943,6 +5925,40 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "404": { + "description": "`not_found` : Knowledge base not found.", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } + }, + "503": { + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -6169,6 +6185,40 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "404": { + "description": "`not_found` : Knowledge base not found.", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } + }, + "503": { + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -6927,6 +6977,23 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "503": { + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -7396,6 +7463,23 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "503": { + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -7656,6 +7740,23 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "503": { + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "deprecated": true, @@ -8149,6 +8250,23 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "503": { + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -8747,6 +8865,23 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "503": { + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -9087,6 +9222,23 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "503": { + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -9469,6 +9621,23 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "503": { + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -10345,6 +10514,23 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "404": { + "description": "`not_found` : Knowledge base not found.", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } } }, "x-mint": { @@ -10892,6 +11078,23 @@ "application/json": {} }, "description": "Unauthorized - invalid API token" + }, + "404": { + "description": "`not_found` : Knowledge base not found.", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } } }, "x-mint": { @@ -11880,7 +12083,7 @@ "/datasets/{dataset_id}/document/create_by_file": { "post": { "deprecated": true, - "description": "Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.", + "description": "Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned `batch` ID with [Get Document Indexing Status](/en/api-reference/documents/get-document-indexing-status) to track progress.", "operationId": "create_document_by_file_75a87285", "parameters": [ { @@ -11901,7 +12104,7 @@ "schema": { "properties": { "data": { - "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", + "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/en/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", "type": "string" }, "file": { @@ -11948,11 +12151,23 @@ }, "description": "Forbidden - dataset API access or workspace access denied" }, + "404": { + "content": { + "application/json": {} + }, + "description": "`not_found` : Knowledge base not found." + }, "413": { "content": { "application/json": {} }, "description": "`file_too_large` : File size exceeded." + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, "summary": "Create Document by File", @@ -12017,8 +12232,21 @@ "application/json": {} }, "description": "Forbidden - dataset API access or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "`not_found` : Knowledge base not found." + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, + "summary": "Create document by text through the deprecated underscore alias", "tags": [ "service_api" ] @@ -12027,7 +12255,7 @@ "/datasets/{dataset_id}/documents/{document_id}/update_by_file": { "post": { "deprecated": true, - "description": "Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/api-reference/documents/get-document-indexing-status) to track progress.", + "description": "Update an existing document by uploading a new file. Re-triggers indexing — use the returned `batch` ID with [Get Document Indexing Status](/en/api-reference/documents/get-document-indexing-status) to track progress.", "operationId": "update_document_by_file_deprecated_5dc5fe59", "parameters": [ { @@ -12120,6 +12348,12 @@ "application/json": {} }, "description": "Unsupported file type" + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, "summary": "Update Document by File", @@ -12195,8 +12429,15 @@ "application/json": {} }, "description": "Document not found" + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, + "summary": "Update document by text through the deprecated underscore alias", "tags": [ "service_api" ] @@ -14002,7 +14243,8 @@ "description": "Unique message ID. Use this as the `message_id` parameter when calling feedback or suggested questions endpoints." }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "Metadata including usage and retriever resources." }, "mode": { "title": "Mode", @@ -14202,7 +14444,8 @@ "type": "string" }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "Metadata including usage and retriever resources." }, "mode": { "title": "Mode", @@ -14296,7 +14539,8 @@ "type": "string" }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "Metadata including usage and retriever resources." }, "mode": { "title": "Mode", @@ -16360,7 +16604,7 @@ }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", - "description": "Connection details for external knowledge bases. Present when `provider` is `external`." + "description": "Connection details for external knowledge bases. Populated when `provider` is `external`; otherwise its properties are `null`." }, "external_retrieval_model": { "anyOf": [ @@ -16687,7 +16931,7 @@ }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", - "description": "Connection details for external knowledge bases. Present when `provider` is `external`." + "description": "Connection details for external knowledge bases. Populated when `provider` is `external`; otherwise its properties are `null`." }, "external_retrieval_model": { "anyOf": [ @@ -19167,7 +19411,7 @@ } ], "default": null, - "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + "description": "Controls how chunks are searched and ranked when querying this knowledge base." }, "text": { "default": null, @@ -19236,7 +19480,7 @@ } ], "default": null, - "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + "description": "Controls how chunks are searched and ranked when querying this knowledge base." }, "text": { "description": "Document text content.", @@ -19299,7 +19543,7 @@ } ], "default": null, - "description": "Retrieval model configuration. Controls how chunks are searched and ranked." + "description": "Controls how chunks are searched and ranked when querying this knowledge base." }, "text": { "anyOf": [ @@ -21132,7 +21376,7 @@ } ], "default": null, - "description": "Default value configuration for a form input." + "description": "Raw default-value configuration for the paragraph input. Runtime-resolved values are exposed in the surrounding `resolved_default_values` mapping." }, "output_variable_name": { "title": "Output Variable Name", @@ -22709,7 +22953,7 @@ "$ref": "#/components/schemas/WorkflowBlockingResponse" } ], - "description": "Complete pipeline execution result. Returned when `response_mode` is `blocking`.", + "description": "JSON result for published runs and draft runs using `response_mode: blocking`.", "title": "PipelineRunJsonResponse" }, "PipelineUploadFileResponse": { @@ -23021,19 +23265,6 @@ "title": "PublishedPipelineRunResponse", "type": "object" }, - "RequiredServiceApiUserPayload": { - "properties": { - "user": { - "description": "User identifier, unique within the application. This identifier scopes data access; resources created with one `user` value are only visible when queried with the same `user` value.", - "type": "string" - } - }, - "required": [ - "user" - ], - "title": "ServiceApiUserPayload", - "type": "object" - }, "RerankingModel": { "properties": { "reranking_model_name": { @@ -26144,6 +26375,32 @@ ], "title": "WorkflowRunResponse", "type": "object" + }, + "ScopedTaskStopPayload": { + "properties": { + "user": { + "description": "End-user identifier, defined by your app and unique within it. Send the same `user` value used for the original generation request. See [End User Identity](/en/api-reference/guides/end-user-identity).", + "type": "string" + } + }, + "required": [ + "user" + ], + "title": "ServiceApiUserPayload", + "type": "object" + }, + "WorkflowTaskStopPayload": { + "properties": { + "user": { + "description": "End-user identifier, defined by your app and unique within it. It does not need to match the `user` that started the run; the stop applies to the task regardless of `user`. See [End User Identity](/en/api-reference/guides/end-user-identity).", + "type": "string" + } + }, + "required": [ + "user" + ], + "title": "ServiceApiUserPayload", + "type": "object" } } } diff --git a/ja/api-reference/openapi_service.json b/ja/api-reference/openapi_service.json index b92ff5705e..687bfddd0c 100644 --- a/ja/api-reference/openapi_service.json +++ b/ja/api-reference/openapi_service.json @@ -483,7 +483,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequiredServiceApiUserPayload" + "$ref": "#/components/schemas/ScopedTaskStopPayload" }, "examples": { "example": { @@ -551,12 +551,6 @@ "application/json": {} }, "description": "このリソースにアクセスする権限がありません。" - }, - "404": { - "content": { - "application/json": {} - }, - "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -4622,7 +4616,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequiredServiceApiUserPayload" + "$ref": "#/components/schemas/WorkflowTaskStopPayload" }, "examples": { "example": { @@ -4690,12 +4684,6 @@ "application/json": {} }, "description": "このリソースにアクセスする権限がありません。" - }, - "404": { - "content": { - "application/json": {} - }, - "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -4960,7 +4948,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequiredServiceApiUserPayload" + "$ref": "#/components/schemas/ScopedTaskStopPayload" }, "examples": { "example": { @@ -5028,12 +5016,6 @@ "application/json": {} }, "description": "このリソースにアクセスする権限がありません。" - }, - "404": { - "content": { - "application/json": {} - }, - "description": "リクエストされたリソースが見つかりません。" } }, "x-mint": { @@ -5904,6 +5886,40 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "404": { + "description": "`not_found` : ナレッジベースが見つかりません。", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } + }, + "503": { + "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -6129,6 +6145,40 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "404": { + "description": "`not_found` : ナレッジベースが見つかりません。", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } + }, + "503": { + "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -6879,6 +6929,23 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "503": { + "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -7342,6 +7409,23 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "503": { + "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -7600,6 +7684,23 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "503": { + "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "deprecated": true, @@ -8088,6 +8189,23 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "503": { + "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -8676,6 +8794,23 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "503": { + "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -9010,6 +9145,23 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "503": { + "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -9385,6 +9537,23 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "503": { + "description": "`service_unavailable` : ベクトル空間の使用量を現在確認できません。しばらくしてから再試行してください。Dify Cloud の Sandbox プランでのみ発生します。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -10256,6 +10425,23 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "404": { + "description": "`not_found` : ナレッジベースが見つかりません。", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } } }, "x-mint": { @@ -10796,6 +10982,23 @@ "application/json": {} }, "description": "認証に失敗しました。API トークンが無効です。" + }, + "404": { + "description": "`not_found` : ナレッジベースが見つかりません。", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } } }, "x-mint": { @@ -11797,7 +12000,7 @@ "schema": { "properties": { "data": { - "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", + "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/ja/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", "type": "string" }, "file": { @@ -11844,11 +12047,23 @@ }, "description": "Forbidden - dataset API access or workspace access denied" }, + "404": { + "content": { + "application/json": {} + }, + "description": "`not_found` : Knowledge base not found." + }, "413": { "content": { "application/json": {} }, "description": "`file_too_large` : File size exceeded." + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, "summary": "Create Document by File", @@ -11913,8 +12128,21 @@ "application/json": {} }, "description": "Forbidden - dataset API access or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "`not_found` : Knowledge base not found." + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, + "summary": "Create document by text through the deprecated underscore alias", "tags": [ "service_api" ] @@ -12016,6 +12244,12 @@ "application/json": {} }, "description": "Unsupported file type" + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, "summary": "Update Document by File", @@ -12091,8 +12325,15 @@ "application/json": {} }, "description": "Document not found" + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, + "summary": "Update document by text through the deprecated underscore alias", "tags": [ "service_api" ] @@ -13725,7 +13966,8 @@ "description": "一意のメッセージ ID です。フィードバックや推奨質問のエンドポイントを呼び出す際に `message_id` パラメータとして使用します。" }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "使用量と検索リソースを含むメタデータ。" }, "mode": { "type": "string", @@ -13901,7 +14143,8 @@ "type": "string" }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "使用量と検索リソースを含むメタデータ。" }, "mode": { "type": "string" @@ -13981,7 +14224,8 @@ "type": "string" }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "使用量と検索リソースを含むメタデータ。" }, "mode": { "type": "string" @@ -15824,7 +16068,7 @@ }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", - "description": "外部ナレッジベースの接続詳細です。`provider` が `external` の場合に存在します。" + "description": "外部ナレッジベースの接続詳細です。`provider` が `external` の場合に設定され、それ以外の場合は各プロパティが `null` になります。" }, "external_retrieval_model": { "anyOf": [ @@ -16118,7 +16362,7 @@ }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", - "description": "外部ナレッジベースの接続詳細です。`provider` が `external` の場合に存在します。" + "description": "外部ナレッジベースの接続詳細です。`provider` が `external` の場合に設定され、それ以外の場合は各プロパティが `null` になります。" }, "external_retrieval_model": { "anyOf": [ @@ -18351,7 +18595,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" }, "text": { "default": null, @@ -18415,7 +18660,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" }, "text": { "description": "ドキュメントのテキスト内容です。", @@ -18474,7 +18720,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "このナレッジベースをクエリする際のチャンクの検索方法とランキング方法を制御します。" }, "text": { "anyOf": [ @@ -20107,7 +20354,7 @@ } ], "default": null, - "description": "フォーム入力のデフォルト値設定です。" + "description": "`paragraph` 入力の生のデフォルト値設定です。実行時に解決された値は、外側の `resolved_default_values` マッピングに格納されます。" }, "output_variable_name": { "type": "string", @@ -21653,7 +21900,7 @@ "$ref": "#/components/schemas/WorkflowBlockingResponse" } ], - "description": "パイプライン実行の完全な結果です。`response_mode` が `blocking` の場合に返されます。" + "description": "公開済み実行、および `response_mode: blocking` を使用するドラフト実行の JSON 結果です。" }, "PipelineUploadFileResponse": { "properties": { @@ -21931,18 +22178,6 @@ ], "type": "object" }, - "RequiredServiceApiUserPayload": { - "properties": { - "user": { - "description": "アプリケーション側で定義し、アプリケーション内で一意となるエンドユーザー識別子です。", - "type": "string" - } - }, - "required": [ - "user" - ], - "type": "object" - }, "RerankingModel": { "properties": { "reranking_model_name": { @@ -24720,6 +24955,30 @@ "workflow_id" ], "type": "object" + }, + "ScopedTaskStopPayload": { + "properties": { + "user": { + "type": "string", + "description": "エンドユーザーの識別子です。アプリ側で定義し、アプリ内で一意にします。元の生成リクエストと同じ `user` 値を指定してください。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" + } + }, + "required": [ + "user" + ], + "type": "object" + }, + "WorkflowTaskStopPayload": { + "properties": { + "user": { + "type": "string", + "description": "エンドユーザーの識別子です。アプリ側で定義し、アプリ内で一意にします。実行を開始した `user` と一致する必要はありません。`user` にかかわらず、停止操作は対象タスクに適用されます。[エンドユーザーの識別](/ja/api-reference/guides/end-user-identity) を参照してください。" + } + }, + "required": [ + "user" + ], + "type": "object" } } } diff --git a/zh/api-reference/openapi_service.json b/zh/api-reference/openapi_service.json index a65c8da8fc..3178251901 100644 --- a/zh/api-reference/openapi_service.json +++ b/zh/api-reference/openapi_service.json @@ -483,7 +483,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequiredServiceApiUserPayload" + "$ref": "#/components/schemas/ScopedTaskStopPayload" }, "examples": { "example": { @@ -551,12 +551,6 @@ "application/json": {} }, "description": "没有访问此资源的权限。" - }, - "404": { - "content": { - "application/json": {} - }, - "description": "找不到请求的资源。" } }, "x-mint": { @@ -4622,7 +4616,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequiredServiceApiUserPayload" + "$ref": "#/components/schemas/WorkflowTaskStopPayload" }, "examples": { "example": { @@ -4690,12 +4684,6 @@ "application/json": {} }, "description": "没有访问此资源的权限。" - }, - "404": { - "content": { - "application/json": {} - }, - "description": "找不到请求的资源。" } }, "x-mint": { @@ -4960,7 +4948,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RequiredServiceApiUserPayload" + "$ref": "#/components/schemas/ScopedTaskStopPayload" }, "examples": { "example": { @@ -5028,12 +5016,6 @@ "application/json": {} }, "description": "没有访问此资源的权限。" - }, - "404": { - "content": { - "application/json": {} - }, - "description": "找不到请求的资源。" } }, "x-mint": { @@ -5904,6 +5886,40 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "404": { + "description": "`not_found` : 未找到知识库。", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } + }, + "503": { + "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -6129,6 +6145,40 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "404": { + "description": "`not_found` : 未找到知识库。", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } + }, + "503": { + "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -6879,6 +6929,23 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "503": { + "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -7342,6 +7409,23 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "503": { + "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -7600,6 +7684,23 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "503": { + "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "deprecated": true, @@ -8088,6 +8189,23 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "503": { + "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -8676,6 +8794,23 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "503": { + "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -9010,6 +9145,23 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "503": { + "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -9385,6 +9537,23 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "503": { + "description": "`service_unavailable` : 暂时无法确认向量空间用量,稍后重试即可。仅在 Dify Cloud Sandbox 套餐下出现。", + "content": { + "application/json": { + "examples": { + "service_unavailable": { + "summary": "service_unavailable", + "value": { + "status": 503, + "code": "service_unavailable", + "message": "Unable to verify vector space usage right now. Please try again later." + } + } + } + } + } } }, "x-mint": { @@ -10256,6 +10425,23 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "404": { + "description": "`not_found` : 未找到知识库。", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } } }, "x-mint": { @@ -10796,6 +10982,23 @@ "application/json": {} }, "description": "身份验证失败:API 令牌无效。" + }, + "404": { + "description": "`not_found` : 未找到知识库。", + "content": { + "application/json": { + "examples": { + "not_found": { + "summary": "not_found", + "value": { + "status": 404, + "code": "not_found", + "message": "Dataset not found." + } + } + } + } + } } }, "x-mint": { @@ -11797,7 +12000,7 @@ "schema": { "properties": { "data": { - "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", + "description": "JSON string containing configuration. Accepts the same fields as [Create Document by Text](/zh/api-reference/documents/create-document-by-text) (`indexing_technique`, `doc_form`, `doc_language`, `process_rule`, `retrieval_model`, `embedding_model`, `embedding_model_provider`) except `name` and `text`.", "type": "string" }, "file": { @@ -11844,11 +12047,23 @@ }, "description": "Forbidden - dataset API access or workspace access denied" }, + "404": { + "content": { + "application/json": {} + }, + "description": "`not_found` : Knowledge base not found." + }, "413": { "content": { "application/json": {} }, "description": "`file_too_large` : File size exceeded." + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, "summary": "Create Document by File", @@ -11913,8 +12128,21 @@ "application/json": {} }, "description": "Forbidden - dataset API access or workspace access denied" + }, + "404": { + "content": { + "application/json": {} + }, + "description": "`not_found` : Knowledge base not found." + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, + "summary": "Create document by text through the deprecated underscore alias", "tags": [ "service_api" ] @@ -12016,6 +12244,12 @@ "application/json": {} }, "description": "Unsupported file type" + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, "summary": "Update Document by File", @@ -12091,8 +12325,15 @@ "application/json": {} }, "description": "Document not found" + }, + "503": { + "content": { + "application/json": {} + }, + "description": "`service_unavailable` : Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later." } }, + "summary": "Update document by text through the deprecated underscore alias", "tags": [ "service_api" ] @@ -13725,7 +13966,8 @@ "description": "唯一的消息 ID。调用反馈或推荐问题接口时,将此值作为 `message_id` 参数使用。" }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "包含用量和检索资源的元数据。" }, "mode": { "type": "string", @@ -13901,7 +14143,8 @@ "type": "string" }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "包含用量和检索资源的元数据。" }, "mode": { "type": "string" @@ -13981,7 +14224,8 @@ "type": "string" }, "metadata": { - "$ref": "#/components/schemas/BlockingMetadataResponse" + "$ref": "#/components/schemas/BlockingMetadataResponse", + "description": "包含用量和检索资源的元数据。" }, "mode": { "type": "string" @@ -15824,7 +16068,7 @@ }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", - "description": "外部知识库的连接详情。当 `provider` 为 `external` 时存在。" + "description": "外部知识库的连接详情。`provider` 为 `external` 时填充;否则其属性为 `null`。" }, "external_retrieval_model": { "anyOf": [ @@ -16118,7 +16362,7 @@ }, "external_knowledge_info": { "$ref": "#/components/schemas/DatasetExternalKnowledgeInfoResponse", - "description": "外部知识库的连接详情。当 `provider` 为 `external` 时存在。" + "description": "外部知识库的连接详情。`provider` 为 `external` 时填充;否则其属性为 `null`。" }, "external_retrieval_model": { "anyOf": [ @@ -18351,7 +18595,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "控制查询此知识库时如何搜索和排序分段。" }, "text": { "default": null, @@ -18415,7 +18660,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "控制查询此知识库时如何搜索和排序分段。" }, "text": { "description": "文档文本内容。", @@ -18474,7 +18720,8 @@ "type": "null" } ], - "default": null + "default": null, + "description": "控制查询此知识库时如何搜索和排序分段。" }, "text": { "anyOf": [ @@ -20107,7 +20354,7 @@ } ], "default": null, - "description": "表单输入的默认值配置。" + "description": "`paragraph` 输入的原始默认值配置。运行时解析后的值位于外层的 `resolved_default_values` 映射中。" }, "output_variable_name": { "type": "string", @@ -21653,7 +21900,7 @@ "$ref": "#/components/schemas/WorkflowBlockingResponse" } ], - "description": "完整的流水线执行结果。当 `response_mode` 为 `blocking` 时返回。" + "description": "已发布运行和使用 `response_mode: blocking` 的草稿运行所返回的 JSON 结果。" }, "PipelineUploadFileResponse": { "properties": { @@ -21931,18 +22178,6 @@ ], "type": "object" }, - "RequiredServiceApiUserPayload": { - "properties": { - "user": { - "description": "由你的应用定义且在应用内唯一的终端用户标识。", - "type": "string" - } - }, - "required": [ - "user" - ], - "type": "object" - }, "RerankingModel": { "properties": { "reranking_model_name": { @@ -24720,6 +24955,30 @@ "workflow_id" ], "type": "object" + }, + "ScopedTaskStopPayload": { + "properties": { + "user": { + "type": "string", + "description": "终端用户标识,由你的应用定义并在应用内保持唯一。请传入与原始生成请求相同的 `user` 值。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" + } + }, + "required": [ + "user" + ], + "type": "object" + }, + "WorkflowTaskStopPayload": { + "properties": { + "user": { + "type": "string", + "description": "终端用户标识,由你的应用定义并在应用内保持唯一。无需与启动该运行的 `user` 相同;无论 `user` 为何,停止操作都会作用于该任务。参见 [终端用户身份](/zh/api-reference/guides/end-user-identity)。" + } + }, + "required": [ + "user" + ], + "type": "object" } } }