AS AgentScopeAPI 手册 / API Reference

AgentscopeA2aNacosAutoConfiguration

@AutoConfiguration @EnableConfigurationProperties({ AgentScopeNacosProperties.class, AgentScopeA2aNacosProperties.class }) @ConditionalOnProperty( prefix = NacosConstants.A2A_NACOS_PREFIX, name = "enabled", havingValue = "true", matchIfMissing = false) public class AgentscopeA2aNacosAutoConfiguration implements Closeable
源码Source io/agentscope/spring/boot/nacos/AgentscopeA2aNacosAutoConfiguration.java:48–147

Agentscope A 2 a Nacos Auto 配置,保存相关配置项。位于 io.agentscope.spring.boot.nacos 包,实现 Closeable。核心成员包括 close、nacosAgentCardResolver、nacosAgentRegistry、AgentscopeA2aNacosAutoConfiguration。

Spring Boot autoconfiguration that exposes A2A Nacos beans for AgentScope.

This AutoConfiguration will create a nacos client AiService to do A2A discovery and registry. This is to avoid conflicts with the Nacos client in the MCP registry center, which would otherwise prevent the configuration of different Nacos clusters to handle A2A and MCP separately.

构造器摘要Constructor Summary

构造器Constructor说明Description
public AgentscopeA2aNacosAutoConfiguration(AgentScopeNacosProperties nacosProperties, AgentScopeA2aNacosProperties a2aNacosProperties) throws NacosException
初始化 `AgentscopeA2aNacosAutoConfiguration` 实例。
Constructs a new instance of `AgentscopeA2aNacosAutoConfiguration`.

方法摘要Method Summary

方法Method说明Description
public void close() throws IOException
关闭连接并释放相关资源。
Closes the Nacos A2A service by shutting it down.
public AgentCardResolver nacosAgentCardResolver()
返回 `nacosAgentCardResolver` 结果。
Creates a bean for resolving agent cards from Nacos.
public AgentRegistry nacosAgentRegistry(AgentScopeA2aNacosProperties a2aNacosProperties)
设置该参数。
Creates a bean for registering agents to Nacos.

构造器详情Constructor Detail

AgentscopeA2aNacosAutoConfiguration

public AgentscopeA2aNacosAutoConfiguration(AgentScopeNacosProperties nacosProperties, AgentScopeA2aNacosProperties a2aNacosProperties) throws NacosException

初始化 AgentscopeA2aNacosAutoConfiguration 实例。

Constructs a new instance of AgentscopeA2aNacosAutoConfiguration.

参数Parameters
名称Name类型Type说明Description
nacosPropertiesAgentScopeNacosPropertiesNacos 属性(类型 `AgentScopeNacosProperties`)。the basic Nacos properties
a2aNacosPropertiesAgentScopeA2aNacosPropertiesa 2 a Nacos 属性(类型 `AgentScopeA2aNacosProperties`)。the A2A Nacos properties
抛出Throws
  • NacosException 可能抛出 `NacosException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/spring/boot/nacos/AgentscopeA2aNacosAutoConfiguration.java:72–77

方法详情Method Detail

close

public void close() throws IOException

关闭连接并释放相关资源。

Closes the Nacos A2A service by shutting it down.

抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/spring/boot/nacos/AgentscopeA2aNacosAutoConfiguration.java:93–103

nacosAgentCardResolver

public AgentCardResolver nacosAgentCardResolver()

返回 nacosAgentCardResolver 结果。

Creates a bean for resolving agent cards from Nacos.

返回Returns AgentCardResolver
一种实例的`NacosAgentCardResolver`。an instance of `NacosAgentCardResolver`
源码Source io/agentscope/spring/boot/nacos/AgentscopeA2aNacosAutoConfiguration.java:110–118

nacosAgentRegistry

public AgentRegistry nacosAgentRegistry(AgentScopeA2aNacosProperties a2aNacosProperties)

设置该参数。

Creates a bean for registering agents to Nacos.

参数Parameters
名称Name类型Type说明Description
a2aNacosPropertiesAgentScopeA2aNacosPropertiesa 2 a Nacos 属性(类型 `AgentScopeA2aNacosProperties`)。the A2A Nacos properties
返回Returns AgentRegistry
一种实例的`NacosAgentRegistry`。an instance of `NacosAgentRegistry`
源码Source io/agentscope/spring/boot/nacos/AgentscopeA2aNacosAutoConfiguration.java:126–136
基于官方固定版本源码静态生成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.