跳到导航

发送会话消息

Alpha

向对话发送输入,并等待智能体完成或等待客户端工具结果。当 background 设为 true 时,服务器接受该轮后,端点会返回 202。随后将 Last-Event-ID 设为 stream_cursor,以流式接收该轮事件。此端点处于 Alpha 阶段,可能会变更。

路径参数

conversation_idstring必需

对话 ID

请求头

xi-api-keystring可选

请求

This endpoint expects an object.
inputlist of objects必需

可以是 1 个用于开始新轮次的 user_message,也可以是回答等待中轮次的 required_actions 并继续该轮次的 client_tool_result 项。未包含的调用会保持待处理状态。客户端工具会无限期等待。调用待处理期间,user_message 会被拒绝。user_message 可附带 contextual_update 项,每个 context_id 最多 1 项。回答所有待处理调用的 client_tool_result 项可附带 end 更新。

backgroundboolean可选默认为 false
If true, return a 202 handle after the turn is admitted instead of waiting for generation to finish.

响应

成功响应

turn_idstring
statusenum
允许的值:
outputlist of objects可选
errorobject or null可选
required_actionslist of objects可选

智能体正在等待的操作。请在 input 中使用 client_tool_result 项响应每个 client_tool_call,以继续执行。

stream_cursorstring or null可选

此轮事件流的恢复令牌。该轮进行期间会提供;将其作为 Last-Event-ID 传入,以流式接收该轮事件。

错误

422
Unprocessable Entity Error