AI Agent
鉴权
签名方式:每个请求用 App Key / Secret 签名。请求头如下:
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
Authorization | string · header | 必填 | OpenAPI 后台 上的账户 Access Token,作为原始 token 传入(不带 Bearer 前缀),并参与签名计算。 |
X-Api-Key | string · header | 必填 | 你的 App Key。 |
X-Timestamp | string · header | 必填 | 请求时间戳,单位秒(Unix 时间)。 |
X-Api-Signature | string · header | 必填 | HMAC-SHA256 签名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。 |
当 发起对话 返回 status = interrupted 时,Agent 正等待你补充信息。通过本接口回传答案,暂停的运行会从中断处继续执行,直到成功、再次中断或失败。
同一轮对话可能发生多次中断:若继续后再次返回 interrupted,按新的 interrupt 重复调用本接口即可。
与发起对话一致,通过请求头 Accept 选择阻塞式 / SSE 流式响应。
请求
路径参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
agent_id | string | 必填 | Agent UID. |
chat_uid | string | 必填 | 被中断会话的 UID。 |
message_id | string | 必填 | 要继续的被中断消息 ID。 |
请求体
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
answers_by_tool_call | object | 必填 | 按工具调用 ID 组织的回答,提供 Agent 所需信息以恢复被中断的运行。 |
响应
响应字段
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
chat_uid | string | 必填 | 会话 UID。 |
message_id | string | 必填 | 消息 ID。 |
status | string | 必填 | 运行状态,如 `succeeded`、`interrupted`。 |
answer | string | 可选 | Agent 的回答文本。 |
references | array | 可选 | 回答引用的参考来源。 |
elapsed_time | number | 可选 | 运行耗时(秒)。 |
响应 JSON 示例
{
"code": 0,
"message": "success",
"data": {
"chat_uid": "ct_9f2c1a5b",
"message_id": "43",
"status": "succeeded",
"answer": "Over the past month, Tesla (TSLA.US)...",
"references": [],
"elapsed_time": 2.74
}
}错误码
参见错误码文档。