Repository navigation
Why not place the tool calling logic in the ChatClient implementation, rather than delegating it to the ChatModel when interacting with the model provider? #4105
hongling-dev
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
It's hypothesized that during design, function calls were thought to be a capability only some models possess, so placing them in the model provider layer (i.e., ChatModel) would be more appropriate. However, as model provider products evolve, they all end up supporting function call capabilities (which is indeed the case, as most models in the market now support function calls). This would lead to ChatModel layer implementations being remarkably similar, resulting in code duplication and redundancy.
Perhaps we can discuss a new implementation approach? For example, abstracting a dedicated tool calling component to handle the current tool calling and model recursive calling logic in ChatModel? Welcome to contribute your ideas, thank you.
Context:ChatModel tool call
org.springframework.ai.openai.OpenAiChatModel#internalCall
All reactions