Unverified Commit 714ff3c6 authored by Joel's avatar Joel Committed by GitHub

fix: error stop response api url in text generation and uniform url (#2394)

parent f5c08070
...@@ -271,7 +271,7 @@ The text generation application offers non-session support and is ideal for tran ...@@ -271,7 +271,7 @@ The text generation application offers non-session support and is ideal for tran
--- ---
<Heading <Heading
url='/chat-messages/:task_id/stop' url='/completion-messages/:task_id/stop'
method='POST' method='POST'
title='Stop Generate' title='Stop Generate'
name='#stop-generatebacks' name='#stop-generatebacks'
...@@ -289,9 +289,9 @@ The text generation application offers non-session support and is ideal for tran ...@@ -289,9 +289,9 @@ The text generation application offers non-session support and is ideal for tran
</Col> </Col>
<Col sticky> <Col sticky>
### Request Example ### Request Example
<CodeGroup title="Request" tag="POST" label="/chat-messages/:task_id/stop" targetCode={`curl -X POST 'https://cloud.dify.ai/v1/chat-messages/:task_id/stop' \\\n-H 'Authorization: Bearer {api_key}' \\\n-H 'Content-Type: application/json' \\\n--data-raw '{ "user": "abc-123"}`}> <CodeGroup title="Request" tag="POST" label="/completion-messages/:task_id/stop" targetCode={`curl -X POST 'https://cloud.dify.ai/v1/completion-messages/:task_id/stop' \\\n-H 'Authorization: Bearer {api_key}' \\\n-H 'Content-Type: application/json' \\\n--data-raw '{ "user": "abc-123"}`}>
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X POST 'https://cloud.dify.ai/v1/chat-messages/:task_id/stop' \ curl -X POST 'https://cloud.dify.ai/v1/completion-messages/:task_id/stop' \
-H 'Authorization: Bearer {api_key}' \ -H 'Authorization: Bearer {api_key}' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
...@@ -314,7 +314,7 @@ The text generation application offers non-session support and is ideal for tran ...@@ -314,7 +314,7 @@ The text generation application offers non-session support and is ideal for tran
--- ---
<Heading <Heading
url='/messages/{message_id}/feedbacks' url='/messages/:message_id/feedbacks'
method='POST' method='POST'
title='Message Feedback' title='Message Feedback'
name='#feedbacks' name='#feedbacks'
...@@ -346,10 +346,10 @@ The text generation application offers non-session support and is ideal for tran ...@@ -346,10 +346,10 @@ 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="/messages/{message_id}/feedbacks" targetCode={`curl -X POST '${props.appDetail.api_base_url}/messages/{message_id}/feedbacks \\\n --header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "rating": "like",\n "user": "abc-123"\n}'`}> <CodeGroup title="Request" tag="POST" label="/messages/:message_id/feedbacks" targetCode={`curl -X POST '${props.appDetail.api_base_url}/messages/:message_id/feedbacks \\\n --header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "rating": "like",\n "user": "abc-123"\n}'`}>
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/messages/{message_id}/feedbacks' \ curl -X POST '${props.appDetail.api_base_url}/messages/:message_id/feedbacks' \
--header 'Authorization: Bearer {api_key}' \ --header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
......
...@@ -248,7 +248,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -248,7 +248,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Row> </Row>
--- ---
<Heading <Heading
url='/chat-messages/{task_id}/stop' url='/completion-messages/:task_id/stop'
method='POST' method='POST'
title='停止响应' title='停止响应'
name='#Stop' name='#Stop'
...@@ -266,9 +266,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -266,9 +266,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
- `result` (string) 固定返回 success - `result` (string) 固定返回 success
</Col> </Col>
<Col sticky> <Col sticky>
<CodeGroup title="Request" tag="POST" label="/chat-messages/:task_id/stop" targetCode={`curl -X POST 'https://cloud.dify.ai/v1/chat-messages/:task_id/stop' \\\n-H 'Authorization: Bearer {api_key}' \\\n-H 'Content-Type: application/json' \\\n--data-raw '{ "user": "abc-123"}`}> <CodeGroup title="Request" tag="POST" label="/completion-messages/:task_id/stop" targetCode={`curl -X POST 'https://cloud.dify.ai/v1/completion-messages/:task_id/stop' \\\n-H 'Authorization: Bearer {api_key}' \\\n-H 'Content-Type: application/json' \\\n--data-raw '{ "user": "abc-123"}`}>
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X POST 'https://cloud.dify.ai/v1/chat-messages/:task_id/stop' \ curl -X POST 'https://cloud.dify.ai/v1/completion-messages/:task_id/stop' \
-H 'Authorization: Bearer {api_key}' \ -H 'Authorization: Bearer {api_key}' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
...@@ -290,7 +290,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -290,7 +290,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
--- ---
<Heading <Heading
url='/messages/{message_id}/feedbacks' url='/messages/:message_id/feedbacks'
method='POST' method='POST'
title='消息反馈(点赞)' title='消息反馈(点赞)'
name='#feedbacks' name='#feedbacks'
...@@ -322,10 +322,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -322,10 +322,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col> </Col>
<Col sticky> <Col sticky>
<CodeGroup title="Request" tag="POST" label="/messages/{message_id}/feedbacks" targetCode={`curl -X POST '${props.appDetail.api_base_url}/messages/{message_id}/feedbacks \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "rating": "like",\n "user": "abc-123"\n}'`}> <CodeGroup title="Request" tag="POST" label="/messages/:message_id/feedbacks" targetCode={`curl -X POST '${props.appDetail.api_base_url}/messages/:message_id/feedbacks \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "rating": "like",\n "user": "abc-123"\n}'`}>
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/messages/{message_id}/feedbacks' \ curl -X POST '${props.appDetail.api_base_url}/messages/:message_id/feedbacks' \
--header 'Authorization: Bearer {api_key}' \ --header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
......
...@@ -369,7 +369,7 @@ Chat applications support session persistence, allowing previous chat history to ...@@ -369,7 +369,7 @@ Chat applications support session persistence, allowing previous chat history to
--- ---
<Heading <Heading
url='/messages/{message_id}/feedbacks' url='/messages/:message_id/feedbacks'
method='POST' method='POST'
title='Message Feedback' title='Message Feedback'
name='#feedbacks' name='#feedbacks'
...@@ -401,10 +401,10 @@ Chat applications support session persistence, allowing previous chat history to ...@@ -401,10 +401,10 @@ Chat applications support session persistence, allowing previous chat history to
</Col> </Col>
<Col sticky> <Col sticky>
<CodeGroup title="Request" tag="POST" label="/messages/{message_id}/feedbacks" targetCode={`curl -X POST '${props.appDetail.api_base_url}/messages/{message_id}/feedbacks \\\n --header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "rating": "like",\n "user": "abc-123"\n}'`}> <CodeGroup title="Request" tag="POST" label="/messages/:message_id/feedbacks" targetCode={`curl -X POST '${props.appDetail.api_base_url}/messages/:message_id/feedbacks \\\n --header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "rating": "like",\n "user": "abc-123"\n}'`}>
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/messages/{message_id}/feedbacks' \ curl -X POST '${props.appDetail.api_base_url}/messages/:message_id/feedbacks' \
--header 'Authorization: Bearer {api_key}' \ --header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
...@@ -675,7 +675,7 @@ Chat applications support session persistence, allowing previous chat history to ...@@ -675,7 +675,7 @@ Chat applications support session persistence, allowing previous chat history to
--- ---
<Heading <Heading
url='/conversations/{conversation_id}' url='/conversations/:conversation_id'
method='DELETE' method='DELETE'
title='Delete Conversation' title='Delete Conversation'
name='#delete' name='#delete'
...@@ -700,7 +700,7 @@ Chat applications support session persistence, allowing previous chat history to ...@@ -700,7 +700,7 @@ Chat applications support session persistence, allowing previous chat history to
</Col> </Col>
<Col sticky> <Col sticky>
<CodeGroup title="Request" tag="DELETE" label="/conversations/{conversation_id}" targetCode={`curl -X DELETE '${props.appDetail.api_base_url}/conversations/{conversation_id}' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "user": "abc-123"\n}'`}> <CodeGroup title="Request" tag="DELETE" label="/conversations/:conversation_id" targetCode={`curl -X DELETE '${props.appDetail.api_base_url}/conversations/:conversation_id' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "user": "abc-123"\n}'`}>
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X DELETE '${props.appDetail.api_base_url}/conversations/{convsation_id}' \ curl -X DELETE '${props.appDetail.api_base_url}/conversations/{convsation_id}' \
...@@ -726,7 +726,7 @@ Chat applications support session persistence, allowing previous chat history to ...@@ -726,7 +726,7 @@ Chat applications support session persistence, allowing previous chat history to
--- ---
<Heading <Heading
url='/conversations/{conversation_id}/name' url='/conversations/:conversation_id/name'
method='POST' method='POST'
title='Conversation Rename' title='Conversation Rename'
name='#rename' name='#rename'
...@@ -756,10 +756,10 @@ Chat applications support session persistence, allowing previous chat history to ...@@ -756,10 +756,10 @@ Chat applications support session persistence, allowing previous chat history to
</Col> </Col>
<Col sticky> <Col sticky>
<CodeGroup title="Request" tag="POST" label="/conversations/{conversation_id}/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "user": "abc-123"\n}'`}> <CodeGroup title="Request" tag="POST" label="/conversations/:conversation_id/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "user": "abc-123"\n}'`}>
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \ --header 'Authorization: Bearer {api_key}' \
--data-raw '{ --data-raw '{
......
...@@ -342,7 +342,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -342,7 +342,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Row> </Row>
--- ---
<Heading <Heading
url='/chat-messages/{task_id}/stop' url='/chat-messages/:task_id/stop'
method='POST' method='POST'
title='停止响应' title='停止响应'
name='#Stop' name='#Stop'
...@@ -384,7 +384,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -384,7 +384,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
--- ---
<Heading <Heading
url='/messages/{message_id}/feedbacks' url='/messages/:message_id/feedbacks'
method='POST' method='POST'
title='消息反馈(点赞)' title='消息反馈(点赞)'
name='#feedbacks' name='#feedbacks'
...@@ -416,10 +416,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -416,10 +416,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col> </Col>
<Col sticky> <Col sticky>
<CodeGroup title="Request" tag="POST" label="/messages/{message_id}/feedbacks" targetCode={`curl -X POST '${props.appDetail.api_base_url}/messages/{message_id}/feedbacks \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "rating": "like",\n "user": "abc-123"\n}'`}> <CodeGroup title="Request" tag="POST" label="/messages/:message_id/feedbacks" targetCode={`curl -X POST '${props.appDetail.api_base_url}/messages/:message_id/feedbacks \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "rating": "like",\n "user": "abc-123"\n}'`}>
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/messages/{message_id}/feedbacks' \ curl -X POST '${props.appDetail.api_base_url}/messages/:message_id/feedbacks' \
--header 'Authorization: Bearer {api_key}' \ --header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
...@@ -608,69 +608,6 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -608,69 +608,6 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col> </Col>
</Row> </Row>
---
<Heading
url='/conversations'
method='GET'
title='获取会话列表'
name='#conversations'
/>
<Row>
<Col>
获取当前用户的会话列表,默认返回最近的 20 条。
### Query
<Properties>
<Property name='last_id' type='string' key='last_id'>
当前页最后面一条记录的 ID,默认 none
</Property>
<Property name='limit' type='int' key='limit'>
一次请求返回多少条记录
</Property>
<Property name='user' type='string' key='user'>
用户标识,由开发者定义规则,需保证用户标识在应用内唯一。
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="GET" label="/conversations" targetCode={`curl -X GET '${props.appDetail.api_base_url}/conversations?user=abc-123&last_id=&limit=20'\\\n--header 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/conversations?user=abc-123&last_id=&limit=20' \
--header 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"limit": 20,
"has_more": false,
"data": [
{
"id": "10799fb8-64f7-4296-bbf7-b42bfbe0ae54",
"name": "New chat",
"inputs": {
"book": "book",
"myName": "Lucy"
},
"status": "normal",
"created_at": 1679667915
},
{
"id": "hSIhXBhNe8X1d8Et"
// ...
}
]
}
```
</CodeGroup>
</Col>
</Row>
--- ---
<Heading <Heading
...@@ -751,7 +688,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -751,7 +688,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
--- ---
<Heading <Heading
url='/conversations/{conversation_id}' url='/conversations/:conversation_id'
method='DELETE' method='DELETE'
title='删除会话' title='删除会话'
name='#delete' name='#delete'
...@@ -776,7 +713,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -776,7 +713,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col> </Col>
<Col sticky> <Col sticky>
<CodeGroup title="Request" tag="DELETE" label="/conversations/{conversation_id}" targetCode={`curl -X DELETE '${props.appDetail.api_base_url}/conversations/{conversation_id}' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "user": "abc-123"\n}'`}> <CodeGroup title="Request" tag="DELETE" label="/conversations/:conversation_id" targetCode={`curl -X DELETE '${props.appDetail.api_base_url}/conversations/:conversation_id' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "user": "abc-123"\n}'`}>
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X DELETE '${props.appDetail.api_base_url}/conversations/{convsation_id}' \ curl -X DELETE '${props.appDetail.api_base_url}/conversations/{convsation_id}' \
...@@ -803,7 +740,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -803,7 +740,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
--- ---
<Heading <Heading
url='/conversations/{conversation_id}/name' url='/conversations/:conversation_id/name'
method='POST' method='POST'
title='会话重命名' title='会话重命名'
name='#rename' name='#rename'
...@@ -835,10 +772,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -835,10 +772,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col> </Col>
<Col sticky> <Col sticky>
<CodeGroup title="Request" tag="POST" label="/conversations/{conversation_id}/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "user": "abc-123"\n}'`}> <CodeGroup title="Request" tag="POST" label="/conversations/:conversation_id/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "user": "abc-123"\n}'`}>
```bash {{ title: 'cURL' }} ```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \
--header 'Authorization: Bearer {api_key}' \ --header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment