Skip to main content
Identities

获取 Effective Config

获取 Identity + Template 编译后的最终运行时配置。

GET /api/v1/forward/identities/{identity_id}/templates/{template_id}/effective 返回 Template 基线叠加 Identity Config 后的有效配置。响应面向运行时执行,不返回 enabledop 等 Forward DSL 字段。

请求头

Header是否必填说明
AuthorizationBearer <PAT 或 SAT>

路径参数

参数类型是否必填说明
identity_idstringForward Identity ID。
template_idstringForward Template ID。

示例请求

curl -s -X GET 'https://api.qoder.com/api/v1/forward/identities/idn_019eabc123/templates/tmpl_support/effective' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

示例响应

HTTP 200 OK
{
  "type": "effective_spec",
  "id": "config_123",
  "identity_id": "idn_019eabc123",
  "template_id": "tmpl_support",
  "agent_effective_hash": "sha256:...",
  "session_effective_hash": "sha256:...",
  "effective_hash": "sha256:...",
  "agent": {
    "model": "ultimate",
    "system": "You are a support assistant.\nPrefer CRM data when answering.",
    "tools": [
      {
        "type": "agent_toolset_20260401",
        "configs": [
          {
            "name": "Read",
            "enabled": true
          },
          {
            "name": "Grep",
            "enabled": true
          },
          {
            "name": "WebSearch",
            "enabled": false
          }
        ]
      }
    ],
    "mcp_servers": [],
    "skills": []
  },
  "session": {
    "environment_id": "env_support",
    "environment_variables": {
      "BASE_MODE": "identity",
      "USER_MODE": "enabled"
    },
    "vault_ids": [
      "vault_019f18f2761b"
    ],
    "resources": [
      {
        "type": "file",
        "file_id": "file_019eXXXX"
      },
      {
        "type": "github_repository",
        "url": "https://github.com/acme/support-agent",
        "mount_path": "/data/workspace/support-agent"
      }
    ]
  }
}

响应字段

字段类型说明
typestring固定为 effective_spec
agent_effective_hashstringAgent 部分编译结果 hash。
session_effective_hashstringSession 部分编译结果 hash。
effective_hashstring完整有效配置 hash。
agentobject编译后的 Agent 配置。
sessionobject编译后的 Session 默认配置。
session.environment_variablesobject|stringTemplate 与 Identity Config 合并后的最终环境变量。

错误

HTTPTypeCode触发条件
400invalid_request_error-Effective Config 无法编译。
404not_found_error-Identity 或 Template 不存在。
422invalid_request_error-运行时配置校验失败。
401authentication_errorauthentication_requiredPAT 或 SAT 无效或已过期。

备注

  • Identity Config 按字段级合并规则覆盖 Template 基线。
  • 没有 Identity Config 时按空覆盖层处理。
  • 默认 Memory Store 注入由创建 Session 流程处理。

相关