-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Google Gen AI Structured Output Error #6901
Comments
I found a similar issue that might be relevant to your problem: No tools_call in message error on ChatVertexAI. This issue was closed, and the solution involved ensuring that the input message and schema were correctly aligned with the expected output from the model [1]. To resolve the "No parseable tool calls provided to GoogleGenerativeAIToolsOutputParser" error, ensure that the const generations = [
{
message: {
tool_calls: [
{
args: {
// your tool call arguments here
}
}
]
}
}
]; Make sure your input data is correctly formatted to include the necessary |
Does this persist with larger models? What if you prompt more strictly to include something like "you must always use tools if available"? Unfortunately tool calling/structured output isn't perfect in all cases - CC @bracesproul to make sure we're doing all we can here. |
I don't understand, I am just using it for structured output without requiring it to use any tools. |
hey there - running into the same issue and I believe it's because Also relevant is that it looks like "forced function calling" support with "mode: any" was only recently added for Gemini Flash: google-gemini/generative-ai-js#190. I don't think a change is needed specifically to support flash, but would be great if we could update I think just accepting a param for |
Hi there! We are a group of 3 students from the University of Toronto and we are very interested in fixing this issue and also adding some tests. We will submit a PR for this issue by end of November. |
Yes please! Will assign it to you @BaharChidem. |
We are running into the same issue. If there is anything we can help with, let me know. |
I have switched to vercel's generateObject, life is so much easier now! |
Any update on this issue? Thanks |
@tonyabracadabra could you send me an example zod schema that will trigger this error? |
I believe any zod schema would trigger this if no tools were specified somewhere within |
We are continuing to work on the issue and hope to have a PR up by the end of next week. We are currently just finding difficulties with replicating the issue in our Linux VMs, but hope to get this resolved soon. Thanks! |
@BaharChidem thanks a lot! |
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
When attempting to generate structured output using Google's Generative AI (Gemini) through LangChain, an error occurs:
CopyError: No parseable tool calls provided to GoogleGenerativeAIToolsOutputParser.
Context
The error occurs when using the ChatGoogleGenerativeAI class from @langchain/google-genai.
The code is attempting to use structured output with a Zod schema.
The model being used is "gemini-1.5-flash".
System Info
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.5.0: Wed May 1 20:17:33 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6031
Available memory (MB): 98304
Available CPU cores: 14
Binaries:
Node: 20.11.1
npm: 10.2.4
Yarn: N/A
pnpm: 9.6.0
Relevant Packages:
next: 15.0.0-canary.160 // There is a newer canary version (15.0.0-canary.173) available, please upgrade!
eslint-config-next: 15.0.0-canary.69
react: 19.0.0-rc-778e1ed2-20240926
react-dom: 19.0.0-rc-778e1ed2-20240926
typescript: 5.6.2
Next.js Config:
output: N/A
The text was updated successfully, but these errors were encountered: