LangSchema.Converter.Google (LangSchema v0.7.1)

View Source

Converts 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, enum
  • properties, required, additionalProperties
  • items, prefixItems, minItems, maxItems
  • minimum, maximum (number/integer)
  • format (date-time, date, time for strings)
  • anyOf, $ref, $defs (since Nov 2025, Gemini 2.5+)
  • nullable
  • propertyOrdering (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

KeywordStatus
type, description, enum (string only)Supported
properties, requiredSupported
items, minItems, maxItemsSupported
format (integer, number, string)Supported
nullableSupported (via "nullable": true)
propertyOrderingSupported (via ordered_properties option)
titleNot yet implemented
enum (number/integer)Not yet implemented
minimum, maximumNot yet implemented
additionalPropertiesNot yet implemented
prefixItemsNot yet implemented
anyOf, $ref, $defsNot yet implemented