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。
filename string
匹配文檔的檔案名稱。
score float
匹配相關度評分,取值範圍 0-1,值越大表示相關度越高。