创建对话。
接口说明
用于创建一个站点监控任务
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cms:CreateChat |
none |
*DigitalEmployee
|
无 | 无 |
请求语法
POST /chat HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| body |
object |
否 |
请求结构体 |
|
| digitalEmployeeName |
string |
否 |
数字员工名称 |
test |
| threadId |
string |
否 |
会话线程 ID |
thread_id01 |
| action |
string |
否 |
操作类型: create(默认), reconnect, stop 枚举值:
|
create |
| variables |
object |
否 |
变量列表 |
{ "workspace": "test", "region": "cn-beijing", "project": "test", "language": "zh", "timeZone": "Asia/Shanghai", "timeStamp": "1768893948", "startTime": 1768887171, "endTime": 1768890771, "skill": "trace" } |
| messages |
array<object> |
否 |
消息列表 |
|
|
array<object> |
否 |
消息 |
||
| messageId |
string |
否 |
当前消息唯一标识 |
message_id02 |
| role |
string |
否 |
消息的角色 枚举值:
|
system |
| contents |
array<object> |
否 |
文本或多模态数组 |
|
|
object |
否 |
文本或多模态 |
||
| type |
string |
否 |
内容类型 |
text |
| value |
string |
否 |
内容的值 |
test |
| tools |
array<object> |
否 |
工具调用列表 |
|
|
object |
否 |
工具调用 |
{ "arguments": { "confidence": "high", "intent": "analyser", "is_new_turn": true, "language": "en", "title": "Root Cause of Alert" }, "id": "IntentRecognition", } |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| messages |
array<object> |
消息列表 |
|
|
array<object> |
消息 |
||
| version |
string |
消息版本号 |
v0.1.0 |
| parentCallId |
string |
父节点的调用 ID |
sess_abc123 |
| callId |
string |
当前节点的调用 ID |
call_search_001 |
| role |
string |
消息角色 |
tool |
| seq |
integer |
事件序列号,递增,用于保证事件顺序 |
1 |
| timestamp |
string |
Unix 时间戳(秒) |
1765000005 |
| type |
string |
特殊事件类型(如 done, error, heartbeat) |
done |
| detail |
string |
详细信息(如工具进度描述) |
test |
| contents |
array<object> |
消息内容数组 |
|
|
object |
消息内容 |
{ "append": false, "lastChunk": false, "type": "text", "value": "result output chunk" } |
|
| tools |
array<object> |
工具调用数组 |
|
|
object |
工具调用 |
{ "arguments": { "confidence": "high", "intent": "analyser", "is_new_turn": true, "language": "en", "title": "Root Cause of Alert" }, "id": "IntentRecognition", "name": "IntentRecognition", "status": "start", "toolCallId": "019bc1cb-adad" } |
|
| agents |
array<object> |
智能体列表 |
|
|
object |
智能体 |
{ "callId": "019bc1cb-adad", "id": "analyser", "inputs": [ { "append": false, "lastChunk": false, "type": "text", "value": "Analyze this trace: TraceID=xxx" } ], "name": "analyser", "status": "start" } |
|
| events |
array<object> |
事件列表 |
|
|
object |
事件详细内容 |
{ "payload": { "error": { "code": "TASK_FAILED", "message": "Invalid task parameter", "suggestion": "" }, "statistics": { "duration": 300000 }, "success": false }, "type": "task_finished" } |
|
| artifacts |
array<object> |
产物产出信息 |
|
|
object |
产物明细的结构 |
{ "artifactId": "019bc1cb-9600-703axxx", "name": "sql output", "description": "sql generation task result", "extensions": ["sql_generation_tool", "sql_diagnosis"], "metadata": { "model": "qwen3-coder-plus" }, "parts": [ { "text": "select * from table", "kind": "text" } ] } |
|
| traceId |
string |
跟踪请求全局的标识符 |
21504600000008405622576e3b48 |
| requestId |
string |
请求唯一标识 |
0CEC5375-XXXX-XXXX-XXXX-9A629907C1F0 |
示例
正常返回示例
JSON格式
{
"messages": [
{
"version": "v0.1.0",
"parentCallId": "sess_abc123",
"callId": "call_search_001",
"role": "tool",
"seq": 1,
"timestamp": "1765000005",
"type": "done",
"detail": "test",
"contents": [
{
"append": false,
"lastChunk": false,
"type": "text",
"value": "result output chunk"
}
],
"tools": [
{
"arguments": {
"confidence": "high",
"intent": "analyser",
"is_new_turn": true,
"language": "en",
"title": "Root Cause of Alert"
},
"id": "IntentRecognition",
"name": "IntentRecognition",
"status": "start",
"toolCallId": "019bc1cb-adad"
}
],
"agents": [
{
"callId": "019bc1cb-adad",
"id": "analyser",
"inputs": [
{
"append": false,
"lastChunk": false,
"type": "text",
"value": "Analyze this trace: TraceID=xxx"
}
],
"name": "analyser",
"status": "start"
}
],
"events": [
{
"payload": {
"error": {
"code": "TASK_FAILED",
"message": "Invalid task parameter",
"suggestion": ""
},
"statistics": {
"duration": 300000
},
"success": false
},
"type": "task_finished"
}
],
"artifacts": [
{
"artifactId": "019bc1cb-9600-703axxx",
"name": "sql output",
"description": "sql generation task result",
"extensions": [
"sql_generation_tool",
"sql_diagnosis"
],
"metadata": {
"model": "qwen3-coder-plus"
},
"parts": [
{
"text": "select * from table",
"kind": "text"
}
]
}
]
}
],
"traceId": "21504600000008405622576e3b48",
"requestId": "0CEC5375-XXXX-XXXX-XXXX-9A629907C1F0"
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。