curl --request POST \
--url https://api.mintlify.com/v2/agent/{projectId}/job \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>"
}
'{
"id": "<string>",
"status": "active",
"source": {
"repository": "<string>",
"ref": "<string>"
},
"model": "<string>",
"prLink": "https://github.com/org/repo/pull/123",
"createdAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z"
}创建一个在后台运行的 Agent 作业,并自动创建包含文档更改的拉取请求(PR;亦称“合并请求”/Merge Request)。
curl --request POST \
--url https://api.mintlify.com/v2/agent/{projectId}/job \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>"
}
'{
"id": "<string>",
"status": "active",
"source": {
"repository": "<string>",
"ref": "<string>"
},
"model": "<string>",
"prLink": "https://github.com/org/repo/pull/123",
"createdAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z"
}prLink 字段。
curl -X POST https://api.mintlify.com/v2/agent/{projectId}/job \
-H "Authorization: Bearer mint_xxxxx" \
-H "Content-Type: application/json" \
-d '{"prompt": "Add a quickstart guide for the Python SDK"}'
Authorization 头部需要 Bearer 令牌。请使用以 mint_ 为前缀的管理员 API 密钥。这是服务端使用的机密凭证。你可以在控制台的 API keys 页面 中生成一个。
供代理执行的指令。
1代理作业创建成功
代理任务的唯一标识符。
作业的当前状态。active —— 代理当前正在处理提示词。completed —— 代理已成功完成,并且可能已创建 PR(请检查 prLink)。failed —— 代理遇到了不可恢复的错误。请持续轮询,直到状态为 completed 或 failed。
active, completed, failed 源存储库信息。
显示 子属性
此作业使用的 AI 模型。
由代理创建的 GitHub 拉取请求(PR;亦称“合并请求”/Merge Request)URL。作业仍处于 active 状态或没有文件变更时,该值为 null。代理成功创建 PR 后,此字段会被填充。
"https://github.com/org/repo/pull/123"
作业创建时的时间戳。
作业归档时的时间戳。
此页面对您有帮助吗?