亮色模式
Submit tool outputs to run (v1)
POST
https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputsWhen a run has the status: "requires_action"
and required_action.type
is submit_tool_outputs
, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.
Request
Header 参数
Authorization
string
必需
示例值:
Bearer $OPENAI_API_KEY
Content-Type
string
必需
示例值:
application/json
OpenAI-Beta
string
必需
示例值:
assistants=v1
Body 参数application/json
tool_outputs
array [object {2}]
必需
A list of tools for which the outputs are being submitted.
tool_call_id
string
可选
output
string
可选
示例
{
"tool_outputs": [
{
"tool_call_id": "call_001",
"output": "70 degrees and sunny."
}
]
}
Request samples
返回响应
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
数据结构
id
string
必需
object
string
必需
created_at
integer
必需
assistant_id
string
必需
thread_id
string
必需
status
string
必需
started_at
integer
必需
expires_at
integer
必需
cancelled_at
null
必需
failed_at
null
必需
completed_at
null
必需
last_error
null
必需
model
string
必需
instructions
null
必需
incomplete_details
null
必需
tools
array [object {2}]
必需
type
string
可选
function
object
可选
file_ids
array[string]
必需
metadata
object
必需
usage
null
必需
temperature
integer
必需
top_p
integer
必需
max_prompt_tokens
integer
必需
max_completion_tokens
integer
必需
truncation_strategy
object
必需
type
string
必需
last_messages
null
必需
response_format
string
必需
tool_choice
string
必需
示例
{
"id": "run_123",
"object": "thread.run",
"created_at": 1699075592,
"assistant_id": "asst_123",
"thread_id": "thread_123",
"status": "queued",
"started_at": 1699075592,
"expires_at": 1699076192,
"cancelled_at": null,
"failed_at": null,
"completed_at": null,
"last_error": null,
"model": "gpt-4-turbo",
"instructions": null,
"incomplete_details": null,
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location"
]
}
}
}
],
"file_ids": [],
"metadata": {},
"usage": null,
"temperature": 1,
"top_p": 1,
"max_prompt_tokens": 1000,
"max_completion_tokens": 1000,
"truncation_strategy": {
"type": "auto",
"last_messages": null
},
"response_format": "auto",
"tool_choice": "auto"
}
最后修改时间: 10 天前