-
Notifications
You must be signed in to change notification settings - Fork 137
feat(spring-boot-starter-adk): Add Spring Boot Starter support #418
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
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.
Summary of Changes
Hello @TomorJM, 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 significantly enhances the usability of the Agent Development Kit (ADK) by introducing a dedicated Spring Boot Starter. This addition streamlines the process for developers to integrate and utilize ADK's functionalities within their Spring Boot applications, enabling out-of-the-box component activation and reducing manual configuration efforts.
Highlights
- New Spring Boot Starter Module: A new module, spring-boot-starter-adk, has been introduced under contrib/ to simplify the integration of the Agent Development Kit (ADK) into Spring Boot applications.
- Automatic Configuration: The AdkSpringbootAutoConfiguration class has been added to provide automatic configuration for ADK components within Spring Boot, along with the necessary auto-configuration imports file.
- Dependency Management: The new starter module includes core ADK modules (google-adk, google-adk-dev) as dependencies, along with standard Spring Boot test dependencies (spring-boot-starter-test, mockito-core).
- Integration Testing: Comprehensive integration tests have been added for the starter to ensure proper functionality and integration with Spring Boot's testing utilities.
- API Visibility Enhancement: The AgentStaticLoader class has been made public to allow for external instantiation, supporting its use within the Spring Boot context.
- Parent POM Integration: The new spring-boot-starter-adk module has been registered in the parent pom.xml, making it part of the main project build.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
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 .gemini/
folder in the base of the repository. Detailed instructions can be found here.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 Spring Boot starter for the Agent Development Kit (ADK), which is a valuable addition for simplifying integration with Spring Boot applications. The overall structure is good, but there is a critical issue in the auto-configuration implementation. The current @ComponentScan
is too broad and will likely cause conflicts with a user's application. My review provides a suggestion to mitigate this. I have also included some recommendations to improve the pom.xml
configuration and maintain code consistency in the test file.
...ter-adk/src/main/java/com/google/adk/starters/springboot/AdkSpringbootAutoConfiguration.java
Outdated
Show resolved
Hide resolved
<groupId>com.google.adk</groupId> | ||
<artifactId>google-adk-dev</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> |
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.
To improve the developer experience, it's a good practice for starters to include spring-boot-configuration-processor
as an optional dependency. This enables IDEs to provide auto-completion and documentation for your custom configuration properties (like those defined for adk.web
).
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
...n/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
Outdated
Show resolved
Hide resolved
...t-starter-adk/src/test/java/com/google/adk/starters/springboot/AdkSpringbootStarterTest.java
Outdated
Show resolved
Hide resolved
9977115
to
7f0229e
Compare
…date the project structure
7f0229e
to
dcad622
Compare
Would you mind sharing a bit of the value prop of this starter (and why it should live under contrib/ as opposed to samples/? We'd recently improved the AdkWebServer to let you construct instances of it with your agents without going through dynamic agent loading (see here) to make it less tied to running through the dev package. |
This commit introduces a new Spring Boot Starter module for the Agent Development Kit (ADK),
making it easier for developers to integrate ADK into Spring Boot applications.
Changes include:
The purpose of this starter is to activate the entire component functionality, enabling developers to use it out of the box.
But I'm not sure which functionalities should be placed in the starter. For example, whether it's necessary to provide annotation scanning or a class like AgentFactory, allowing developers to register their Agents as Beans. Whether such a design is needed requires further discussion.