应用发布后的会话接口
发布后的会话接口是直接服务用户的核心部分
application/json
Request Body required
action enum required
聊天的操作类型。
content string required
用户输入的内容。
conversation_id string
聊天的对话ID。
release_key string required
发布应用的密钥。
stream boolean
是否为流模式对话
Responses
- 200
- default
OK
application/json
Schema
Example (from schema)
Schema
conversation_id string
对话ID
seq int32
对话中的序列号
message string
非流式请求生成的响应内容
delta string
流式请求生成的响应内容
finish_reason enum
停止生成的原因
knowledge_base_results object[]
history_id string
聊天历史ID
prompt_questions string[]
用户下一个问题的提示
{
"conversation_id": "string",
"seq": 0,
"message": "string",
"delta": "string",
"finish_reason": 0,
"knowledge_base_results": [
{
"page_content": "string",
"document": {
"document_id": "string",
"display_name": "string",
"type": 0,
"document_size": 0,
"token_count": 0,
"segment_count": 0,
"dataset_id": "string",
"dataset_display": "string",
"p_id": "string",
"data_source_type": 0,
"creator": "string",
"create_time": "2025-04-11T06:11:38.495Z",
"update_time": "2025-04-11T06:11:38.495Z",
"segments": [
{
"segment_id": "string",
"dataset_id": "string",
"document_id": "string",
"content": "string",
"token_count": 0,
"number": 0,
"metadata": {
"key_words": [
"string"
],
"image_name_value": "string",
"image_size": 0,
"table_name_value": "string",
"table_rows": 0,
"table_columns": [
"string"
],
"score": 0
},
"words": 0,
"segment_type": 0,
"table_content": "string",
"image_key": "string",
"image_uri": "string",
"display_type": 0,
"image_keys": "string",
"display_content": "string"
}
],
"uri": "string"
},
"confidence": 0,
"token_count": 0,
"segment_number": 0,
"words": 0,
"type": 0,
"display_type": 0,
"table_content": "string",
"image_uri": "string",
"image_key": "string",
"image_keys": [
"string"
],
"display_content": "string"
}
],
"history_id": "string",
"prompt_questions": [
"string"
]
}
Default error response
application/json
Schema
Example (from schema)
Schema
code int32
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
message string
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
POST /v1/release:chat
Authorization
name: bearerAuthtype: httpscheme: bearer
Request
Request
curl / cURL
curl -L -X POST 'https://aidmp.cn-sh-01.sensecoreapi.cn/studio/rag/data/v1/release:chat' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"action": 0,
"content": "string",
"conversation_id": "string",
"release_key": "string",
"stream": true
}'
python / requests
curl -L -X POST 'https://aidmp.cn-sh-01.sensecoreapi.cn/studio/rag/data/v1/release:chat' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"action": 0,
"content": "string",
"conversation_id": "string",
"release_key": "string",
"stream": true
}'
go / native
curl -L -X POST 'https://aidmp.cn-sh-01.sensecoreapi.cn/studio/rag/data/v1/release:chat' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"action": 0,
"content": "string",
"conversation_id": "string",
"release_key": "string",
"stream": true
}'
nodejs / axios
curl -L -X POST 'https://aidmp.cn-sh-01.sensecoreapi.cn/studio/rag/data/v1/release:chat' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"action": 0,
"content": "string",
"conversation_id": "string",
"release_key": "string",
"stream": true
}'
ruby / Net::HTTP
curl -L -X POST 'https://aidmp.cn-sh-01.sensecoreapi.cn/studio/rag/data/v1/release:chat' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"action": 0,
"content": "string",
"conversation_id": "string",
"release_key": "string",
"stream": true
}'
csharp / RestSharp
curl -L -X POST 'https://aidmp.cn-sh-01.sensecoreapi.cn/studio/rag/data/v1/release:chat' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"action": 0,
"content": "string",
"conversation_id": "string",
"release_key": "string",
"stream": true
}'
php / cURL
curl -L -X POST 'https://aidmp.cn-sh-01.sensecoreapi.cn/studio/rag/data/v1/release:chat' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"action": 0,
"content": "string",
"conversation_id": "string",
"release_key": "string",
"stream": true
}'
java / OkHttp
curl -L -X POST 'https://aidmp.cn-sh-01.sensecoreapi.cn/studio/rag/data/v1/release:chat' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"action": 0,
"content": "string",
"conversation_id": "string",
"release_key": "string",
"stream": true
}'
powershell / RestMethod
curl -L -X POST 'https://aidmp.cn-sh-01.sensecoreapi.cn/studio/rag/data/v1/release:chat' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"action": 0,
"content": "string",
"conversation_id": "string",
"release_key": "string",
"stream": true
}'