> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors & Config

> Python API reference for Errors & Config.

Shared configuration and state types: session and user state enums, speech and VAD
event types, and the config objects for end-of-utterance, interruption, and
realtime behavior.

## UserState

States describing the user's current speech activity in a session.

```python theme={null}
class UserState(Enum):
    IDLE = 'idle'
    SPEAKING = 'speaking'
    LISTENING = 'listening'
```

***

## AgentState

Lifecycle and activity states of the agent during a session.

```python theme={null}
class AgentState(Enum):
    STARTING = 'starting'
    IDLE = 'idle'
    SPEAKING = 'speaking'
    LISTENING = 'listening'
    THINKING = 'thinking'
    CLOSING = 'closing'
```

***

## SpeechEventType

Types of speech-related events emitted during transcription.

```python theme={null}
class SpeechEventType(Enum):
    START = 'start_of_speech'
    INTERIM = 'interim_transcript'
    PREFLIGHT = 'preflight_transcript'
    FINAL = 'final_transcript'
    END = 'end_of_speech'
```

***

## VADEventType

Types of voice activity detection events.

```python theme={null}
class VADEventType(Enum):
    START_OF_SPEECH = 'start_of_speech'
    END_OF_SPEECH = 'end_of_speech'
```

***

## EOUConfig

Configuration for end-of-utterance (EOU) detection.

### Fields

<ParamField path="mode" type="Literal['ADAPTIVE', 'DEFAULT']" default="DEFAULT">
  Detection strategy, either `'ADAPTIVE'` or `'DEFAULT'`.
</ParamField>

<ParamField path="min_max_speech_wait_timeout" type="List[float] | Tuple[float, float]" default="…">
  Minimum and maximum wait times, in seconds, before concluding that the user has finished speaking.
</ParamField>

***

## InterruptConfig

Configuration controlling how user interruptions of the agent are detected and handled.

### Fields

<ParamField path="mode" type="Literal['VAD_ONLY', 'STT_ONLY', 'HYBRID']" default="HYBRID">
  Detection strategy, one of `'VAD_ONLY'`, `'STT_ONLY'` or `'HYBRID'`.
</ParamField>

<ParamField path="interrupt_min_duration" type="float" default="0.5">
  Minimum speech duration, in seconds, required to count as an interruption.
</ParamField>

<ParamField path="interrupt_min_words" type="int" default="2">
  Minimum number of recognized words required to count as an interruption.
</ParamField>

<ParamField path="interrupt_min_confidence" type="float" default="0.0">
  Minimum transcription confidence required to count as an interruption.
</ParamField>

<ParamField path="false_interrupt_pause_duration" type="float" default="2.0">
  Pause duration, in seconds, used when an interruption is later judged to be false.
</ParamField>

<ParamField path="resume_on_false_interrupt" type="bool" default="True">
  Whether to resume the agent's response after a false interruption.
</ParamField>

<ParamField path="false_interrupt_pause_duration_ms" type="int" default="2000">
  Pause duration in milliseconds applied on a false interruption.
</ParamField>

<ParamField path="interrupt_fade_duration" type="float" default="0.0">
  Audio fade-out duration, in seconds, applied when an interruption occurs.
</ParamField>

<ParamField path="interrupt_fade_duration_ms" type="int" default="400">
  Audio fade-out duration in milliseconds applied when an interruption occurs.
</ParamField>

***

## RealtimeConfig

Configuration for a realtime model session.

### Fields

<ParamField path="mode" type="Literal['full_s2s', 'hybrid_stt', 'hybrid_tts', 'llm_only'] | None">
  The realtime operating mode, one of `'full_s2s'`, `'hybrid_stt'`, `'hybrid_tts'` or `'llm_only'`, or `None` to use the default.
</ParamField>

<ParamField path="response_modalities" type="List[str] | None">
  The output modalities the model should produce, or `None` for the default.
</ParamField>
