processor
RTVIProcessor: main RTVI protocol processor.
- class pipecat.processors.frameworks.rtvi.processor.RTVIProcessor(*, transport: BaseTransport | None = None, **kwargs)[source]
Bases:
FrameProcessorMain processor for handling RTVI protocol messages and actions.
This processor manages the RTVI protocol communication including client-server handshaking, configuration management, action execution, and message routing. It serves as the central hub for RTVI protocol operations.
- __init__(*, transport: BaseTransport | None = None, **kwargs)[source]
Initialize the RTVI processor.
- Parameters:
transport – Transport layer for communication.
**kwargs – Additional arguments passed to parent class.
- create_rtvi_observer(*, params: RTVIObserverParams | None = None, **kwargs)[source]
Creates a new RTVI Observer.
- Parameters:
params – Settings to enable/disable specific messages.
**kwargs – Additional arguments passed to the observer.
- Returns:
A new RTVI observer.
- async set_bot_ready(about: Mapping[str, Any] = None)[source]
Mark the bot as ready and send the bot-ready message.
- Parameters:
about – Optional information about the bot to include in the ready message. If left as None, the Pipecat library and version will be used.
- async send_server_response(client_msg: ClientMessage, data: Any)[source]
Send a server response for a given client message.
- async send_error_response(client_msg: ClientMessage, error: str)[source]
Send an error response for a given client message.
- async send_error(error: str)[source]
Send an error message to the client.
- Parameters:
error – The error message to send.
- async push_transport_message(model: BaseModel, exclude_none: bool = True)[source]
Push a transport message frame.
- async handle_message(message: Message)[source]
Handle an incoming RTVI message.
- Parameters:
message – The RTVI message to handle.
- async handle_function_call(params: FunctionCallParams)[source]
Handle a function call from the LLM.
- Parameters:
params – The function call parameters.
Deprecated since version 0.0.102: This method is deprecated. Function call events are now automatically sent by
RTVIObserverusing thellm-function-call-in-progressevent. Configure reporting level viaRTVIObserverParams.function_call_report_level.
- async process_frame(frame: Frame, direction: FrameDirection)[source]
Process incoming frames through the RTVI processor.
- Parameters:
frame – The frame to process.
direction – The direction of frame flow.