実行するためのツール出力を提出します
POST
https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
Path Params
thread_id
string
required
run_id
string
required
Body Params application/json
tool_outputs
array [object {2}]
required
tool_call_id
string
optional
output
string
optional
Example
{
"tool_outputs": [
{
"tool_call_id": "call_MbELIQcB72cq35Yzo2MRw5qs",
"output": "28C"
}
]
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.openai.com/v1/threads//runs//submit_tool_outputs' \
--header 'Content-Type: application/json' \
--data-raw '{
"tool_outputs": [
{
"tool_call_id": "call_MbELIQcB72cq35Yzo2MRw5qs",
"output": "28C"
}
]
}'
Responses
🟢200成功
application/json
Body
id
string
required
object
string
required
created_at
integer
required
assistant_id
string
required
thread_id
string
required
status
string
required
started_at
integer
required
expires_at
integer
required
cancelled_at
null
required
failed_at
null
required
completed_at
null
required
last_error
null
required
model
string
required
instructions
string
required
tools
array [object {2}]
required
type
string
optional
function
object
optional
file_ids
array[string]
required
metadata
object
required
Example
{
"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": {}
}
Modified at 2024-12-17 03:41:01