-
Notifications
You must be signed in to change notification settings - Fork 279
feat(extensions): Add dynamic loading of ReActAgent system prompts from Nacos #760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- extension 模块新增NacosPromptListener用于监听和获取Nacos中的提示模板 - 更新 agentscope-nacos-spring-boot-starter,新增AgentscopeNacosPromptAutoConfiguration自动配置类,新增AgentScopeNacosPromptProperties配置属性类,新增AgentscopeNacosReActAgentAutoConfiguration自动配置类,更新spring.factories注册新的自动配置类,添加对agentscope-spring-boot-starter和agentscope-core的依赖声明
|
|
Summary of ChangesHello @Sunrisea, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates Nacos for dynamic management of system prompts within the AgentScope framework, specifically for ReActAgents. It introduces a new listener to fetch and update prompts from Nacos, along with Spring Boot auto-configuration to seamlessly enable this functionality. This allows for externalized and real-time configurable agent prompts, improving flexibility and operational control over AI agent behavior. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a valuable feature for dynamically loading ReActAgent system prompts from Nacos. The implementation is well-structured, adding a NacosPromptListener and corresponding Spring Boot auto-configuration classes. The code is clean and follows good practices for creating starters. My review includes a few suggestions to enhance code quality, focusing on immutability, performance, and code clarity. Overall, this is a solid contribution.
...-extensions-nacos-a2a/src/main/java/io/agentscope/core/nacos/prompt/NacosPromptListener.java
Outdated
Show resolved
Hide resolved
...-extensions-nacos-a2a/src/main/java/io/agentscope/core/nacos/prompt/NacosPromptListener.java
Show resolved
Hide resolved
...er/src/main/java/io/agentscope/spring/boot/nacos/AgentscopeNacosPromptAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/agentscope/spring/boot/nacos/AgentscopeNacosReActAgentAutoConfiguration.java
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- 修改配置属性合并逻辑,使用显式配置覆盖而非默认值覆盖 - 添加getExplicitNacosProperties方法用于获取仅包含显式配置的属性 - 重构BaseNacosProperties中的属性构建逻辑 - 增加测试用例验证全局配置不会被未设置的提示配置覆盖
AlbumenJ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LearningGp PTAL
AgentScope-Java Version
[The version of AgentScope-Java you are working on, e.g. 1.0.8, check your pom.xml dependency version or run
mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]1.0.9-SNAPSHOT
Description
Added NacosPromptListener in the extension module to listen for and retrieve
prompt templates from Nacos
Updated agentscope-nacos-spring-boot-starter:
• Added AgentscopeNacosPromptAutoConfiguration auto-configuration class
• Added AgentScopeNacosPromptProperties configuration properties class
• Added AgentscopeNacosReActAgentAutoConfiguration auto-configuration class
• Updated spring.factories to register new auto-configuration classes
• Added dependency declarations for agentscope-spring-boot-starter
and agentscope-core
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)