status: "requires_action"
和required_action.type
is时submit_tool_outputs
,此端点可用于在工具调用全部完成后提交输出。所有输出必须在单个请求中提交。Authorization: Bearer ********************
{
"tool_outputs": [
{
"tool_call_id": "call_MbELIQcB72cq35Yzo2MRw5qs",
"output": "28C"
}
]
}
curl --location --request POST 'https://oapi.czl.net/v1/threads//runs//submit_tool_outputs' \
--header 'Content-Type: application/json' \
--data-raw '{
"tool_outputs": [
{
"tool_call_id": "call_MbELIQcB72cq35Yzo2MRw5qs",
"output": "28C"
}
]
}'
{
"id": "run_PHLyHQYIQn4F7JrSXslEYWwh",
"object": "thread.run",
"created_at": 1699075592,
"assistant_id": "asst_IgmpQTah3ZfPHCVZjTqAY8Kv",
"thread_id": "thread_EdR8UvCDJ035LFEJZMt3AxCd",
"status": "queued",
"started_at": 1699075592,
"expires_at": 1699076192,
"cancelled_at": null,
"failed_at": null,
"completed_at": null,
"last_error": null,
"model": "gpt-4",
"instructions": "You tell the weather.",
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Determine weather in my location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"c",
"f"
]
}
},
"required": [
"location"
]
}
}
}
],
"file_ids": [],
"metadata": {}
}