Skip to content

项目状态

列出状态

GET /external/v1/projects/{project_id}/statuses
bash
curl http://localhost:8000/external/v1/projects/PROJECT_ID/statuses \
  -H "Authorization: Bearer API_KEY"

响应(200):

json
[
  {
    "name": "pipeline",
    "fields": [
      { "name": "current_stage", "type": "string", "default": "idle" },
      { "name": "progress", "type": "integer", "default": 0 }
    ],
    "values": { "current_stage": "embedding", "progress": 45 }
  }
]

更新状态字段值

PATCH /external/v1/projects/{project_id}/statuses/{status_name}/values

只有传入的字段会被修改,其余字段保持不变。

请求体(JSON):

字段类型说明
valuesobject字段名 → 新值的映射(不能为空)

字段必须是该状态已声明的字段,否则返回 400

bash
curl -X PATCH \
  http://localhost:8000/external/v1/projects/PROJECT_ID/statuses/pipeline/values \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"values": {"current_stage": "done", "progress": 100}}'

响应(200):

json
{ "status": "pipeline", "values": { "current_stage": "done", "progress": 100 } }

Built with VitePress