Pure data transformation utilities to serialize ALTAR ADM tool structures into the exact JSON maps expected by the Gemini API.
- Converts snake_case atom keys to camelCase string keys
- Shapes
FunctionDeclarationinto the correctToollist payload - Shapes
ToolConfiginto%{functionCallingConfig: %{...}}
Summary
Functions
Convert ADM ToolConfig into Gemini API toolConfig map.
Convert a list of tools into a Gemini API tools list.
Types
Functions
@spec to_api_tool_config(Altar.ADM.ToolConfig.t()) :: api_tool_config()
Convert ADM ToolConfig into Gemini API toolConfig map.
Input: %ToolConfig{mode: :auto | :any | :none, function_names: ["..."]}
Output: %{ functionCallingConfig: %{
mode: "AUTO" | "ANY" | "NONE",
allowedFunctionNames: ["..."] # present only when non-empty} }
@spec to_api_tool_list(list()) :: api_tool_list()
Convert a list of tools into a Gemini API tools list.
Supports:
- ADM
FunctionDeclarationstructs - Built-in tools (
googleSearch,urlContext,codeExecution) - Atom shorthand for built-ins (
:google_search,:url_context,:code_execution)