run 对象 (v1)Legacy
Legacy
表示在线程上运行的执行。
作为此运行的一部分执行的线程的 ID。
用于执行此运行的助手的 ID。
助手用于此运行的模型。
助手用于此运行的说明。
助手用于此运行的工具列表。
控制模型调用哪个 (如果有) 工具。none
表示模型不会调用任何工具,而是生成一条消息。auto
是默认值,表示模型可以在生成消息或调用工具之间进行选择。
指定特定工具,如{"type": "TOOL_TYPE"}
或{"type": "function", "function": {"name": "my_function"}}
强制模型调用该工具。
指定模型必须输出的格式。兼容 GPT-4o、GPT-4 Turbo 和所有 GPT-3.5 Turbo 型号gpt-3.5-turbo-1106
.
设置为{ "type": "json_object" }
启用 JSON 模式,该模式保证模型生成的消息是有效的 JSON。
重要提示:使用 JSON 模式时,还必须通过系统或用户消息指示模型自行生成 JSON。否则,模型可能会生成无休止的空格流,直到生成达到令牌限制,从而导致长时间运行且似乎“卡住”的请求。另请注意,如果出现以下情况,消息内容可能会被部分截断finish_reason="length"
,这表示已超过代数max_tokens
或对话超过了最大上下文长度。
OBJECT 运行对象 (v1)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
"id": "run_abc123",
"object": "thread.run",
"created_at": 1698107661,
"assistant_id": "asst_abc123",
"thread_id": "thread_abc123",
"status": "completed",
"started_at": 1699073476,
"expires_at": null,
"cancelled_at": null,
"failed_at": null,
"completed_at": 1699073498,
"last_error": null,
"model": "gpt-4-turbo",
"instructions": null,
"tools": [{"type": "retrieval"}, {"type": "code_interpreter"}],
"file_ids": [],
"metadata": {},
"incomplete_details": null,
"usage": {
"prompt_tokens": 123,
"completion_tokens": 456,
"total_tokens": 579
},
"temperature": 1.0,
"top_p": 1.0,
"max_prompt_tokens": 1000,
"max_completion_tokens": 1000,
"truncation_strategy": {
"type": "auto",
"last_messages": null
},
"response_format": "auto",
"tool_choice": "auto"
}