Type alias AgentSessionOptions<UserData>

AgentSessionOptions<UserData>: {
    aecWarmupDuration?: number | null;
    connOptions?: SessionConnectOptions;
    llm?: llm.LLM | llm.RealtimeModel | LLMModels;
    maxToolSteps?: number;
    preemptiveGeneration?: boolean;
    stt?: stt.STT | STTModelString;
    tts?: tts.TTS | TTSModelString;
    turnDetection?: TurnDetectionMode;
    turnHandling?: Partial<TurnHandlingOptions>;
    useTtsAlignedTranscript?: boolean;
    userAwayTimeout?: number | null;
    userData?: UserData;
    vad?: VAD;
    voiceOptions?: Partial<VoiceOptions>;
}

Type Parameters

  • UserData = UnknownUserData

Type declaration

  • Optional aecWarmupDuration?: number | null

    Duration in milliseconds for AEC (Acoustic Echo Cancellation) warmup, during which interruptions from audio activity are suppressed. Set to null to disable.

    Default Value

    3000
    
  • Optional connOptions?: SessionConnectOptions
  • Optional llm?: llm.LLM | llm.RealtimeModel | LLMModels
  • Optional maxToolSteps?: number
  • Optional preemptiveGeneration?: boolean

    Whether to speculatively begin LLM and TTS requests before an end-of-turn is detected. When true, the agent sends inference calls as soon as a user transcript is received rather than waiting for a definitive turn boundary. This can reduce response latency by overlapping model inference with user audio, but may incur extra compute if the user interrupts or revises mid-utterance.

    Default Value

    true
    
  • Optional stt?: stt.STT | STTModelString
  • Optional tts?: tts.TTS | TTSModelString
  • Optional turnDetection?: TurnDetectionMode

    Deprecated

    use turnHandling.turnDetection instead

  • Optional turnHandling?: Partial<TurnHandlingOptions>

    Configuration for turn handling.

  • Optional useTtsAlignedTranscript?: boolean
  • Optional userAwayTimeout?: number | null

    If set, set the user state as "away" after this amount of time after user and agent are silent. Set to null to disable.

    Default Value

    15.0
    
  • Optional userData?: UserData
  • Optional vad?: VAD
  • Optional voiceOptions?: Partial<VoiceOptions>

    Deprecated

    use top-level SessionOptions fields instead