Here is an example of using a deeply nested Pydantic Schema with +30 fields, Union, Optionals and recursive structures with the new Sturctured Structured Outputs in the Gemini API! 💥
Note: To enable this you need to use the new `response_json_schema` parameter instead of the old `response_schema`. Documentation and Snippet below.
Documentation: ai.google.dev/gemini-api/doc…
Script: github.com/philschmid/gemini…
Nov 6, 2025 · 1:30 PM UTC

