RTVIProcessor
Core coordinator for RTVI protocol communication
The RTVIProcessor
is the main coordinator for RTVI protocol communication between clients and your Pipecat application. It manages service configuration, handles client actions, and coordinates function calls.
Basic Usage
The RTVIProcessor needs to be initialized with a configuration and added to your pipeline. The configuration defines what services and configuration options are available to clients.
Bot Ready State
The processor manages the bot’s ready state. The bot must be marked as ready before it can receive client messages:
When the bot is marked ready, it sends a bot-ready message to the client containing:
- The RTVI protocol version
- Current service configuration
- Available actions
Client Ready State
Clients must also indicate they are ready to receive messages:
After both bot and client are ready:
- Services can be configured
- Actions can be executed
- Function calls can be processed
Services
Services represent configurable components of your application. Each service can have multiple options that clients can control.
Defining Services
Create a service with configurable options:
The service handler is called whenever the option changes:
- Receives the processor instance
- Gets the service name
- Contains the new option configuration
- Can validate and apply changes
- Can send errors if needed
Option Types
Services support multiple option types for different configuration needs:
Available option types:
bool
- True/false flagsnumber
- Numeric valuesstring
- Text valuesarray
- Lists of valuesobject
- Complex structured data
Option Handlers
Option handlers process configuration changes. A handler receives:
- The processor instance
- The service name
- The option configuration with new value
Actions
Actions are functions that clients can trigger. They can accept arguments and return results.
Learn how to use RTVI Actions in the Client SDK documentation.
Basic Actions
Register a simple action:
The action handler receives:
- The processor instance
- The service name
- Any provided arguments
Actions with 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
- Client executes function
- Result is returned to LLM
- Conversation continues
Error Handling
Send error messages to clients in different ways:
Error types include:
- Configuration errors
- Action execution errors
- Function call errors
- Protocol errors
- Fatal vs non-fatal errors
Bot Control
Control bot state and handle interruptions:
Bot control features:
- Ready state management
- Client synchronization
- Graceful interruption
- Error recovery
Next Steps
Frame Processors
Learn about the specialized processors that work alongside RTVIProcessor