-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix(google-genai): handle tool_calls when the message contains other content #8005
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
CC @afirstenberg if you have a minute! |
Whats the status on this? I'm seeing the issue when using Librechat with a Gemini-based agent. Leading to failed requests because langchain-google-genai is dropping the tool messages. |
@benjamincburns @afirstenberg hoping to see this merged, lgtm! |
@andantonyan if you're still around & able would you be willing to add one or more tests for this? I'm afraid that the complexity here is a bit beyond what I'm comfortable merging without test updates. That said, if @afirstenberg is able to review and is happy w/ the change, then I'm happy to merge & release. |
Hi @benjamincburns , Thanks for your comment and the review. Regarding the tests, what kind of tests would you like to see added? I'll be available from mid next week and will be happy to allocate some time for this. As you mentioned, let's also wait to hear from @afirstenberg – perhaps if they are happy with the changes, additional tests won't be needed for merging. Thanks |
Ideally readable unit tests that target each branch of |
I've added the unit tests for Ready for another look when you get a chance. |
Thanks for the contribution @andantonyan! |
This update modifies convertMessageContentToParts to ensure that tool_calls on a message are processed even when the message also contains content (either as a string or an array). Previously, the presence of content could lead to tool_calls being overlooked. This change correctly converts both textual/array content and any accompanying tool_calls into their respective Google AI Part structures within the same message conversion.