Class AgentCardConverterUtil

java.lang.Object
io.agentscope.core.nacos.a2a.utils.AgentCardConverterUtil

public class AgentCardConverterUtil extends Object
AgentCard Converter between Nacos AgentCard and A2A specification AgentCard.

This utility also converts sub-specifications when converting AgentCard:

  • Nacos AgentInterface and A2A AgentInterface.
  • Nacos AgentProvider and A2A AgentProvider.
  • Nacos AgentCapabilities and A2A AgentCapabilities.
  • Nacos AgentSkill and A2A AgentSkill.

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

  • Constructor Details

    • AgentCardConverterUtil

      public AgentCardConverterUtil()
  • Method Details

    • convertToA2aAgentCard

      public static io.a2a.spec.AgentCard convertToA2aAgentCard(com.alibaba.nacos.api.ai.model.a2a.AgentCard agentCard)
      Converts Nacos AgentCard object to A2A specification AgentCard object.
      Parameters:
      agentCard - the Nacos AgentCard object
      Returns:
      the converted A2A specification AgentCard object, or null if input is null
    • convertToNacosAgentCard

      public static com.alibaba.nacos.api.ai.model.a2a.AgentCard convertToNacosAgentCard(io.a2a.spec.AgentCard agentCard)
      Converts A2A specification AgentCard object to Nacos AgentCard object.
      Parameters:
      agentCard - the A2A specification AgentCard object
      Returns:
      the converted Nacos AgentCard object