AS AgentScopeAPI 手册 / API Reference

AgentscopeNacosPromptAutoConfiguration

@AutoConfiguration @AutoConfigureBefore(AgentscopeAutoConfiguration.class) @EnableConfigurationProperties({ AgentScopeNacosProperties.class, AgentScopeNacosPromptProperties.class, AgentscopeProperties.class }) @ConditionalOnClass(NacosPromptListener.class) @ConditionalOnProperty( prefix = NacosConstants.NACOS_PROMPT_PREFIX, name = "enabled", havingValue = "true", matchIfMissing = false) public class AgentscopeNacosPromptAutoConfiguration
源码Source io/agentscope/spring/boot/nacos/AgentscopeNacosPromptAutoConfiguration.java:45–76

Agentscope Nacos 提示词 Auto 配置,保存相关配置项。位于 io.agentscope.spring.boot.nacos 包。核心成员包括 agentscopePromptAiService、nacosPromptListener。

Auto-configuration that builds ReActAgent from prompts stored in Nacos.

When this starter is on the classpath and agentscope.nacos.prompt.enabled=true, the Agent's system prompt will be loaded from Nacos via NacosPromptListener. The Nacos prompt takes precedence over agentscope.agent.sys-prompt defined in YAML, with the YAML value still acting as a default fallback.

方法摘要Method Summary

方法Method说明Description
public AiService agentscopePromptAiService(AgentScopeNacosProperties nacosProperties, AgentScopeNacosPromptProperties promptNacosProperties) throws NacosException
执行 `agentscopePromptAiService` 方法。
Performs the agentscope prompt ai service operation.
public NacosPromptListener nacosPromptListener(AiService agentscopePromptAiService)
设置该参数。
Performs the nacos prompt listener operation.

方法详情Method Detail

agentscopePromptAiService

public AiService agentscopePromptAiService(AgentScopeNacosProperties nacosProperties, AgentScopeNacosPromptProperties promptNacosProperties) throws NacosException

执行 agentscopePromptAiService 方法。

Performs the agentscope prompt ai service operation.

参数Parameters
名称Name类型Type说明Description
nacosPropertiesAgentScopeNacosPropertiesNacos 属性(类型 `AgentScopeNacosProperties`)。The nacos properties.
promptNacosPropertiesAgentScopeNacosPromptProperties提示词 Nacos 属性(类型 `AgentScopeNacosPromptProperties`)。The prompt nacos properties.
返回Returns AiService
返回AiService。Returns ai service.
抛出Throws
  • NacosException 可能抛出 `NacosException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/spring/boot/nacos/AgentscopeNacosPromptAutoConfiguration.java:60–69

nacosPromptListener

public NacosPromptListener nacosPromptListener(AiService agentscopePromptAiService)

设置该参数。

Performs the nacos prompt listener operation.

参数Parameters
名称Name类型Type说明Description
agentscopePromptAiServiceAiServiceagentscope 提示词 Ai 服务(类型 `AiService`)。The agentscope prompt ai service.
返回Returns NacosPromptListener
返回NacosPromptListener。Returns nacos prompt listener.
源码Source io/agentscope/spring/boot/nacos/AgentscopeNacosPromptAutoConfiguration.java:71–75
基于官方固定版本源码静态生成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.