RTVIProcessor
Core coordinator for RTVI protocol communication
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
Add the RTVIProcessor
to your pipeline:
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
Send custom messages from server to client:
The client receives these messages through the onServerMessage
callback or serverMessage
event.