ripe-arm-36009
09/02/2025, 3:13 AMtall-airline-16756
09/02/2025, 3:13 AMtall-airline-16756
09/02/2025, 3:13 AMnpm install @livekit/agents-plugin-google
◦ Python: pip install "livekit-agents[google]~=1.2"
1. Set Up Authentication: Make sure to set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your service account key file. Also, double-check that the Vertex AI API is enabled in your Google Cloud project.
2. Initialize the LLM: Use the LLM class with vertexai=True to connect with Vertex AI. Here’s a quick example:
from livekit.plugins import google
google_llm = google.LLM(
model="gemini-1.5-pro",
vertexai=True,
project="your-project-id",
location="us-central1"
)
3. Optional: If you want to have real-time voice conversations, you can use the RealtimeModel class with Vertex AI.
If you hit any bumps or want me to walk you through any of these steps, just let me know—I’m here to help!
Sources: Google integration guide | LiveKit Docs | Google AI and LiveKit | LiveKit Docs | livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/gemini_t... | Google Gemini integration guide | LiveKit Docs | plugins/google/src/beta/realtime/realtime_api.tsripe-arm-36009
09/02/2025, 3:15 AMBVCTelephony instead for best results
noise_cancellation=noise_cancellation.BVC(),
),
)
# await session.generate_reply(
# instructions="Greet the user and offer your assistance."
# )
if name == "__main__":
agents.cli.run_app(agents.WorkerOptions(entrypoint_fnc=entrypoint,port=1100))
this is my current codetall-airline-16756
09/02/2025, 3:15 AMripe-arm-36009
09/02/2025, 3:15 AMtall-airline-16756
09/02/2025, 3:16 AMimport os
from livekit.plugins import google
from livekit.plugins.google.beta.realtime import RealtimeModel
# Setting up the LLM instance for Vertex AI
llm_instance = google.LLM(
model="gemini-2.0-flash-exp", # Just an example model
vertexai=True,
project="your-project-id", # Swap this with your actual Google Cloud project ID
location="us-central1" # Default location
)
# Setting up the RealtimeModel for real-time interactions
realtime_model = RealtimeModel(
modalities=["AUDIO", "TEXT"], # This lets you handle both audio and text
model="gemini-2.0-flash-exp",
voice="Puck",
temperature=0.8,
instructions="You are a helpful assistant",
vertexai=True,
project="your-project-id",
location="us-central1"
)
# Don’t forget to set GOOGLE_APPLICATION_CREDENTIALS to your service account key file
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/your/service-account-key.json"
Just replace your-project-id and path/to/your/service-account-key.json with your actual Google Cloud project ID and the path to your service account key file. If you have any questions or want me to walk you through anything else, just let me know—I’m here to help!
Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/gemini_t... | Google AI and LiveKit | LiveKit Docs | Google Gemini integration guide | LiveKit Docs | Gemini Live API integration guide | LiveKit Docs | Google integration guide | LiveKit Docsripe-arm-36009
09/02/2025, 3:16 AMtall-airline-16756
09/02/2025, 3:16 AMimport os
from livekit.plugins.google.beta.realtime import RealtimeModel
# Setting up the RealtimeModel for real-time interactions
realtime_model = RealtimeModel(
modalities=["AUDIO", "TEXT"], # This lets you handle both audio and text
model="gemini-2.5-flash-preview-native-audio-dialog", # Just an example model
voice="Puck",
temperature=0.3, # Controls how creative the responses are
instructions="You are a helpful assistant",
vertexai=True,
project="your-project-id", # Swap this with your Google Cloud project ID
location="us-central1" # Default location
)
# Don’t forget to set GOOGLE_APPLICATION_CREDENTIALS to your service account key file
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/your/service-account-key.json"
Just replace your-project-id and path/to/your/service-account-key.json with your actual Google Cloud project ID and the path to your service account key file.
If you hit any bumps or want a hand with this, just give me a shout—I’m here to help!