Gemini.Types.Live.Setup (GeminiEx v0.9.0)

Copy Markdown View Source

Session setup configuration for Live API.

Message to be sent in the first (and only in the first) client message. Contains configuration that applies for the duration of the streaming RPC.

Clients should wait for a SetupComplete message before sending any additional messages.

Fields

  • model - Required. The model's resource name (e.g., "models/gemini-live-2.5-flash-preview")
  • generation_config - Generation configuration for the session
  • system_instruction - System instructions for the model
  • tools - List of tools the model may use
  • realtime_input_config - Configuration for realtime input handling
  • session_resumption - Session resumption configuration
  • context_window_compression - Context window compression configuration
  • input_audio_transcription - Enable transcription of input audio
  • output_audio_transcription - Enable transcription of output audio
  • proactivity - Proactivity configuration
  • enable_affective_dialog - Enable affective dialog (v1alpha, native audio)

Example

%Setup{
  model: "models/gemini-live-2.5-flash-preview",
  generation_config: %{
    response_modalities: [:audio],
    speech_config: %{voice_config: %{prebuilt_voice_config: %{voice_name: "Puck"}}}
  },
  system_instruction: %{parts: [%{text: "You are a helpful assistant."}]}
}

Summary

Functions

Parses from API response.

Creates a new Setup with the required model and optional configuration.

Converts to API format (camelCase).

Types

t()

@type t() :: %Gemini.Types.Live.Setup{
  context_window_compression:
    Gemini.Types.Live.ContextWindowCompression.t() | nil,
  enable_affective_dialog: boolean() | nil,
  generation_config: Gemini.Types.GenerationConfig.t() | map() | nil,
  input_audio_transcription:
    Gemini.Types.Live.AudioTranscriptionConfig.t() | nil,
  model: String.t(),
  output_audio_transcription:
    Gemini.Types.Live.AudioTranscriptionConfig.t() | nil,
  proactivity: Gemini.Types.Live.ProactivityConfig.t() | nil,
  realtime_input_config: Gemini.Types.Live.RealtimeInputConfig.t() | nil,
  session_resumption: Gemini.Types.Live.SessionResumptionConfig.t() | nil,
  system_instruction: Gemini.Types.Content.t() | map() | nil,
  tools: [tool()] | nil
}

tool()

@type tool() :: map()

Functions

from_api(data)

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

Parses from API response.

new(model, opts \\ [])

@spec new(
  String.t(),
  keyword()
) :: t()

Creates a new Setup with the required model and optional configuration.

to_api(value)

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

Converts to API format (camelCase).