upgrade litellm>1.80.5 and fixes
#66
Draft
+479
−702
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.