创建 run
开发环境
开发环境
POST
/v1/threads/run/create
参数 | 类型 | 含义 |
---|---|---|
code | string | 错误码 |
message | string | 错误信息 |
参数 | 类型 | 含义 | 备注 |
---|---|---|---|
name | string | 函数名称 | |
description | string | 函数功能描述 | |
parameters | FunctionParameters | 该函数的参数及其说明 | 对每个参数的命名和参数说明也需要描述精确,才能更好的生成。比如: "parameters": { "type": "object", "properties": { "meeting_id": { "type": "string", "description": "会议id" }, "participants": { "type": "string", "description": "参会人" } }, "required": [ "meetingid", "participants" ] } |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'http://dev-cn.your-api-server.com/v1/threads/run/create?GroupId=${GroupId}' \
--header 'Authorization: Bearer ${API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"thread_id": "$Thread_Id",
"assistant_id": "${Assistant_Id}"
}'
响应示例响应示例
{
"id": "run_abc123",
"object": "thread.run",
"created_at": 1703245668,
"assistant_id": "asst_abc123
"thread_id": "thread_abc123",
"status": "queued",
"started_at": 0,
"expires_at": 0,
"cancelled_at": 0,
"failed_at": 0,
"completed_at": 0,
"last_error": null,
"model": "abab5.5-chat",
"instructions": "Follow the instructions carefully\n回答中若参考了函数返回结果中的信息,请在该句末尾用【1†source】【2†source】【3†source】的形式标注信息来源。严禁使用其他的引用格式(如[1],【1】,²等等)。",
"tools": [
{
"type": "retrieval"
}
],
"file_ids": [
"${file id}"
],
"metadata": null,
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}
请求参数
Query 参数
GroupId
string
必需
示例值:
${GroupId}
Header 参数
Authorization
string
必需
示例值:
Bearer ${API_KEY}
Content-Type
string
必需
示例值:
application/json
Body 参数application/json
返回响应
修改于 2024-01-03 09:40:54