Gemini.Types.Live.ToolResponse (GeminiEx v0.11.0)

Copy Markdown View Source

Tool response from the client in Live API sessions.

Client-generated response to a ToolCall received from the server. Individual FunctionResponse objects are matched to their respective FunctionCall objects by the ID field.

Fields

  • function_responses - List of function responses

Example

%ToolResponse{
  function_responses: [
    %{
      id: "call_123",
      name: "get_weather",
      response: %{content: %{temperature: 72, conditions: "sunny"}}
    }
  ]
}

Summary

Functions

Parses from API response.

Creates a new ToolResponse.

Converts to API format (camelCase).

Types

function_response()

@type function_response() :: %{
  optional(:id) => String.t(),
  optional(:name) => String.t(),
  optional(:response) => map()
}

t()

@type t() :: %Gemini.Types.Live.ToolResponse{
  function_responses: [function_response()] | nil
}

Functions

from_api(data)

@spec from_api(map() | nil) :: t() | nil

Parses from API response.

new(opts \\ [])

@spec new(keyword()) :: t()

Creates a new ToolResponse.

to_api(value)

@spec to_api(t() | nil) :: map() | nil

Converts to API format (camelCase).