Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
714ff3c6
Unverified
Commit
714ff3c6
authored
Feb 05, 2024
by
Joel
Committed by
GitHub
Feb 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: error stop response api url in text generation and uniform url (#2394)
parent
f5c08070
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
92 deletions
+29
-92
template.en.mdx
web/app/components/develop/template/template.en.mdx
+6
-6
template.zh.mdx
web/app/components/develop/template/template.zh.mdx
+6
-6
template_chat.en.mdx
web/app/components/develop/template/template_chat.en.mdx
+8
-8
template_chat.zh.mdx
web/app/components/develop/template/template_chat.zh.mdx
+9
-72
No files found.
web/app/components/develop/template/template.en.mdx
View file @
714ff3c6
...
...
@@ -271,7 +271,7 @@ The text generation application offers non-session support and is ideal for tran
---
<Heading
url='/c
hat
-messages/:task_id/stop'
url='/c
ompletion
-messages/:task_id/stop'
method='POST'
title='Stop Generate'
name='#stop-generatebacks'
...
...
@@ -289,9 +289,9 @@ The text generation application offers non-session support and is ideal for tran
</Col>
<Col sticky>
### Request Example
<CodeGroup title="Request" tag="POST" label="/c
hat-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="/c
ompletion-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' }}
curl -X POST 'https://cloud.dify.ai/v1/c
hat
-messages/:task_id/stop' \
curl -X POST 'https://cloud.dify.ai/v1/c
ompletion
-messages/:task_id/stop' \
-H 'Authorization: Bearer {api_key}' \
-H 'Content-Type: application/json' \
--data-raw '{
...
...
@@ -314,7 +314,7 @@ The text generation application offers non-session support and is ideal for tran
---
<Heading
url='/messages/
{message_id}
/feedbacks'
url='/messages/
:message_id
/feedbacks'
method='POST'
title='Message Feedback'
name='#feedbacks'
...
...
@@ -346,10 +346,10 @@ The text generation application offers non-session support and is ideal for tran
</Col>
<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' }}
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 'Content-Type: application/json' \
--data-raw '{
...
...
web/app/components/develop/template/template.zh.mdx
View file @
714ff3c6
...
...
@@ -248,7 +248,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Row>
---
<Heading
url='/c
hat-messages/{task_id}
/stop'
url='/c
ompletion-messages/:task_id
/stop'
method='POST'
title='停止响应'
name='#Stop'
...
...
@@ -266,9 +266,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
- `result` (string) 固定返回 success
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/c
hat-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="/c
ompletion-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' }}
curl -X POST 'https://cloud.dify.ai/v1/c
hat
-messages/:task_id/stop' \
curl -X POST 'https://cloud.dify.ai/v1/c
ompletion
-messages/:task_id/stop' \
-H 'Authorization: Bearer {api_key}' \
-H 'Content-Type: application/json' \
--data-raw '{
...
...
@@ -290,7 +290,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
---
<Heading
url='/messages/
{message_id}
/feedbacks'
url='/messages/
:message_id
/feedbacks'
method='POST'
title='消息反馈(点赞)'
name='#feedbacks'
...
...
@@ -322,10 +322,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col>
<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' }}
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 'Content-Type: application/json' \
--data-raw '{
...
...
web/app/components/develop/template/template_chat.en.mdx
View file @
714ff3c6
...
...
@@ -369,7 +369,7 @@ Chat applications support session persistence, allowing previous chat history to
---
<Heading
url='/messages/
{message_id}
/feedbacks'
url='/messages/
:message_id
/feedbacks'
method='POST'
title='Message Feedback'
name='#feedbacks'
...
...
@@ -401,10 +401,10 @@ Chat applications support session persistence, allowing previous chat history to
</Col>
<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' }}
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 'Content-Type: application/json' \
--data-raw '{
...
...
@@ -675,7 +675,7 @@ Chat applications support session persistence, allowing previous chat history to
---
<Heading
url='/conversations/
{conversation_id}
'
url='/conversations/
:conversation_id
'
method='DELETE'
title='Delete Conversation'
name='#delete'
...
...
@@ -700,7 +700,7 @@ Chat applications support session persistence, allowing previous chat history to
</Col>
<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' }}
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
---
<Heading
url='/conversations/
{conversation_id}
/name'
url='/conversations/
:conversation_id
/name'
method='POST'
title='Conversation Rename'
name='#rename'
...
...
@@ -756,10 +756,10 @@ Chat applications support session persistence, allowing previous chat history to
</Col>
<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' }}
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 'Authorization: Bearer {api_key}' \
--data-raw '{
...
...
web/app/components/develop/template/template_chat.zh.mdx
View file @
714ff3c6
...
...
@@ -342,7 +342,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Row>
---
<Heading
url='/chat-messages/
{task_id}
/stop'
url='/chat-messages/
:task_id
/stop'
method='POST'
title='停止响应'
name='#Stop'
...
...
@@ -384,7 +384,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
---
<Heading
url='/messages/
{message_id}
/feedbacks'
url='/messages/
:message_id
/feedbacks'
method='POST'
title='消息反馈(点赞)'
name='#feedbacks'
...
...
@@ -416,10 +416,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col>
<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' }}
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 'Content-Type: application/json' \
--data-raw '{
...
...
@@ -608,69 +608,6 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col>
</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
...
...
@@ -751,7 +688,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
---
<Heading
url='/conversations/
{conversation_id}
'
url='/conversations/
:conversation_id
'
method='DELETE'
title='删除会话'
name='#delete'
...
...
@@ -776,7 +713,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col>
<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' }}
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'
---
<Heading
url='/conversations/
{conversation_id}
/name'
url='/conversations/
:conversation_id
/name'
method='POST'
title='会话重命名'
name='#rename'
...
...
@@ -835,10 +772,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col>
<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' }}
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 'Content-Type: application/json' \
--data-raw '{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment