获取 /API/v1/项目/{id}/执行日志

通过工作区编排引擎获取会话的执行日志。项目范围由路由 ID 路径参数传递,组织来自该项目。

路径参数

  • id 字符串 必需

    项目 ID

查询参数

  • session_id 字符串 必需

    会话id

  • since 字符串

    RFC3339 时间戳过滤器

  • 之后 字符串

    不透明游标由上一个响应作为 next_cursor 返回

  • workspace_id 字符串

    用于工作区解析的工作区 ID

响应

  • 不支持或格式错误的 API 版本、所选已发布合同中不可用的操作,或不可接受的表示形式(包括不支持的媒体类型参数或排除的 SSE)。现有的身份验证、授权和速率限制失败具有优先权。

    隐藏响应属性 显示响应属性 对象
    • badRequestDetail 对象

      由标准错误模式定义的可选验证详细信息;API 协商错误不会发出此字段。

      隐藏 BadRequestDetail 属性 显示 BadRequestDetail 属性 对象
      • 字段 大量[对象]

        字段验证失败。

        隐藏字段属性 显示字段属性 对象

        字段及其验证失败。

        • 描述 字符串 必需

          人类可读验证失败。

        • 字段 字符串 必需

          无效请求字段的名称或路径。

    • 详细信息 字符串 必需

      可读的错误详情。

    • 错误 整型 必需

      HTTP status code.

    • 错误代码 字符串 必需

      机器可读的错误码。

    • 参数 array[string]

      与错误相关的请求参数名称;当无相关参数时省略。

    • 原因 字符串 必需

      HTTP 状态原因语句。

    隐藏响应属性 显示响应属性 对象
    • badRequestDetail 对象

      由标准错误模式定义的可选验证详细信息;API 协商错误不会发出此字段。

      隐藏 BadRequestDetail 属性 显示 BadRequestDetail 属性 对象
      • 字段 大量[对象]

        字段验证失败。

        隐藏字段属性 显示字段属性 对象

        字段及其验证失败。

        • 描述 字符串 必需

          人类可读验证失败。

        • 字段 字符串 必需

          无效请求字段的名称或路径。

    • 详细信息 字符串 必需

      可读的错误详情。

    • 错误 整型 必需

      HTTP status code.

    • 错误代码 字符串 必需

      机器可读的错误码。

    • 参数 array[string]

      与错误相关的请求参数名称;当无相关参数时省略。

    • 原因 字符串 必需

      HTTP 状态原因语句。

  • 200

    正常

    隐藏响应属性 显示响应属性 对象
    • 数数 整型
    • has_more 布尔
    • logs 大量[对象]
      隐藏日志属性 显示日志属性 对象
      • a2a_caller_workspace_id 字符串
      • a2a_parent_execution_id 字符串
      • a2a_target_agent_id 字符串
      • a2a_target_agent_name 字符串
      • completion_tokens 整型
      • cost_usd 数字
      • 决策 字符串
      • duration_ms 数字
      • 错误 字符串
      • execution_id 字符串
      • 防护栏操作 字符串

        护栏决策字段(由 LogGuardrailDecision 填充 kind="guardrail" 日志)。这些是 OE 文档中的顶级字段;在此映射它们可确保 API 网关将它们传递给用户界面,而不是在结构体反序列化过程中将它们丢弃。

      • guardrail_name 字符串
      • 防护类型 字符串
      • id 字符串
      • 输入 对象

        允许使用其他属性。

      • kind 字符串

        类型是 LLM 调用的 "llm"、普通工具的 "tool"、内存操作的 "memory"、代理到代理调用的 "a2a"、护栏决策事件的 "guardrail"以及平台策略决策事件的 "policy"。

        取值为 llm、tool、memory、a2a、guardrail 或 policy。

      • log_source 字符串

        LogSource 标识记录此日志行的平台组件(示例,对于平台的内存代理编写的行,可以是 "memory_proxy")。对于从代理驱动的调用记录的行,此字段为空。

      • metadata 对象

        允许使用其他属性。

      • 模型 字符串
      • org_id 字符串
      • pod_name 字符串

        工具执行所在的主机名/pod 名

      • PROJECT_ID 字符串
      • prompt_tokens 整型

        Token 使用量和费用字段 (在 invoke_llm 调用时填充)

      • root_execution_id 字符串
      • root_session_id 字符串
      • session_id 字符串
      • span_id 字符串
      • 状态 字符串

        步骤结果;包含 "cancelled" 适用于调用方取消的内存轮次写入。

      • step_number 整型

        StepNumber 标识其执行过程中的步骤。这是将日志行与客户端在其他地方查看的步骤绑定的关键。如果在此处忽略它,行仍然会到达,但没有什么可以说明它属于哪个步骤。

      • timestamp string(date-time)
      • 工具 字符串
      • 工具_API_错误 对象
        隐藏 tool_api_error 属性 显示 tool_api_error 属性 对象
        • 分类 字符串
        • error_code 字符串
        • http_status 整型
        • provider_type 字符串
        • 原因 字符串
        • 可重试 布尔

          如果新的提供商调用可能成功,则为 True (429/503/timeout/connect)。不得重放此工具调用。

      • tool_call_id 字符串

        ToolCallID 是稳定的 LLM 工具调用 ID。将工具调用开始和结果的执行日志记录连接到彼此,并连接到会话消息。对于 `invoke_llm` 和其他非工具调用事件,内容为空。

      • total_tokens 整型
      • 追踪 ID 字符串
      • triggered_policy_ids array[string]
      • user_id 字符串
      • workspace_id 字符串
    • 下一个光标 字符串

      NextCursor 是用于下一个拉取的不透明后续令牌。当 OE 未发送位置时(第一页为空),则忽略。

    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 数数 整型
    • has_more 布尔
    • logs 大量[对象]
      隐藏日志属性 显示日志属性 对象
      • a2a_caller_workspace_id 字符串
      • a2a_parent_execution_id 字符串
      • a2a_target_agent_id 字符串
      • a2a_target_agent_name 字符串
      • completion_tokens 整型
      • cost_usd 数字
      • 决策 字符串
      • duration_ms 数字
      • 错误 字符串
      • execution_id 字符串
      • 防护栏操作 字符串

        护栏决策字段(由 LogGuardrailDecision 填充 kind="guardrail" 日志)。这些是 OE 文档中的顶级字段;在此映射它们可确保 API 网关将它们传递给用户界面,而不是在结构体反序列化过程中将它们丢弃。

      • guardrail_name 字符串
      • 防护类型 字符串
      • id 字符串
      • 输入 对象

        允许使用其他属性。

      • kind 字符串

        类型是 LLM 调用的 "llm"、普通工具的 "tool"、内存操作的 "memory"、代理到代理调用的 "a2a"、护栏决策事件的 "guardrail"以及平台策略决策事件的 "policy"。

        取值为 llm、tool、memory、a2a、guardrail 或 policy。

      • log_source 字符串

        LogSource 标识记录此日志行的平台组件(示例,对于平台的内存代理编写的行,可以是 "memory_proxy")。对于从代理驱动的调用记录的行,此字段为空。

      • metadata 对象

        允许使用其他属性。

      • 模型 字符串
      • org_id 字符串
      • pod_name 字符串

        工具执行所在的主机名/pod 名

      • PROJECT_ID 字符串
      • prompt_tokens 整型

        Token 使用量和费用字段 (在 invoke_llm 调用时填充)

      • root_execution_id 字符串
      • root_session_id 字符串
      • session_id 字符串
      • span_id 字符串
      • 状态 字符串

        步骤结果;包含 "cancelled" 适用于调用方取消的内存轮次写入。

      • step_number 整型

        StepNumber 标识其执行过程中的步骤。这是将日志行与客户端在其他地方查看的步骤绑定的关键。如果在此处忽略它,行仍然会到达,但没有什么可以说明它属于哪个步骤。

      • timestamp string(date-time)
      • 工具 字符串
      • 工具_API_错误 对象
        隐藏 tool_api_error 属性 显示 tool_api_error 属性 对象
        • 分类 字符串
        • error_code 字符串
        • http_status 整型
        • provider_type 字符串
        • 原因 字符串
        • 可重试 布尔

          如果新的提供商调用可能成功,则为 True (429/503/timeout/connect)。不得重放此工具调用。

      • tool_call_id 字符串

        ToolCallID 是稳定的 LLM 工具调用 ID。将工具调用开始和结果的执行日志记录连接到彼此,并连接到会话消息。对于 `invoke_llm` 和其他非工具调用事件,内容为空。

      • total_tokens 整型
      • 追踪 ID 字符串
      • triggered_policy_ids array[string]
      • user_id 字符串
      • workspace_id 字符串
    • 下一个光标 字符串

      NextCursor 是用于下一个拉取的不透明后续令牌。当 OE 未发送位置时(第一页为空),则忽略。

    • Success 布尔
  • Bad Request

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • Unauthorized

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 第 425 章

    工作区域编排引擎尚未就绪

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 内部服务器错误

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 错误网关

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
GET /API/v1/项目/{id}/执行日志
curl \
 --request GET 'https://agentengine.mongodb.com/api/v1/projects/{id}/execution-logs?session_id=string' \
 --header "Authorization: $API_KEY"
响应示例 (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
  "error": 406,
  "errorCode": "UNACCEPTABLE_MEDIA_TYPE",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
  "error": 406,
  "errorCode": "UNSUPPORTED_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
响应示例 (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
响应示例 (200)
{
  "count": 42,
  "has_more": true,
  "logs": [
    {
      "a2a_caller_workspace_id": "string",
      "a2a_parent_execution_id": "string",
      "a2a_target_agent_id": "string",
      "a2a_target_agent_name": "string",
      "completion_tokens": 42,
      "cost_usd": 42.0,
      "decision": "string",
      "duration_ms": 42.0,
      "error": "string",
      "execution_id": "string",
      "guardrail_action": "string",
      "guardrail_name": "string",
      "guardrail_type": "string",
      "id": "string",
      "inputs": {},
      "kind": "llm",
      "log_source": "string",
      "metadata": {},
      "model": "string",
      "org_id": "string",
      "pod_name": "string",
      "project_id": "string",
      "prompt_tokens": 42,
      "root_execution_id": "string",
      "root_session_id": "string",
      "session_id": "string",
      "span_id": "string",
      "status": "string",
      "step_number": 42,
      "timestamp": "2026-05-04T09:42:00Z",
      "tool": "string",
      "tool_api_error": {
        "classification": "string",
        "error_code": "string",
        "http_status": 42,
        "provider_type": "string",
        "reason": "string",
        "retryable": true
      },
      "tool_call_id": "string",
      "total_tokens": 42,
      "trace_id": "string",
      "triggered_policy_ids": [
        "string"
      ],
      "user_id": "string",
      "workspace_id": "string"
    }
  ],
  "next_cursor": "string",
  "success": true
}
响应示例 (200)
{
  "count": 42,
  "has_more": true,
  "logs": [
    {
      "a2a_caller_workspace_id": "string",
      "a2a_parent_execution_id": "string",
      "a2a_target_agent_id": "string",
      "a2a_target_agent_name": "string",
      "completion_tokens": 42,
      "cost_usd": 42.0,
      "decision": "string",
      "duration_ms": 42.0,
      "error": "string",
      "execution_id": "string",
      "guardrail_action": "string",
      "guardrail_name": "string",
      "guardrail_type": "string",
      "id": "string",
      "inputs": {},
      "kind": "llm",
      "log_source": "string",
      "metadata": {},
      "model": "string",
      "org_id": "string",
      "pod_name": "string",
      "project_id": "string",
      "prompt_tokens": 42,
      "root_execution_id": "string",
      "root_session_id": "string",
      "session_id": "string",
      "span_id": "string",
      "status": "string",
      "step_number": 42,
      "timestamp": "2026-05-04T09:42:00Z",
      "tool": "string",
      "tool_api_error": {
        "classification": "string",
        "error_code": "string",
        "http_status": 42,
        "provider_type": "string",
        "reason": "string",
        "retryable": true
      },
      "tool_call_id": "string",
      "total_tokens": 42,
      "trace_id": "string",
      "triggered_policy_ids": [
        "string"
      ],
      "user_id": "string",
      "workspace_id": "string"
    }
  ],
  "next_cursor": "string",
  "success": true
}
响应示例 (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (401)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (401)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (425)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (425)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (500)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (500)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (502)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (502)
{
  "code": "string",
  "error": "string",
  "success": true
}