ToolCall.Emit.Gemini (ToolCall v0.4.0)

Copy Markdown

Gemini function declaration (FunctionDeclaration).

Gemini's parameters field is a 22-field subset of OpenAPI 3.0, not JSON Schema: types are the uppercase Type enum, nullability is nullable: true, and the API rejects every field the subset does not declare. The emitter renders the shared schema and then:

  • uppercases type and rewrites type: [T, "null"] as nullable: true;
  • collapses an anyOf null branch into nullable: true;
  • drops additionalProperties (Gemini objects are open);
  • drops prefixItems (no positional tuples) and keeps minItems/maxItems;
  • keeps string enums with format: "enum" and drops non-string enums;
  • raises for $defs/$ref, which parameters cannot express.

The envelope is one declaration: {"name", "description", "parameters"}. strict is ignored because Gemini has no per-tool flag. When additionalProperties or recursion must be preserved, send parametersJsonSchema yourself. See the target matrix in docs/projection.md.

Summary

Functions

emit(tool, opts \\ [])

@spec emit(ToolCall.IR.Tool.t(), keyword()) :: map()