创建新会话
ManageOrgSessions 权限的服务用户账号。
| 功能 | 所需权限 |
|---|---|
advanced_mode | UseDevinExpert |
create_as_user_id | ImpersonateOrgSessions |
advanced_mode 参数会为自动化工作流启用特定的会话行为。启用后,会话将使用高级人物设定,并根据所选模式对提示词进行转换。
| 模式 | 描述 | 必需参数 |
|---|---|---|
analyze | 分析现有 Devin 会话以获取洞察 | session_links |
create | 基于会话分析创建新的 playbook | 无(可选:session_links) |
improve | 根据反馈改进现有 playbook | child_playbook_id |
batch | 为一组任务启动多个 Devin 会话 | child_playbook_id |
manage | 管理 Knowledge | 无 |
batch 模式时,可以选择将 bypass_approval 设置为 true,以跳过创建批处理会话时的审批步骤。这对于需要会话在无需人工审批的情况下立即启动的全自动化工作流非常有用。
create_as_user_id 参数允许代表其他用户创建会话。前提条件如下:
ImpersonateOrgSessions 权限UseDevinSessions 权限服务用户凭据(前缀:cog_)
analyze, create, improve, batch, manage 1 - 2083用于验证结构化输出的 JSON Schema(Draft 7),最大 64KB。必须是自包含的(不允许外部 $ref)。
成功响应
new, claimed, running, exit, error, suspended, resuming 对会话当前状态的补充说明。
当 status 为 running 时,detail 可能为:
working:正在执行任务;waiting_for_user:等待用户输入;waiting_for_approval:在安全模式下等待操作审批;finished:任务已完成。当 status 为 suspended 时,detail 表示挂起原因,例如:
inactivity:长时间无操作;user_request:用户请求挂起;usage_limit_exceeded:超出使用上限;out_of_credits:余额/额度已用尽;payment_declined:付款被拒;org_usage_limit_exceeded:组织使用配额超限;error:发生错误。该字段仅会在 GET /list 类型的端点中返回。
working, waiting_for_user, waiting_for_approval, finished, inactivity, user_request, usage_limit_exceeded, out_of_credits, payment_declined, org_usage_limit_exceeded, error 来自会话的已验证结构化输出。仅在 GET/LIST 端点中返回。