upgrade litellm>1.80.5 and fixes#66
Conversation
|
@jph00 I've created an issue for the anthropic web search problems in litellm BerriAI/litellm#17737 and it looks like they've already merged a fix. According to this comment it might not be working for streaming yet though. Their fix make sures the web search results are now inlcuded during Anthropic messages construction, so we don't need to remove it from I would say let's wait for them to completely fix it and make a new release with it, and then we can update this PR to use that newer release with the required fixes. Note: I've tested previously failing example from the main branch and it works fine: |
|
v1.80.9.dev6 release has all the fixes, we'll just need to wait for the pypi release |
|
Thanks for keeping an eye on it @KeremTurgutlu :) |
Fixes #64
This PR upgrades
litellm>1.80.5and fixes issues related to web search tool being added toMessage.tool_callsTL;DR: Keeping the server tool call in
tool_callscauses the following issue:So I've ended up removing web search from the
tool_callswhich is the current behavior before this upgrade. This not ideal as model has no idea whether it has used web search or not. This can be seen in this issue which from the current main branch and not related to this upgrade.Iterative Fixes Tried
{}in function arguments whenstream=True. This causes a JSON decoding error whentool_callsis provided in the next turn.This can be fixed by
_strip_fargs().web_searchis now included intool_callswhich are the tools expected to be run. So we can fix this by filtering out server tools during tool response generation which will skip server tools:stream=True/False, for example:This is can be fixed by removing the server tool call from the history when
tool_callsincludes a mix:A separate issue to fix this is also created.
Update: Even just keeping the server tool call in
tool_callscauses an issue:Note: Recreated
cachy.jsonlfrom scratch to make sure that all the completions work as expected.