跳到主要内容

创建任务

POST/research/worker/tasks在线调试
POST https://api.shengkezhi.com/open/v1/research/worker/tasks
等效 curl
curl "https://api.shengkezhi.com/open/v1/research/worker/tasks" \
  -H "Authorization: Bearer sk_xxx"

POST /research/worker/tasks — 创建任务。

需在请求头携带 Authorization: Bearer sk_xxx

请求体

请求体SubmitBody

字段类型必填说明
kindstring任务类型标识,决定 worker 执行的作业内容;缺省 echo。真实类型(如因子挖掘、策略探索、realtime)会 shell out 调用 skz pipeline 并把结果写回 workspace,echofail 为演示状态机用的成功或失败作业。

响应

响应 dataTaskQueued

字段类型必填说明
statusstring提交后返回的初始状态,通常为 queued(已入队等待执行)。
task_idstring新排队任务的唯一标识,客户端可据此查询 GET /research/worker/tasks/{id} 查询进度。

调用示例

curl -X POST "https://api.shengkezhi.com/open/v1/research/worker/tasks" \
-H "Authorization: Bearer sk_xxx" \
-H "Content-Type: application/json" \
-d '{"kind":"echo"}'
{
"code": 0,
"msg": "任务已提交",
"data": {
"task_id": "task-4",
"status": "queued"
}
}