-
Notifications
You must be signed in to change notification settings - Fork 102
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
Confusing function calling with AnthropicChatModel
#220
Comments
With https://github.com/jackmpcollins/magentic/releases/tag/v0.24.0 or earlier this should be working as expected because the response is not streamed so can be viewed in full when parsing. But with the new streaming approach it breaks as you describe because based on the first chunks this looks like a string response. It looks like the In future maybe a way to expose this is to allow |
I like the idea of extending I'll give some feedback on #226 once I'm able to try it out (should be the next few days). Thanks for the fast turnaround! |
Hi @jackmpcollins 👋 ,
I'm running into a weird issue with the
AnthropicChatModel
. I'm unsure how to capture function calls that occur when the model also outputs text inside of<thinking></thinking>
tags (which Anthropic do in order to use chain-of-thought style prompting to improve accuracy with function calls).How do I get access to the underlying
FunctionCall
when both text and function calling output is provided by the LLM?The following example illustrates what I mean:
Which produces the following output:
But no function call.
If I only type decorate with the
FunctionCall
, then the function call is returned. But I don't want to force the LLM into a function call if it isn't necessary.Thanks!
The text was updated successfully, but these errors were encountered: