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 sessionsystem_instruction- System instructions for the modeltools- List of tools the model may userealtime_input_config- Configuration for realtime input handlingsession_resumption- Session resumption configurationcontext_window_compression- Context window compression configurationinput_audio_transcription- Enable transcription of input audiooutput_audio_transcription- Enable transcription of output audioproactivity- Proactivity configurationenable_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
@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 }
@type tool() :: map()
Functions
Parses from API response.
Creates a new Setup with the required model and optional configuration.
Converts to API format (camelCase).