Skip to content

Conversation

@jitokim
Copy link
Contributor

@jitokim jitokim commented Apr 8, 2025

This PR addresses spring-projects/spring-ai#2632.

  • Add spring-ai-autoconfigure-tool module
  • Add @EnableToolCallbackAutoRegistration to enable auto-registration
  • Add ToolCallbackAutoRegistrar using ImportBeanDefinitionRegistrar
  • Add ToolAnnotatedBeanProcessor to collect @Tool-annotated methods and register a MethodToolCallbackProvider

@jitokim jitokim force-pushed the GH-2632 branch 3 times, most recently from e79c6c6 to 4aa97ac Compare April 8, 2025 08:21
@jitokim jitokim marked this pull request as ready for review April 8, 2025 08:53
@jitokim
Copy link
Contributor Author

jitokim commented Apr 8, 2025

Improve the process so that each Tool method doesn’t need to be registered manually with MethodToolCallbackProvider.

@tzolov tzolov self-assigned this May 10, 2025
@tzolov tzolov added this to the 1.0.0-RC1 milestone May 10, 2025
@markpollack markpollack modified the milestones: 1.0.0-RC1, 1.0.x May 11, 2025
jitokim added 5 commits May 19, 2025 13:18


- Add @EnableToolCallbackAutoRegistration to enable auto-registration
- Add ToolCallbackAutoRegistrar using ImportBeanDefinitionRegistrar
- Add ToolAnnotatedBeanProcessor to collect @Tool-annotated methods and register a MethodToolCallbackProvider

Signed-off-by: jitokim <[email protected]>
…clarity

This commit refactors `ToolCallbackAutoRegistrar` to improve its
reliability, clarity, and initialization process.

Key changes include:
- Consolidated tool callback registration logic by integrating
  responsibilities from the (now removed) `ToolAnnotatedBeanProcessor`.
  This simplifies the auto-configuration flow for @tool annotated methods.
- Deferred tool scanning and `MethodToolCallbackProvider` registration
  until `ApplicationReadyEvent`. This ensures that the operation occurs
  only after the application context and all relevant beans are fully
  initialized, enhancing stability.

Signed-off-by: jitokim <[email protected]>
@jitokim
Copy link
Contributor Author

jitokim commented May 19, 2025

962d2ed rebase & refactor

@markpollack markpollack removed this from the 1.1.0.M1 milestone Sep 25, 2025
@markpollack
Copy link
Member

@ilayaperumalg outdated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants