AS AgentScopeAPI 手册 / API Reference

AgentCardConverterUtil

public class AgentCardConverterUtil
源码Source io/agentscope/core/nacos/a2a/utils/AgentCardConverterUtil.java:47–243

智能体卡片转换器 Util,支持智能体之间的发现、委派与协作。位于 io.agentscope.core.nacos.a2a.utils 包。核心成员包括 convertToA2aAgentCard、convertToNacosAgentCard。

AgentCard Converter between Nacos AgentCard and A2A specification io.a2a.spec.AgentCard.

This utility also converts sub-specifications when converting AgentCard:

  • Nacos AgentInterface and A2A io.a2a.spec.AgentInterface.

  • Nacos AgentProvider and A2A io.a2a.spec.AgentProvider.

  • Nacos AgentCapabilities and A2A io.a2a.spec.AgentCapabilities.

  • Nacos AgentSkill and A2A io.a2a.spec.AgentSkill.

Unlike the sub-specifications listed above, SecurityScheme is handled differently. All types of A2A io.a2a.spec.SecurityScheme are serialized and stored as a generic Map representation, and Nacos does not retain or expose the concrete subtype of io.a2a.spec.SecurityScheme.

方法摘要Method Summary

方法Method说明Description
public static io.a2a.spec.AgentCard convertToA2aAgentCard(AgentCard agentCard)
static
转换到 A 2 a 智能体卡片。
Converts Nacos AgentCard object to A2A specification AgentCard object.
public static AgentCard convertToNacosAgentCard(io.a2a.spec.AgentCard agentCard)
static
转换 `convertToNacosAgentCard`。
Converts A2A specification AgentCard object to Nacos AgentCard object.

方法详情Method Detail

convertToA2aAgentCard

public static io.a2a.spec.AgentCard convertToA2aAgentCard(AgentCard agentCard)
static

转换到 A 2 a 智能体卡片。

Converts Nacos AgentCard object to A2A specification AgentCard object.

参数Parameters
名称Name类型Type说明Description
agentCardAgentCard智能体卡片(类型 `AgentCard`)。the Nacos AgentCard object
返回Returns io.a2a.spec.AgentCard
返回io.A2A.规格.AgentCard。the converted A2A specification AgentCard object, or null if input is null
源码Source io/agentscope/core/nacos/a2a/utils/AgentCardConverterUtil.java:55–82

convertToNacosAgentCard

public static AgentCard convertToNacosAgentCard(io.a2a.spec.AgentCard agentCard)
static

转换 convertToNacosAgentCard。

Converts A2A specification AgentCard object to Nacos AgentCard object.

参数Parameters
名称Name类型Type说明Description
agentCardio.a2a.spec.AgentCard智能体卡片(类型 `io.a2a.spec.AgentCard`)。the A2A specification AgentCard object
返回Returns AgentCard
返回AgentCard。the converted Nacos AgentCard object
源码Source io/agentscope/core/nacos/a2a/utils/AgentCardConverterUtil.java:159–183
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.