API 参考
取消任务
停止正在运行的任务。
请求体可选。省略它,或发送 "force": false,进行优雅停止。"force": true 立即取消。
OpenAPI
openapi: 3.1.0
info:
title: BioAgent API — V1
description: Public API for BioAgent, the biomedical AI agent platform.
version: 0.1.0
servers:
- url: https://bioagent.cloud/api/v1
description: >-
BioAgent public API base URL. Every endpoint on this page is served from
this host.
security: []
paths:
/experimental/tasks/{task_id}/cancel:
post:
tags:
- tasks
summary: Cancel a task
description: Stop a running task.
operationId: cancel_task_experimental_tasks__task_id__cancel_post
parameters:
- name: task_id
in: path
required: true
schema:
type: string
title: Task Id
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CancelTaskRequest'
default:
force: false
examples:
graceful:
summary: Graceful — let the agent stop at a safe point (default)
value: {}
force:
summary: Force — stop immediately
value:
force: true
responses:
'200':
description: Cancel accepted.
content:
application/json:
schema:
$ref: '#/components/schemas/TaskStatusAck'
example:
type: task_status
id: tsk_014MUnN99MEVcklVXXfFbxXb
status: cancelled
security:
- bearerAuth: []
components:
schemas:
CancelTaskRequest:
properties:
force:
type: boolean
title: Force
default: false
additionalProperties: false
type: object
title: CancelTaskRequest
description: Omit the body for a graceful cancel.
TaskStatusAck:
properties:
type:
type: string
const: task_status
title: Type
default: task_status
id:
type: string
title: Id
status:
type: string
const: cancelled
title: Status
type: object
required:
- id
- status
title: TaskStatusAck
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: Requires an API key. See the Authentication guide.