The RTVIProcessor manages bidirectional communication between clients and your Pipecat application. It processes client messages, handles service configuration, executes actions, and coordinates function calls.
Initialization
RTVIProcessor is automatically added to your pipeline when you create a PipelineTask. Access it via task.rtvi:
To provide a custom processor (e.g., for Google RTVI):
To disable RTVI entirely, set enable_rtvi=False.
Readiness Protocol
Client Ready State
Clients indicate readiness by sending a client-ready message, triggering the on_client_ready event in the processor:
Bot Ready State
The server must mark the bot as ready before it can process client messages:
When marked ready, the bot sends a response containing:
- RTVI protocol version
- Current service configuration
- Available actions
Services
Services represent configurable components of your application that clients can interact with.
Registering Services
Option Types
Services support multiple data types for configuration:
Option handlers receive:
- The processor instance
- The service name
- The option configuration with new value
Actions
Actions are server-side functions that clients can trigger with arguments.
Registering Actions
Action Arguments
Actions can accept typed arguments from clients:
Function Calls
Handle LLM function calls with client interaction:
The function call process:
- LLM requests a function call
- Processor notifies client with
llm-function-call message
- Client executes function and returns result
- Result is passed back to LLM via
FunctionCallResultFrame
- Conversation continues
Error Handling
Send error messages to clients:
Error categories:
- Configuration errors
- Action execution errors
- Function call errors
- Protocol errors
- Fatal and non-fatal errors
Bot Control
Manage bot state and handle interruptions:
Custom Messaging
Server messages let you push unsolicited data from the server to the client at any time — notifications, status updates, real-time results, etc. They are distinct from server responses, which reply to a specific client request (see Requesting Information from the Server).
Sending server messages
Any FrameProcessor in the pipeline can push an RTVIServerMessageFrame. The RTVIObserver picks it up and delivers it to the client:
RTVIServerMessageFrame is a SystemFrame, so it propagates immediately
through the pipeline and is not affected by interruptions or queuing.
Client-side handling
The message arrives at the client with the wire format { label: "rtvi-ai", type: "server-message", data: ... }. Handle it with the onServerMessage callback:
See Handling Custom Messages from the Server for more details and examples.