PipecatClient

A Pipecat client. Connects to an RTVI backend and handles bidirectional audio and video streaming.

The client must be cleaned up using the release method when it is no longer required.

Parameters

transport

Transport for media streaming.

callbacks

Callbacks invoked when changes occur in the voice session.

options

Additional options for configuring the client and backend.

Constructors

Link copied to clipboard
constructor(transport: TransportType, options: PipecatClientOptions)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns true if the camera is enabled, false otherwise.

Link copied to clipboard

Returns true if the microphone is enabled, false otherwise.

Link copied to clipboard

Returns the selected video input device.

Link copied to clipboard

Returns the selected audio input device.

Link copied to clipboard

The current state of the session.

Link copied to clipboard

The thread used by the PipecatClient for callbacks and other operations.

Link copied to clipboard

Returns a list of participant media tracks.

Functions

Link copied to clipboard

Appends a message to the bot's LLM conversation context.

Link copied to clipboard
fun connect(transportParams: ConnectParams): Future<Unit, RTVIError>

Initiate an RTVI session, connecting to the backend.

Link copied to clipboard

Disconnect an active RTVI session.

Link copied to clipboard

Sends a disconnect signal to the bot while maintaining the transport connection.

Link copied to clipboard

Enables or disables the video input device.

Link copied to clipboard

Enables or disables the audio input device.

Link copied to clipboard

Returns a list of available video input devices.

Link copied to clipboard

Returns a list of available audio input devices.

Link copied to clipboard

Initialize local media devices such as camera and microphone.

Link copied to clipboard

Registers a function call handler for a specific function name.

Link copied to clipboard
fun release()

Destroys this PipecatClient and cleans up any allocated resources.

Link copied to clipboard
fun sendClientMessage(msgType: String, data: Value = Value.Null): Future<Unit, RTVIError>

Sends a one-way message to the bot without expecting a response.

Link copied to clipboard
fun sendClientRequest(msgType: String, data: Value = Value.Null): Future<DataMessage, RTVIError>

Sends a request message to the bot and waits for a response.

Link copied to clipboard
Link copied to clipboard

Performs bot start request and connection in a single operation.

Link copied to clipboard

Unregisters all function call handlers.

Unregisters a function call handler for a specific function name.

Link copied to clipboard

Use the specified video input device.

Link copied to clipboard

Use the specified audio input device.