-
Notifications
You must be signed in to change notification settings - Fork 2.1k
anthropic fix #4733
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
anthropic fix #4733
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
Modified explicit_tool_calling_supported
to disable tool calling for Anthropic models due to UI limitations and sequential tool calling constraints.
- Added comprehensive test coverage in
backend/tests/unit/onyx/tools/test_utils.py
with parameterized scenarios for Anthropic and non-Anthropic models - Modified
backend/onyx/tools/utils.py
to check against both provider name andlitellm.anthropic_models
list - Added clear documentation explaining why Anthropic models need to be treated as non-tool-calling (UI limitations and error patterns)
- Implemented fail-safe checks to prevent tool calling when model is in
litellm.anthropic_models
list, even if provider name differs
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
* anthropic fix * naming
* anthropic fix * naming
* anthropic fix * naming
* anthropic fix * naming
Description
https://linear.app/danswer/issue/DAN-1990/fix-anthropic-tool-calling
Revert behavior from anthropic models to not use their tool calling support. Anthropic models generate text before and after tool calls, and also throw an error if they are provided tool call messages from an earlier conversation without corresponding tools. Because we don't support sequential tool calling and it makes our UI ugly, we treat anthropic as non-tool-calling.
How Has This Been Tested?
tested in UI and added a unit test
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.