Closed mnicstruwig closed 5 months ago
This only occurs if we're using function calling (or using annotated outputs, which uses function calling under the hood).
This is a litellm bug. I've opened https://github.com/BerriAI/litellm/issues/2644
Magentic should have more tests for litellm w/ tools/functions now that they support it for these models. I've made an issue for that too https://github.com/jackmpcollins/magentic/issues/154
Thanks! I figured as much after trying to replicate -- your issue nails the root cause perfectly.
Re: more tests, it makes sense. In < 1 month we've gone from zero to four GPT-4 level models (Gemini, Claude 3, Mistral Large, Pi 2.5 (rip)). Each has different pros / cons, so I'm anticipating people will start mixing and matching in their workflows (like I'm doing at the moment).
This was fixed in litellm v1.33.7
and corresponding fixes to magentic released in https://github.com/jackmpcollins/magentic/releases/tag/v0.18.1
There is still the separate issue of litellm parsing Claude tool_call responses which affects using tool calling with Claude https://github.com/BerriAI/litellm/pull/2640 / https://github.com/jackmpcollins/magentic/issues/151
I can confirm that
async
completion works via LiteLLM:Output:
However, when I try using magentic, things fail:
But it works when I use an OpenAI model via
litellm
though:Output: