rtvi_client
A Pipecat pipeline acting as an RTVI client.
RTVIClientTransport connects to a bot that runs an RTVI server transport
(e.g. the eval transport) and exchanges frames with it: the bot’s RTVI server
messages arrive as pipeline frames, and outgoing frames (audio, pre-built RTVI
client messages) are sent to the bot. It is the client-side counterpart to a bot
running an RTVI server transport, and the foundation for the eval harness and
eval simulations (see docs/design/eval-simulations.md).
It wraps WebsocketClientTransport,
defaulting its serializer to
RTVIClientSerializer and adding the
client-ready / bot-ready handshake.
- class pipecat.transports.websocket.rtvi_client.RTVIClientTransport(uri: str, params: WebsocketClientParams | None = None)[source]
Bases:
WebsocketClientTransportWebSocket transport that speaks RTVI as a client to a bot.
Event handlers available:
on_connected: the WebSocket connection was established
on_disconnected: the WebSocket connection was closed
on_bot_ready: the bot answered the
client-readyhandshake withbot-ready
Example:
transport = RTVIClientTransport("ws://localhost:7860") @transport.event_handler("on_bot_ready") async def on_bot_ready(transport): ...
- __init__(uri: str, params: WebsocketClientParams | None = None)[source]
Initialize the RTVI client transport.
- Parameters:
uri – The WebSocket URI of the bot’s RTVI server transport.
params – Optional transport parameters. The serializer defaults to
RTVIClientSerializerwhen not provided.