ToolCall. Schema. Gemini
(ToolCall v0.4.0)
Copy Markdown
Target-level schema adaptation that does not require ToolCall.IR.
to_gemini/2 rewrites a JSON Schema into Gemini's OpenAPI 3.0 parameters
subset. It is the transformation ToolCall.Emit.Gemini applies after rendering
a tool, exposed for callers that already hold a schema. It deliberately does
not perform the strict rewrite: that needs ToolCall.IR.Param.required and
remains owned by ToolCall.Emit.Schema. The root must be an object schema; a
multi-type type array raises instead of widening to {}, and a null-only
schema raises because Gemini has no null type.
Local $defs references are controlled by :on_ref:
:raise(default) refuses the schema, matchingToolCall.emit/3;:dropremoves$defsand$ref, leaving their sibling keywords;:inlinesubstitutes non-recursive definitions and raises on a cycle.
Summary
Functions
Rewrites schema into Gemini's parameters subset.