Geminix.V1beta.Tool (geminix v0.2.0)

Tool details that the model may use to generate response. A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. Next ID: 14

Fields:

  • :code_execution (Geminix.V1beta.CodeExecution.t/0) - Optional. Enables the model to execute code as part of generation.
  • :computer_use (Geminix.V1beta.ComputerUse.t/0) - Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
  • :file_search (Geminix.V1beta.FileSearch.t/0) - Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora.
  • :function_declarations (list of Geminix.V1beta.FunctionDeclaration.t/0) - Optional. A list of FunctionDeclarations available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role "function" generation context for the next model turn.
  • :google_maps (Geminix.V1beta.GoogleMaps.t/0) - Optional. Tool that allows grounding the model's response with geospatial context related to the user's query.
  • :google_search (Geminix.V1beta.GoogleSearch.t/0) - Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
  • :google_search_retrieval (Geminix.V1beta.GoogleSearchRetrieval.t/0) - Optional. Retrieval tool that is powered by Google search.
  • :mcp_servers (list of Geminix.V1beta.McpServer.t/0) - Optional. MCP Servers to connect to.
  • :url_context (Geminix.V1beta.UrlContext.t/0) - Optional. Tool to support URL context retrieval.

Summary

Functions

Create a Geminix.V1beta.Tool.t/0 from a map returned by the Gemini API.

Types

t()

@type t() :: %Geminix.V1beta.Tool{
  __meta__: term(),
  code_execution: Geminix.V1beta.CodeExecution.t(),
  computer_use: Geminix.V1beta.ComputerUse.t(),
  file_search: Geminix.V1beta.FileSearch.t(),
  function_declarations: [Geminix.V1beta.FunctionDeclaration.t()],
  google_maps: Geminix.V1beta.GoogleMaps.t(),
  google_search: Geminix.V1beta.GoogleSearch.t(),
  google_search_retrieval: Geminix.V1beta.GoogleSearchRetrieval.t(),
  mcp_servers: [Geminix.V1beta.McpServer.t()],
  url_context: Geminix.V1beta.UrlContext.t()
}

Functions

from_map(schema \\ %__MODULE__{}, map)

@spec from_map(t(), map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}

Create a Geminix.V1beta.Tool.t/0 from a map returned by the Gemini API.

Sometimes, this function should not be applied to the full response body, but instead it should be applied to the correct part of the map in the response body. This depends on the concrete API call.