mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 12:25:57 +08:00
fix: doc for completion-messages (#2820)
This commit is contained in:
parent
8b15b742ad
commit
1f92b55f58
@ -42,13 +42,13 @@ The text generation application offers non-session support and is ideal for tran
|
|||||||
### Request Body
|
### Request Body
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name='query' type='string' key='query'>
|
|
||||||
User Input/Question content
|
|
||||||
</Property>
|
|
||||||
<Property name='inputs' type='object' key='inputs'>
|
<Property name='inputs' type='object' key='inputs'>
|
||||||
Allows the entry of various variable values defined by the App.
|
Allows the entry of various variable values defined by the App.
|
||||||
The `inputs` parameter contains multiple key/value pairs, with each key corresponding to a specific variable and each value being the specific value for that variable.
|
The `inputs` parameter contains multiple key/value pairs, with each key corresponding to a specific variable and each value being the specific value for that variable.
|
||||||
The text generation application requires at least one key/value pair to be inputted.
|
The text generation application requires at least one key/value pair to be inputted.
|
||||||
|
- `query` (string) Required
|
||||||
|
The input text, the content to be processed.
|
||||||
</Property>
|
</Property>
|
||||||
<Property name='response_mode' type='string' key='response_mode'>
|
<Property name='response_mode' type='string' key='response_mode'>
|
||||||
The mode of response return, supporting:
|
The mode of response return, supporting:
|
||||||
@ -138,14 +138,16 @@ The text generation application offers non-session support and is ideal for tran
|
|||||||
</Col>
|
</Col>
|
||||||
<Col sticky>
|
<Col sticky>
|
||||||
|
|
||||||
<CodeGroup title="Request" tag="POST" label="/completion-messages" targetCode={`curl -X POST '${props.appDetail.api_base_url}/completion-messages' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "inputs": ${JSON.stringify(props.inputs)},\n "response_mode": "streaming"\n "user": "abc-123"\n}'\n`}>
|
<CodeGroup title="Request" tag="POST" label="/completion-messages" targetCode={`curl -X POST '${props.appDetail.api_base_url}/completion-messages' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "inputs": {"query": "Hello, world!"},\n "response_mode": "streaming"\n "user": "abc-123"\n}'\n`}>
|
||||||
|
|
||||||
```bash {{ title: 'cURL' }}
|
```bash {{ title: 'cURL' }}
|
||||||
curl -X POST '${props.appDetail.api_base_url}/completion-messages' \
|
curl -X POST '${props.appDetail.api_base_url}/completion-messages' \
|
||||||
--header 'Authorization: Bearer {api_key}' \
|
--header 'Authorization: Bearer {api_key}' \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
--data-raw '{
|
--data-raw '{
|
||||||
"inputs": {},
|
"inputs": {
|
||||||
|
"query": "Hello, world!"
|
||||||
|
},
|
||||||
"response_mode": "streaming",
|
"response_mode": "streaming",
|
||||||
"user": "abc-123"
|
"user": "abc-123"
|
||||||
}'
|
}'
|
||||||
|
@ -41,13 +41,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
|||||||
### Request Body
|
### Request Body
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name='query' type='string' key='query'>
|
|
||||||
用户输入/提问内容。
|
|
||||||
</Property>
|
|
||||||
<Property name='inputs' type='object' key='inputs'>
|
<Property name='inputs' type='object' key='inputs'>
|
||||||
(选填)允许传入 App 定义的各变量值。
|
(选填)允许传入 App 定义的各变量值。
|
||||||
inputs 参数包含了多组键值对(Key/Value pairs),每组的键对应一个特定变量,每组的值则是该变量的具体值。
|
inputs 参数包含了多组键值对(Key/Value pairs),每组的键对应一个特定变量,每组的值则是该变量的具体值。
|
||||||
文本生成型应用要求至少传入一组键值对。
|
文本生成型应用要求至少传入一组键值对。
|
||||||
|
- `query` (string) 必填
|
||||||
|
用户输入的文本内容。
|
||||||
</Property>
|
</Property>
|
||||||
<Property name='response_mode' type='string' key='response_mode'>
|
<Property name='response_mode' type='string' key='response_mode'>
|
||||||
- `streaming` 流式模式(推荐)。基于 SSE(**[Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)**)实现类似打字机输出方式的流式返回。
|
- `streaming` 流式模式(推荐)。基于 SSE(**[Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)**)实现类似打字机输出方式的流式返回。
|
||||||
@ -140,18 +139,21 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
|||||||
</Col>
|
</Col>
|
||||||
<Col sticky>
|
<Col sticky>
|
||||||
|
|
||||||
<CodeGroup title="Request" tag="POST" label="/completion-messages" targetCode={`curl -X POST '${props.appDetail.api_base_url}/completion-messages' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "inputs": ${JSON.stringify(props.inputs)},\n "response_mode": "streaming",\n "user": "abc-123"\n}'\n`}>
|
<CodeGroup title="Request" tag="POST" label="/completion-messages" targetCode={`curl -X POST '${props.appDetail.api_base_url}/completion-messages' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "inputs": {"query": "Hello, world!"},\n "response_mode": "streaming"\n "user": "abc-123"\n}'\n`}>
|
||||||
|
|
||||||
```bash {{ title: 'cURL' }}
|
```bash {{ title: 'cURL' }}
|
||||||
curl -X POST '${props.appDetail.api_base_url}/completion-messages' \
|
curl -X POST '${props.appDetail.api_base_url}/completion-messages' \
|
||||||
--header 'Authorization: Bearer {api_key}' \
|
--header 'Authorization: Bearer {api_key}' \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
--data-raw '{
|
--data-raw '{
|
||||||
"inputs": {},
|
"inputs": {
|
||||||
|
"query": "Hello, world!"
|
||||||
|
},
|
||||||
"response_mode": "streaming",
|
"response_mode": "streaming",
|
||||||
"user": "abc-123"
|
"user": "abc-123"
|
||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
```
|
||||||
|
|
||||||
</CodeGroup>
|
</CodeGroup>
|
||||||
### blocking
|
### blocking
|
||||||
|
Loading…
x
Reference in New Issue
Block a user