RTVIError Type

Base PipecatClient error type, extends Error and primarily introduces the status field. Most methods will try to throw an error of this type when something goes wrong. This is different from the RTVI error event and its corresponding onError callback, which are used for communicating errors that are sent by the bot.
status
number
required
A unique identifier (or HTTP code if applicable) for the error.
message
string
required
A human-readable message describing the error.

Pre-defined RTVIErrors

ConnectionTimeoutError

Emitted when the bot does not enter a ready state within the specified timeout period during the connect() method call.

StartBotError

Emitted from startBot() or startBotAndConnect() when the endpoint responds with an error or the fetch itself fails. This may be due to the endpoint being unavailable, or the server failing to parse the provided data.
error
string
required
All StartBotError instances will have an error field set to invalid-request-error.
status
number
required
HTTP status code returned by the endpoint, if applicable.
message
string
required
Verbose error message returned by the endpoint, if provided. To take advantage of this, the endpoint should return an error response with a JSON object with an info field containing the error message.

TransportStartError

Emitted when the Transport is not able to connect. You may need to check the connection parameters provided or returned from you endpoint.

BotNotReadyError

Emitted when the client attempts to perform an action or method that requires the bot to be in a ready state, but the bot is not ready. You must call connect() first and wait for the bot to be ready before performing such actions.

DeviceError

Emitted when there is an issue with acquiring or using a media device, such as a camera or microphone. This could be due to permissions issues, device unavailability, or other related problems.
devices
array<'cam' | 'mic' | 'speaker'>
required
List of media devices, 'cam', 'mic', and/or 'speaker', that are unavailable or could not be accessed.
type
string
required
The type field will indicate what type of device error occurred. Options include:
  • "in-use": A device is currently in use by another application and cannot be accessed. windows only
  • "permissions": The user has not granted permission to access the media device.
  • "undefined-mediadevices": getUserMedia() is not an available API on the current platform or browser.
  • "not-found": The specified media device could not be found.
  • "constraints": The media device could not be configured with the specified constraints.
  • "unknown": An unknown error occurred while accessing the media device.
details
object
required
Additional details about the device error, if available.

UnsupportedFeatureError

Not all Transports are created equal, and some may not support certain features. This error is thrown when a feature is requested that the current Transport does not support.
feature
string
required
This custom field will contain the name of the unsupported feature.