-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
版本:1.1.0.0-RC2
项目使用实现chatbot,结合spring-ai-alibaba-admin动态管理prompt
依赖项:
spring-ai-alibaba-studio
spring-ai-alibaba-starter-config-nacos
`protected void registryPrompt(NacosOptions nacosOptions, ReactAgent reactAgent, ObservationMetadataAwareOptions observationMetadataAwareOptions, String promptKey) {
Listener listener = new AbstractListener() {
@Override
public void receiveConfigInfo(String configInfo) {
PromptVO promptVO = JSON.parseObject(configInfo, PromptVO.class);
try {
Map<String, String> metadata = getMetadata(promptVO);
observationMetadataAwareOptions.getObservationMetadata().putAll(metadata);
reactAgent.setInstruction(promptVO.getTemplate());
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
};`
动态更新的instruction属性,但在ExecutionController.executeAgent 方法中,调用的是agent.stream方法,并没有使用到instruction属性
经 @Aias00 提醒,其实在AgentToSubCompiledGraphNodeAdapter中是有完整的instruction属性的使用的。但agent.stream中缺失了这段逻辑
Expected Behavior
No response
Steps To Reproduce
No response
Environment
Spring AI Alibaba version(s):Debug logs
No response
Anything else?
No response