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

请求头

Header是否必填说明
AuthorizationBearer <PAT>

路径参数

参数类型是否必填说明
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_PAT"

示例响应

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",
    "vault_ids": [
      "vault_crm"
    ],
    "resources": [
      {
        "type": "file",
        "file_id": "file_019eXXXX",
        "mount_path": "/data/policy.md"
      }
    ]
  }
}

响应字段

字段类型说明
typestring固定为 effective_spec
agent_effective_hashstringAgent 部分编译结果 hash。
session_effective_hashstringSession 部分编译结果 hash。
effective_hashstring完整有效配置 hash。
agentobject编译后的 Agent 配置。
sessionobject编译后的 Session 默认配置。

错误

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

注意事项

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

相关

获取 Identity Config

创建 Session