Overview

The GoogleRTVIObserver extends the base RTVIObserver type, to add support for the bot-llm-search-response message type and providing clients with the search results from the GoogleLLMService. See this section on Search Grounding for more details.

Installation

To use GoogleRTVIObserver, install the required dependencies:
pip install "pipecat-ai[google]"
You’ll also need to follow setup instructions for the Google LLM Service to ensure the GoogleLLMService is properly configured.

Frame Translation

The observer maps the LLMSearchResponseFrame to the RTVIBotLLMSearchResponseMessage. Check out the RTVI Standard Reference for details on the message format.

Usage Example

This observer should replace the base RTVIObserver and be set up exactly the same otherwise:
from pipecat.services.google.rtvi import GoogleRTVIObserver

# Create the RTVIProcessor
rtvi = RTVIProcessor(config=RTVIConfig(config=[]))

# Add to pipeline
pipeline = Pipeline([
    transport.input(),
    rtvi,
    # Other processors...
])

# Create pipeline task with observer
task = PipelineTask(
    pipeline,
    params=PipelineParams(allow_interruptions=True),
    observers=[GoogleRTVIObserver(rtvi)],  # Add the observer here
)