# `Gemini.Types.Live.Setup`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.13.0/lib/gemini/types/live/setup.ex#L1)

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-2.5-flash-native-audio-preview-12-2025")
- `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-2.5-flash-native-audio-preview-12-2025",
      generation_config: %{
        response_modalities: [:audio],
        speech_config: %{voice_config: %{prebuilt_voice_config: %{voice_name: "Puck"}}}
      },
      system_instruction: %{parts: [%{text: "You are a helpful assistant."}]}
    }

# `t`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.13.0/lib/gemini/types/live/setup.ex#L49)

```elixir
@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`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.13.0/lib/gemini/types/live/setup.ex#L47)

```elixir
@type tool() :: map()
```

# `from_api`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.13.0/lib/gemini/types/live/setup.ex#L134)

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

Parses from API response.

# `new`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.13.0/lib/gemini/types/live/setup.ex#L82)

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

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

# `to_api`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.13.0/lib/gemini/types/live/setup.ex#L105)

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

Converts to API format (camelCase).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
