Skip to main content
Runs

创建运行任务

在指定线程上创建一个运行(Run)。

POST
/threads/{thread_id}/runs
cURL
curl --request POST \
  --url 'https://dashscope.aliyuncs.com/api/v1/threads/{thread_id}/runs' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "assistant_id": "asst_46e95014-ccac-435d-b884-c97ac44a94d9",
  "metadata": {}
}
'
{
  "id": "run_3de634fa-75d4-4370-adcf-92ba2a60c396",
  "object": "thread.run",
  "created_at": 1711517598169,
  "thread_id": "thread_cc2a3e9d-436b-482b-91c5-377e0f376506",
  "assistant_id": "asst_46e95014-ccac-435d-b884-c97ac44a94d9",
  "status": "in_progress",
  "model": "qwen-max",
  "instructions": "你是一个智能小助手,你可以根据用户的需求去调用不同的工具,进而给出回答。请酌情使用工具。",
  "tools": [
    {
      "type": "search"
    },
    {
      "type": "text_to_image"
    }
  ],
  "metadata": {},
  "request_id": "225292ff-9843-95d4-8591-b1377c33e2be"
}

Authorizations

string
header
required

DashScope API Key,在控制台 API Key 页面(https://bailian.console.aliyun.com/settings/apikey)获取。请求头格式:Authorization: Bearer $DASHSCOPE_API_KEY。

Path Parameters

string
required

所需要运行的 thread ID。

Body

application/json
string
required

所需要运行的 assistant ID。

string

所需要调用的 model 名字。如果传入,会替换 assistant 中定义的 model。

string

替换 assistant 中定义的 instruction。

object[]

替换 assistant 中定义的 tool 列表。

object

其他相关参数说明。

boolean

是否流式返回。

number

用于控制随机性和多样性的程度。

number

生成时,核采样方法的概率阈值。

integer

生成时,采样候选集的大小。

Response

200-application/json
Managed Agent API
Flow Agent API
RAG API
Connector API
框架集成
  • 框架