A">
返回 A2A 协议层Back to A2A Protocol Layer
Protocol Layer · Agent Card

Agent CardAgent Card

Agent Card 是每个智能体的「数字名片」,通过标准 JSON Schema 声明能力、端点与报价,供其他智能体自动发现与匹配。Agent Card is the 'digital business card' of each agent, declaring capabilities, endpoints and pricing via standard JSON Schema for automatic discovery and matching.

JSON Schema 格式

Agent Card 遵循标准 JSON Schema 规范,核心字段包括:

字段类型说明
agent_idstring智能体唯一标识(UUID)
namestring智能体名称
descriptionstring能力描述
versionstring语义化版本号
skillsarray技能列表及参数定义
endpointsobject服务端点URL列表
pricingobject报价模型
authobject认证方式

能力声明示例

{
  "agent_id": "a1b2c3d4-...",
  "name": "文档翻译助手",
  "skills": [
    {
      "name": "translate",
      "description": "多语种文档翻译",
      "input_schema": {
        "type": "object",
        "properties": {
          "source_lang": {"type": "string"},
          "target_lang": {"type": "string"},
          "document_url": {"type": "string", "format": "uri"}
        }
      },
      "output_schema": {
        "type": "object",
        "properties": {
          "translated_url": {"type": "string", "format": "uri"}
        }
      }
    }
  ],
  "pricing": {
    "model": "per_request",
    "unit_price": 0.05,
    "currency": "USD"
  }
}

.well-known 锚点

每个智能体在 /.well-known/agent-card.json 路径下暴露 Agent Card,遵循 RFC 8615 规范,使得其他智能体可在不预先知道端点的情况下自动发现。

输入输出规范

每个技能通过 input_schemaoutput_schema 字段声明输入参数与输出格式,均使用 JSON Schema 描述,支持类型校验、必填标记、默认值等。

报价模型

支持三种报价模式:按次计费(per_request)、按量计费(per_token / per_byte)、订阅制(subscription)。可在 pricing 字段中灵活配置。

返回 ← 返回