Configuration struct for controlling Runner execution behavior.
Mirrors Python ADK's RunConfig for parity. All new fields are optional
(nil by default) and only take effect when explicitly set.
Fields
:streaming_mode—:none,:sse, or:live(default::none):max_llm_calls— Maximum number of LLM calls per run (default:500). Values ≤ 0 are allowed (meaning unbounded) but emit a warning. Values ≥@max_integerare rejected.:output_format— Output format hint, e.g."text","json"(default:"text"):speech_config— Speech configuration map (voice, language) (default:nil):generate_config— Generation config overrides (temperature, etc.) (default:%{}):response_modalities— Output modalities, e.g.["text"],["audio"](default:nil):output_config— Structured output config:response_mime_type,response_schema(default:nil):support_cfc— Enable Compositional Function Calling via Live API (default:false):custom_metadata— Arbitrary metadata map for the invocation (default:nil):get_session_config— Configuration for getting a session (num_recent_events,after_timestamp) (default:nil):output_audio_transcription— Audio transcription config for output (default:%{}):input_audio_transcription— Audio transcription config for input (default:%{})
Examples
config = ADK.RunConfig.new(streaming_mode: :sse, max_llm_calls: 10)
ADK.Runner.run(runner, "user", "sess", "hello", run_config: config)
# Structured JSON output
config = ADK.RunConfig.new(
output_config: %{
response_mime_type: "application/json",
response_schema: %{type: "object", properties: %{name: %{type: "string"}}}
}
)
Summary
Functions
Create a RunConfig with validation, returning {:ok, config} or {:error, reason}.
Returns the max integer value (mirrors Python's sys.maxsize).
Create a new RunConfig.
Types
@type get_session_config() :: %{ optional(:num_recent_events) => non_neg_integer(), optional(:after_timestamp) => float() }
@type proactivity_config() :: %{optional(:proactive_audio) => boolean()}
@type session_resumption_config() :: %{optional(:transparent) => boolean()}
@type streaming_mode() :: :none | :sse | :live
@type t() :: %ADK.RunConfig{ context_window_compression: map() | nil, custom_metadata: map() | nil, enable_affective_dialog: boolean() | nil, generate_config: map(), get_session_config: get_session_config() | nil, input_audio_transcription: map() | nil, max_llm_calls: integer(), output_audio_transcription: map() | nil, output_config: output_config() | nil, output_format: String.t(), proactivity: proactivity_config() | nil, realtime_input_config: map() | nil, response_modalities: [String.t()] | nil, session_resumption: session_resumption_config() | nil, speech_config: map() | nil, streaming_mode: streaming_mode(), support_cfc: boolean() }
Functions
Create a RunConfig with validation, returning {:ok, config} or {:error, reason}.
Examples
iex> {:ok, config} = ADK.RunConfig.build(streaming_mode: :live)
iex> config.streaming_mode
:live
iex> {:error, _} = ADK.RunConfig.build(streaming_mode: :invalid)
@spec max_integer() :: pos_integer()
Returns the max integer value (mirrors Python's sys.maxsize).
Values at or above this threshold are rejected by validate_max_llm_calls/1.
Create a new RunConfig.
Each instance gets its own independent output_audio_transcription and
input_audio_transcription maps (not shared references).
Examples
iex> config = ADK.RunConfig.new()
iex> config.streaming_mode
:none
iex> config = ADK.RunConfig.new(streaming_mode: :sse, max_llm_calls: 5)
iex> config.max_llm_calls
5