Tool call fix for Spring AI - Let ADK call tools#733
Tool call fix for Spring AI - Let ADK call tools#733alexcheng1982 wants to merge 1 commit intogoogle:mainfrom
Conversation
Let ADK call tools
|
cc @ddobrin for your info |
|
Hi @alexcheng1982 It might be better that there is a (flexible) config which should allow for the selection of who should do function calling |
|
A couple of notes here:
The old code added both [link ](https://github.com/google/adk-java/blob/fba5f4fe41ac12f30ff68f9992051abbee17c2eb/contrib/spring-ai/src/main/java/com/google/adk/models/springai/MessageC
[link]( https://github.com/google/adk-java/blob/fba5f4fe41ac12f30ff68f9992051abbee17c2eb/contrib/spring-ai/src/main/java/com/google/adk/models/springai/MessageC |
In the current implementation of Spring AI integration, tool calls are handled by Spring AI, this means the code needs to handle the conversion between Spring AI tools and ADK tools. This is unnecessary and introduces serval issues, like
ToolContextisnull(see #699 ), before and after tool callbacks are not invoked.In this PR, tool calls are handled by ADK, just like other
BaseLlmimplementations.internalToolExecutionEnabledtofalseinToolCallingChatOptions.FunctionToolCallbackin Spring AI simply returns empty strings.FunctionToolCallbackis only used to pass tool definitions. The actual tool calls are handled by ADK.ToolResponseMessageinMessageConverter.