Type alias AgentSessionOptions<UserData>

AgentSessionOptions<UserData>: {
    aecWarmupDuration?: number | null;
    connOptions?: SessionConnectOptions;
    forwardAudioIdleTimeout?: number;
    llm?: llm.LLM | llm.RealtimeModel | LLMModels;
    maxToolSteps?: number;
    preemptiveGeneration?: boolean;
    stt?: stt.STT | STTModelString;
    tts?: tts.TTS | TTSModelString;
    ttsReadIdleTimeout?: number;
    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 forwardAudioIdleTimeout?: number

    Maximum time in milliseconds to wait for the next frame while forwarding TTS audio to the audio output inside performAudioForwarding. Applies to every read, including the first. If exceeded, forwarding is forcibly closed and a stall warning is logged.

    Default Value

    10000
    
  • Optional llm?: llm.LLM | llm.RealtimeModel | LLMModels
  • Optional maxToolSteps?: number
  • Optional preemptiveGeneration?: boolean

    Deprecated

    Use turnHandling.preemptiveGeneration instead. When set, migrated into turnHandling.preemptiveGeneration.enabled.

  • Optional stt?: stt.STT | STTModelString
  • Optional tts?: tts.TTS | TTSModelString
  • Optional ttsReadIdleTimeout?: number

    Maximum time in milliseconds to wait for the next frame on the TTS audio stream inside performTTSInference. Applies to every read, including the first. If exceeded, the TTS stream is forcibly closed and a stall warning is logged.

    Default Value

    10000
    
  • 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