获取代理任务

Changed on

检索代理作业的当前状态和详细信息。轮询此端点以跟踪作业进度。

使用管理员 API 密钥进行身份验证。

get/v2/agent/{projectId}/job/{id}

Request

  • Base URL
    https://api.mintlify.com
  • Auth
    HTTP bearer

Path parameters

projectIdstring required

你的项目 ID。可从你的控制台中的 API keys 页面复制。

idstring required

代理任务的唯一标识符。

Response

代理任务详情

idstring

代理任务的唯一标识符。

status'active' | 'completed' | 'archived' | 'failed'

作业的当前状态。active——代理当前正在处理提示词。completed——代理已成功完成,并且可能已创建 PR(请检查 prLink)。archived——作业已归档。failed——代理遇到了不可恢复的错误。请持续轮询,直到状态变为 completed、archived 或 failed。

modelstring

此作业使用的 AI 模型。

prLinkstring uri nullable

由代理创建的 GitHub 拉取请求(PR;亦称“合并请求”/Merge Request)URL。作业仍处于 active 状态或没有文件变更时,该值为 null。代理成功创建 PR 后,此字段会被填充。

createdAtstring date-time

作业创建时的时间戳。

archivedAtstring date-time nullable

作业归档时的时间戳。

Example response

{
  "prLink": "https://github.com/org/repo/pull/123"
}

Changes

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status