AgentRunResult 包含持久化的运行状态、消息、步骤、用量和成本、警告、结束原因以及最终输出。
使用 text_stream() 获取回答文本,使用 item_stream() 获取供应商和运行时项目。Python 项目目前采用字典结构,而不是 TypeScript 的判别联合类型 AgentItem。
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
根据消息、步骤、工具和流式项目构建 Python 运行时间线。
AgentRunResult 包含持久化的运行状态、消息、步骤、用量和成本、警告、结束原因以及最终输出。
使用 text_stream() 获取回答文本,使用 item_stream() 获取供应商和运行时项目。Python 项目目前采用字典结构,而不是 TypeScript 的判别联合类型 AgentItem。
for item in stream.item_stream():
item_type = item.get("type")
render_timeline_item(item_type, item)