Google

Mastering Controlled Generation with Gemini 1.5: Schema Adherence for Developers- Google Developers Blog

Sep 3, 2024Lewis Liu, Terry Koo
Mastering Controlled Generation with Gemini 1.5: Schema Adherence for Developers- Google Developers Blog
SummaryAI, from the source post

This post introduces Controlled Generation for Gemini 1.5 Flash and adds 'enum' support, enabling developers to reliably generate responses that adhere to a defined schema. It also notes that controlled generation is automatically enabled when using function calling on Gemini 1.5. The post explains the importance of controlled generation for producing machine-readable data, seamless API integration, and predictable outputs. It details the 'response schema' concept, built on OpenAPI 3.0, and highlights Google's 'secret sauce' for controlled generation: minimal latency, enum support, and no data storage. Examples are provided for generating JSON recipes and classifying product condition with enum schemas.

More from the Predictive APIs and Machine Learning Integration trail