icy-apple-74167
11/16/2025, 5:56 AMtall-airline-16756
11/16/2025, 5:56 AMtall-airline-16756
11/16/2025, 5:57 AMicy-apple-74167
11/20/2025, 9:27 AMicy-apple-74167
11/20/2025, 9:27 AMtall-airline-16756
11/20/2025, 9:27 AMgenerate_reply() method to kick off the conversation in a friendly way. For instance:
• Within the session's onEnter() function, you can call session.generateReply() with a prompt like "Greet the user personally and offer your assistance."
• Or, you might prefer to set up the RealtimeModel with proactivity=True, so the agent naturally begins with a welcoming greeting.
If you’d like, I’m happy to provide a code example or walk you through the setup in more detail. Just let me know!
Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/realtime/real... | agent/main.py | Agents v0.x migration guide - Node.js | LiveKit Docs | Workflows | LiveKit docs | realtime/gemini_live_vision.pyicy-apple-74167
11/20/2025, 9:28 AMicy-apple-74167
11/20/2025, 9:28 AMtall-airline-16756
11/20/2025, 9:28 AMfrom livekit.plugins import google
from google.genai.types import AudioTranscriptionConfig
# Configure the RealtimeModel with proactivity enabled
realtime_model = google.beta.realtime.RealtimeModel(
model="gemini-2.5-flash-native-audio-preview-09-2025",
input_audio_transcription=AudioTranscriptionConfig(),
output_audio_transcription=AudioTranscriptionConfig(),
voice="Puck",
temperature=0.8,
proactivity=True # Enables the agent to proactively start the session
)
# Create an AgentSession
session = AgentSession(llm=realtime_model)
# Define the entrypoint to generate a greeting
@session.on("session_started")
def on_session_start(event):
session.generate_reply(prompt="Greet the user and offer assistance.")
# Start the session
session.start()
Here’s a little breakdown to help you understand:
• The proactivity=True setting lets the agent take the lead and start the conversation, making things flow more naturally.
• The session.generate_reply() method is what creates that friendly greeting right when the session kicks off.
If you’d like me to walk you through any part of this or share more examples, just let me know—I’m here to help!