Transport Overview
Transports are the means by which Pipecat clients communicate with their bot services. They handle both message exchange between client and server and real-time media transport. Pipecat implements the RTVI standard for these communications.
Transport lifecycle
Your transport instance is constructed when you call connect()
on your client instance.
Transport states
TransportState
Your transport instance goes through a series of states during its lifecycle. These states are:
Disconnected
Transport is idle and has not yet been initialized (default state).
Initializing
Transport is being initialized. Typically in response to a
rtviClient.initDevices()
call, where the transport is being set up in
order to enumerate local media devices.
Initialized
Transport has been initialized and is ready to connect. This state is
typically reached after a successful rtviClient.initDevices()
call.
Authenticating
Your client has called rtviClient.connect()
and is waiting for a response
from your server containing ‘auth bundle’ credentials (such as a session URL
and token.)
Connecting
Transport has received the ‘auth bundle’ and is connecting to the server.
Connected
Transport has successfully connected to the session and is awaiting a client-ready signal (indicicated audio and video tracks are ready to be sent.)
Ready
Disconnecting
Transport is disconnecting from the session.
Error
You can access the current transport state via rtviClient.state
, or by defining a callback or event: