LangSchema.Converter.Google (LangSchema v0.7.1)
View SourceConverts a LangSchema into a JSON schema compatible with Gemini's Structured Outputs.
Supported JSON Schema spec
Reference: https://ai.google.dev/gemini-api/docs/structured-output
Supported types
string, number, integer, boolean, object, array, null
Supported keywords
type,title,description,enumproperties,required,additionalPropertiesitems,prefixItems,minItems,maxItemsminimum,maximum(number/integer)format(date-time,date,timefor strings)anyOf,$ref,$defs(since Nov 2025, Gemini 2.5+)nullablepropertyOrdering(Gemini 2.0+, implicit ordering in Gemini 2.5+)
Limitations
- Not all JSON Schema features are supported; unsupported properties are ignored.
- Very large or deeply nested schemas may be rejected.
LangSchema implementation status
| Keyword | Status |
|---|---|
type, description, enum (string only) | Supported |
properties, required | Supported |
items, minItems, maxItems | Supported |
format (integer, number, string) | Supported |
nullable | Supported (via "nullable": true) |
propertyOrdering | Supported (via ordered_properties option) |
title | Not yet implemented |
enum (number/integer) | Not yet implemented |
minimum, maximum | Not yet implemented |
additionalProperties | Not yet implemented |
prefixItems | Not yet implemented |
anyOf, $ref, $defs | Not yet implemented |