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
a722536f
Commit
a722536f
authored
Jul 12, 2023
by
crazywoola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add docs
parent
16424d42
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
1 deletion
+94
-1
conversation.py
api/controllers/service_api/app/conversation.py
+1
-1
template_chat.en.mdx
web/app/components/develop/template/template_chat.en.mdx
+47
-0
template_chat.zh.mdx
web/app/components/develop/template/template_chat.zh.mdx
+46
-0
No files found.
api/controllers/service_api/app/conversation.py
View file @
a722536f
...
...
@@ -64,7 +64,7 @@ class ConversationDetailApi(AppApiResource):
try
:
ConversationService
.
delete
(
app_model
,
conversation_id
,
end_user
)
return
{
"result"
:
"success"
}
,
204
return
{
"result"
:
"success"
}
except
services
.
errors
.
conversation
.
ConversationNotExistsError
:
raise
NotFound
(
"Conversation Not Exists."
)
...
...
web/app/components/develop/template/template_chat.en.mdx
View file @
a722536f
...
...
@@ -334,6 +334,53 @@ For versatile conversational apps using a Q&A format, call the chat-messages API
</Row>
---
<Heading
url='/conversations/{converation_id}'
method='DELETE'
title='Conversation deletion'
name='#delete'
/>
<Row>
<Col>
Delete conversation.
### Request Body
<Properties>
<Property name='user' type='string' key='user'>
The user identifier, defined by the developer, must ensure uniqueness within the app.
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="DELETE" label="/conversations/{converation_id}" targetCode={`curl --location --request POST '${props.appDetail.api_base_url}/conversations/{conversation_id}' \\\n--header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "user": "abc-123"\n}'`}>
```bash {{ title: 'cURL' }}
curl --location --request DELETE 'https://cloud.langgenius.dev/api/conversations/{convsation_id}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \
--data '{
"user": "abc-123"
}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"result": "success"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading
...
...
web/app/components/develop/template/template_chat.zh.mdx
View file @
a722536f
...
...
@@ -333,6 +333,52 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Col>
</Row>
---
<Heading
url='/conversations/{converation_id}'
method='DELETE'
title='删除会话'
name='#delete'
/>
<Row>
<Col>
删除会话。
### Request Body
<Properties>
<Property name='user' type='string' key='user'>
用户标识,由开发者定义规则,需保证用户标识在应用内唯一。
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="DELETE" label="/conversations/{converation_id}" targetCode={`curl --location --request POST '${props.appDetail.api_base_url}/conversations/{conversation_id}' \\\n--header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "user": "abc-123"\n}'`}>
```bash {{ title: 'cURL' }}
curl --location --request DELETE 'https://cloud.langgenius.dev/api/conversations/{convsation_id}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \
--data '{
"user": "abc-123"
}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"result": "success"
}
```
</CodeGroup>
</Col>
</Row>
---
...
...
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