Skip to content
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

ChatGoogleGenerativeAI Error using .with_structured_output() #615

Open
leowalker89 opened this issue Nov 24, 2024 · 3 comments
Open

ChatGoogleGenerativeAI Error using .with_structured_output() #615

leowalker89 opened this issue Nov 24, 2024 · 3 comments

Comments

@leowalker89
Copy link

When I was trying to use ChatGoogleGenerativeAI.with_structured_output(PydanticObject) I kept on getting an error. I'm able to successfully use this with OpenAI, Groq, and xAI but failed with both Gemini-1.5-Pro-002 and Gemini-1.5-Flash-002.

Error can be found here:
https://gist.github.com/leowalker89/86c8318c2dc463a7ce02e22e187017d1

Example code of the Pydantic Models and the various frontier models:
https://gist.github.com/leowalker89/0b8e1d8679e052490eec9028aeb832cf

@code-wizard
Copy link

I am facing similar issue with gemini-1.5-pro

@marfago
Copy link

marfago commented Dec 7, 2024

I am facing a similar problem and I think it is related to a bug here:

if "title" in schema:
items["title"] = schema

where the title is not properly handled. Commenting these 2 lines fixes the issue.
Also, the second line seems wrong (should it be items["title"] = schema.get("title")?).

@RobSisson
Copy link

May be connected with issues discussed in this issue: #659

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants