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:
enable_rtvi=False.
Readiness Protocol
Client Ready State
Clients indicate readiness by sending aclient-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:- 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:- 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:- LLM requests a function call
- Processor notifies client with
llm-function-callmessage - Client executes function and returns result
- Result is passed back to LLM via
FunctionCallResultFrame - Conversation continues
Error Handling
Send error messages to clients:- 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
Send custom messages from server to client:onServerMessage callback or serverMessage event.