检索运行步骤试用版
试用版
获取 https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}
检索运行步骤。
查询参数
要包含在响应中的其他字段的列表。目前唯一支持的值是step_details.tool_calls[*].file_search.results[*].content
以获取文件搜索结果内容。
有关更多信息,请参阅文件搜索工具文档。
返回
与指定 ID 匹配的 run step 对象。
示例请求
1
2
3
4
curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"
响应
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
{
"id": "step_abc123",
"object": "thread.run.step",
"created_at": 1699063291,
"run_id": "run_abc123",
"assistant_id": "asst_abc123",
"thread_id": "thread_abc123",
"type": "message_creation",
"status": "completed",
"cancelled_at": null,
"completed_at": 1699063291,
"expired_at": null,
"failed_at": null,
"last_error": null,
"step_details": {
"type": "message_creation",
"message_creation": {
"message_id": "msg_abc123"
}
},
"usage": {
"prompt_tokens": 123,
"completion_tokens": 456,
"total_tokens": 579
}
}