Closed jzaldi closed 1 month ago
We have an issue with nested pydantic models. The schema generated contains relative references and gemini api doesn't support that. I can implement a postprocessing function to get rid of refs in the meantime but is not ideal. @lkuligin wdyt?
Also I don't see any conflicts with what is being implemented in #469
Now we are only missing self referencing objects, something like this doesn't work and I don't think we can do anything about it if gemini's API doesn't support references:
class Status(BaseModel):
substatus: "Status"
This should also be added to ChatGoogleGenerativeAI
Reference: https://ai.google.dev/gemini-api/docs/structured-output
PR Description
Adds a keyword parameter
method='json_mode'
towith_structured_output
inChatVertexAI
to use controlled generation rather than function calling.Relevant issues
Fixes #531, #503, #345, #144
Type
🆕 New Feature
Example