mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-04-20 12:49:43 +08:00
fix ChatCompletionResponse docs (#17534)
Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
This commit is contained in:
parent
8ab9eb9857
commit
01704a4c1b
@ -88,6 +88,9 @@ Chat applications support session persistence, allowing previous chat history to
|
|||||||
|
|
||||||
### ChatCompletionResponse
|
### ChatCompletionResponse
|
||||||
Returns the complete App result, `Content-Type` is `application/json`.
|
Returns the complete App result, `Content-Type` is `application/json`.
|
||||||
|
- `event` (string) Event type, fixed to `message`
|
||||||
|
- `task_id` (string) Task ID, used for request tracking and the below Stop Generate API
|
||||||
|
- `id` (string) unique ID
|
||||||
- `message_id` (string) Unique message ID
|
- `message_id` (string) Unique message ID
|
||||||
- `conversation_id` (string) Conversation ID
|
- `conversation_id` (string) Conversation ID
|
||||||
- `mode` (string) App mode, fixed as `chat`
|
- `mode` (string) App mode, fixed as `chat`
|
||||||
@ -243,6 +246,8 @@ Chat applications support session persistence, allowing previous chat history to
|
|||||||
```json {{ title: 'Response' }}
|
```json {{ title: 'Response' }}
|
||||||
{
|
{
|
||||||
"event": "message",
|
"event": "message",
|
||||||
|
"task_id": "c3800678-a077-43df-a102-53f23ed20b88",
|
||||||
|
"id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
|
@ -88,6 +88,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
|
|||||||
|
|
||||||
### ChatCompletionResponse
|
### ChatCompletionResponse
|
||||||
完全なアプリ結果を返します。`Content-Type`は`application/json`です。
|
完全なアプリ結果を返します。`Content-Type`は`application/json`です。
|
||||||
|
- `event` (string) イベントタイプ、固定で `message`
|
||||||
|
- `task_id` (string) タスクID、リクエスト追跡と以下のStop Generate APIに使用
|
||||||
|
- `id` (string) ユニークID
|
||||||
- `message_id` (string) 一意のメッセージID
|
- `message_id` (string) 一意のメッセージID
|
||||||
- `conversation_id` (string) 会話ID
|
- `conversation_id` (string) 会話ID
|
||||||
- `mode` (string) アプリモード、`chat`として固定
|
- `mode` (string) アプリモード、`chat`として固定
|
||||||
@ -243,6 +246,8 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
|
|||||||
```json {{ title: '応答' }}
|
```json {{ title: '応答' }}
|
||||||
{
|
{
|
||||||
"event": "message",
|
"event": "message",
|
||||||
|
"task_id": "c3800678-a077-43df-a102-53f23ed20b88",
|
||||||
|
"id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
|
@ -88,6 +88,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
|||||||
### ChatCompletionResponse
|
### ChatCompletionResponse
|
||||||
|
|
||||||
返回完整的 App 结果,`Content-Type` 为 `application/json`。
|
返回完整的 App 结果,`Content-Type` 为 `application/json`。
|
||||||
|
- `event` (string) 事件类型,固定为 `message`
|
||||||
|
- `task_id` (string) 任务 ID,用于请求跟踪和下方的停止响应接口
|
||||||
|
- `id` (string) 唯一ID
|
||||||
- `message_id` (string) 消息唯一 ID
|
- `message_id` (string) 消息唯一 ID
|
||||||
- `conversation_id` (string) 会话 ID
|
- `conversation_id` (string) 会话 ID
|
||||||
- `mode` (string) App 模式,固定为 chat
|
- `mode` (string) App 模式,固定为 chat
|
||||||
@ -253,6 +256,8 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
|||||||
```json {{ title: 'Response' }}
|
```json {{ title: 'Response' }}
|
||||||
{
|
{
|
||||||
"event": "message",
|
"event": "message",
|
||||||
|
"task_id": "c3800678-a077-43df-a102-53f23ed20b88",
|
||||||
|
"id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
|
@ -82,6 +82,9 @@ Chat applications support session persistence, allowing previous chat history to
|
|||||||
|
|
||||||
### ChatCompletionResponse
|
### ChatCompletionResponse
|
||||||
Returns the complete App result, `Content-Type` is `application/json`.
|
Returns the complete App result, `Content-Type` is `application/json`.
|
||||||
|
- `event` (string) 事件类型,固定为 `message`
|
||||||
|
- `task_id` (string) 任务 ID,用于请求跟踪和下方的停止响应接口
|
||||||
|
- `id` (string) 唯一ID
|
||||||
- `message_id` (string) Unique message ID
|
- `message_id` (string) Unique message ID
|
||||||
- `conversation_id` (string) Conversation ID
|
- `conversation_id` (string) Conversation ID
|
||||||
- `mode` (string) App mode, fixed as `chat`
|
- `mode` (string) App mode, fixed as `chat`
|
||||||
@ -197,6 +200,8 @@ Chat applications support session persistence, allowing previous chat history to
|
|||||||
```json {{ title: 'Response' }}
|
```json {{ title: 'Response' }}
|
||||||
{
|
{
|
||||||
"event": "message",
|
"event": "message",
|
||||||
|
"task_id": "c3800678-a077-43df-a102-53f23ed20b88",
|
||||||
|
"id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
|
@ -82,6 +82,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
|
|||||||
|
|
||||||
### ChatCompletionResponse
|
### ChatCompletionResponse
|
||||||
完全なアプリ結果を返します。`Content-Type`は`application/json`です。
|
完全なアプリ結果を返します。`Content-Type`は`application/json`です。
|
||||||
|
- `event` (string) イベントタイプ、固定で `message`
|
||||||
|
- `task_id` (string) タスクID、リクエスト追跡と以下のStop Generate APIに使用
|
||||||
|
- `id` (string) ユニークID
|
||||||
- `message_id` (string) 一意のメッセージID
|
- `message_id` (string) 一意のメッセージID
|
||||||
- `conversation_id` (string) 会話ID
|
- `conversation_id` (string) 会話ID
|
||||||
- `mode` (string) アプリモード、`chat`として固定
|
- `mode` (string) アプリモード、`chat`として固定
|
||||||
@ -197,6 +200,8 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
|
|||||||
```json {{ title: '応答' }}
|
```json {{ title: '応答' }}
|
||||||
{
|
{
|
||||||
"event": "message",
|
"event": "message",
|
||||||
|
"task_id": "c3800678-a077-43df-a102-53f23ed20b88",
|
||||||
|
"id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
|
@ -83,6 +83,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
|||||||
### ChatCompletionResponse
|
### ChatCompletionResponse
|
||||||
|
|
||||||
返回完整的 App 结果,`Content-Type` 为 `application/json`。
|
返回完整的 App 结果,`Content-Type` 为 `application/json`。
|
||||||
|
- `event` (string) 事件类型,固定为 `message`
|
||||||
|
- `task_id` (string) 任务 ID,用于请求跟踪和下方的停止响应接口
|
||||||
|
- `id` (string) 唯一ID
|
||||||
- `message_id` (string) 消息唯一 ID
|
- `message_id` (string) 消息唯一 ID
|
||||||
- `conversation_id` (string) 会话 ID
|
- `conversation_id` (string) 会话 ID
|
||||||
- `mode` (string) App 模式,固定为 chat
|
- `mode` (string) App 模式,固定为 chat
|
||||||
@ -91,7 +94,6 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
|||||||
- `usage` (Usage) 模型用量信息
|
- `usage` (Usage) 模型用量信息
|
||||||
- `retriever_resources` (array[RetrieverResource]) 引用和归属分段列表
|
- `retriever_resources` (array[RetrieverResource]) 引用和归属分段列表
|
||||||
- `created_at` (int) 消息创建时间戳,如:1705395332
|
- `created_at` (int) 消息创建时间戳,如:1705395332
|
||||||
|
|
||||||
### ChunkChatCompletionResponse
|
### ChunkChatCompletionResponse
|
||||||
返回 App 输出的流式块,`Content-Type` 为 `text/event-stream`。
|
返回 App 输出的流式块,`Content-Type` 为 `text/event-stream`。
|
||||||
每个流式块均为 data: 开头,块之间以 \n\n 即两个换行符分隔,如下所示:
|
每个流式块均为 data: 开头,块之间以 \n\n 即两个换行符分隔,如下所示:
|
||||||
@ -210,6 +212,8 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
|||||||
```json {{ title: 'Response' }}
|
```json {{ title: 'Response' }}
|
||||||
{
|
{
|
||||||
"event": "message",
|
"event": "message",
|
||||||
|
"task_id": "c3800678-a077-43df-a102-53f23ed20b88",
|
||||||
|
"id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
|
||||||
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user