Skip to main content
Runs

修改运行任务

修改指定运行的 metadata。

POST
/threads/{thread_id}/runs/{run_id}
cURL
curl --request POST \
  --url 'https://dashscope.aliyuncs.com/api/v1/threads/{thread_id}/runs/{run_id}' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "metadata": {
    "user": "abc123"
  }
}
'
{
  "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": "completed",
  "required_action": {},
  "last_error": {},
  "expires_at": 0,
  "started_at": 0,
  "cancelled_at": 0,
  "failed_at": 0,
  "completed_at": 0,
  "model": "qwen-max",
  "instructions": "你是一个智能小助手,你可以根据用户的需求去调用不同的工具,进而给出回答。请酌情使用工具。",
  "tools": [
    {
      "type": "search"
    },
    {
      "type": "text_to_image"
    }
  ],
  "metadata": {
    "user": "abc123"
  },
  "usage": {
    "input_tokens": 66,
    "output_tokens": 9,
    "total_tokens": 75
  },
  "request_id": "bb6a5c5c-146f-95b8-bafa-e6c467e4f2d3"
}

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。

string
required

待修改的 run ID。

Body

application/json
object

与该 Run 关联的 key/value 信息。

Response

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