type string
输出项类型。枚举值:
message:消息类型,包含模型最终生成的回复内容。
reasoning:推理类型,设置 reasoning.effort(非 none)或开启思考模式时返回。推理 Token 会被计入 output_tokens_details.reasoning_tokens 中,按推理 Token 计费。
function_call:函数调用类型,使用自定义 function 工具时返回。需要处理函数调用并返回结果。
web_search_call:搜索调用类型,使用 web_search 工具时返回。
code_interpreter_call:代码执行类型,使用 code_interpreter 工具时返回。
web_extractor_call:网页抽取类型,使用 web_extractor 工具时返回。需要配合 web_search 工具一起使用。
web_search_image_call:文搜图调用类型,使用 web_search_image 工具时返回。包含搜索到的图片列表。
image_search_call:图搜图调用类型,使用 image_search 工具时返回。包含搜索到的相似图片列表。
mcp_call:MCP 调用类型,使用 mcp 工具时返回。包含 MCP 服务的调用结果。
file_search_call:知识库搜索调用类型,使用 file_search 工具时返回。包含知识库的检索查询和结果。
id string
输出项的唯一标识符。所有类型的输出项都包含此字段。
role string
消息角色,固定为 assistant。仅当 type 为 message 时存在。
status string
输出项状态。可选值:completed(完成)、in_progress(生成中)。当 type 不为reasoning时存在。
name string
工具或函数名称。当 type 为 function_call、web_search_image_call、image_search_call、mcp_call 时存在。
对于 web_search_image_call 和 image_search_call,值分别固定为 "web_search_image" 和 "image_search"。
对于 mcp_call,值为 MCP 服务中被调用的具体函数名(如 amap-maps-maps_geo)。
arguments string
工具调用的参数,JSON 字符串格式。当 type 为 function_call、web_search_image_call、image_search_call、mcp_call 时存在。使用前需要通过 JSON.parse() 解析。不同工具类型的 arguments 内容:
web_search_image_call:{"queries": ["搜索关键词1", "搜索关键词2"]},其中 queries 为模型根据用户输入自动生成的搜索关键词列表。
image_search_call:{"img_idx": 0, "bbox": [0, 0, 1000, 1000]},其中 img_idx 为输入图片的索引(从 0 开始),bbox 为搜索区域的边界框坐标 [x1, y1, x2, y2],坐标范围 0-1000。
function_call:按用户定义的函数参数 schema 生成的参数对象。
mcp_call:MCP 服务中被调用函数的参数对象。
call_id string
函数调用的唯一标识符。仅当 type 为 function_call 时存在。在返回函数调用结果时,需要通过此 ID 关联请求与响应。
content array
消息内容数组。仅当 type 为 message 时存在。
数组元素属性
type string
内容类型,固定为 output_text。
annotations array
文本注释数组。通常为空数组。
summary array
推理摘要数组。仅当 type 为 reasoning 时存在。每个元素包含 type(值为 summary_text)和 text(摘要文本)字段。
action object
搜索动作信息。仅当 type 为 web_search_call 时存在。
属性
type string
搜索类型,固定为 search。
sources array
搜索来源列表。每个元素包含 type和 url字段。
code string
模型生成并执行的代码。仅当 type 为 code_interpreter_call 时存在。
outputs array
代码执行输出数组。仅当 type 为 code_interpreter_call 时存在。每个元素包含 type(值为 logs)和 logs(代码执行日志)字段。
container_id string
代码解释器容器标识符。仅当 type 为 code_interpreter_call 时存在。用于关联同一会话中的多次代码执行。
goal string
抽取目标描述,说明需要从网页中提取哪些信息。仅当 type 为 web_extractor_call 时存在。
output string
工具调用的输出结果,字符串格式。
当 type 为 web_extractor_call 时为网页抽取的内容摘要
当 type 为 web_search_image_call 或 image_search_call 时为 JSON 字符串,包含图片搜索结果数组,每个元素包含 title(图片标题)、url(图片 URL)和 index(序号)字段
当 type 为 mcp_call 时为 MCP 服务返回的 JSON 字符串结果。
urls array
被抽取的网页 URL 列表。仅当 type 为 web_extractor_call 时存在。
server_label string
MCP 服务标签。仅当 type 为 mcp_call 时存在。标识本次调用所使用的 MCP 服务。
queries array
知识库检索使用的查询列表。仅当 type 为 file_search_call 时存在。数组元素为字符串,表示模型生成的搜索查询词。
results array
知识库检索结果数组。仅当 type 为 file_search_call 时存在。
数组元素属性
file_id string
匹配文档的文件 ID。
score float
匹配相关度评分,取值范围 0-1,值越大表示相关度越高。