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–76Agentscope 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 |
|---|---|---|
nacosProperties | AgentScopeNacosProperties | Nacos 属性(类型 `AgentScopeNacosProperties`)。The nacos properties. |
promptNacosProperties | AgentScopeNacosPromptProperties | 提示词 Nacos 属性(类型 `AgentScopeNacosPromptProperties`)。The prompt nacos properties. |
AiService返回AiService。Returns ai service.
NacosException可能抛出 `NacosException`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/spring/boot/nacos/AgentscopeNacosPromptAutoConfiguration.java:60–69nacosPromptListener
public NacosPromptListener nacosPromptListener(AiService agentscopePromptAiService)
设置该参数。
Performs the nacos prompt listener operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentscopePromptAiService | AiService | agentscope 提示词 Ai 服务(类型 `AiService`)。The agentscope prompt ai service. |
NacosPromptListener返回NacosPromptListener。Returns nacos prompt listener.
源码Source
io/agentscope/spring/boot/nacos/AgentscopeNacosPromptAutoConfiguration.java:71–75