Skip to content

Realtime session

[BETA] Defines a base class for realtime session modules.

BaseRealtimeSession(retry_config=None)

Bases: ABC

[BETA] A base class for realtime session modules.

The BaseRealtimeSession class provides a framework for processing real-time conversation sessions.

Attributes:

Name Type Description
retry_config RetryConfig

The retry configuration for the realtime session.

Initializes a new instance of the BaseRealtimeSession class.

Parameters:

Name Type Description Default
retry_config RetryConfig | None

The retry configuration for the realtime session. Defaults to None, in which case a default config with no retry and 60 minutes timeout will be used.

None

start(input_streamers=None, output_streamers=None) async

Starts the real-time conversation session using the provided input and output streamers.

This method validates the input and output streamers, and then calls the _start method.

Parameters:

Name Type Description Default
input_streamers list[BaseInputStreamer] | None

The input streamers to use. Defaults to None.

None
output_streamers list[BaseOutputStreamer] | None

The output streamers to use. Defaults to None.

None

Raises:

Type Description
ValueError

If the input_streamers or output_streamers is an empty list.