adventurous-activity-14752
08/01/2025, 12:57 AMtall-airline-16756
08/01/2025, 12:57 AMtall-airline-16756
08/01/2025, 12:57 AMgenerate_reply() Method:
This method allows the agent to initiate a conversation by sending an initial message. For example, you can include this in the on_enter method of your agent:
class GeminiAgent(Agent):
def __init__(self):
super().__init__(
instructions="You are gemini, a helpful assistant",
llm=google.beta.realtime.RealtimeModel(),
)
async def on_enter(self):
self.session.generate_reply(
instructions="introduce yourself very briefly and ask about the user's day"
)
2. Using `session.say()`:
This method can be used to have the agent speak a predefined message at the start of the session. Note that this requires a TTS plugin to be configured.
If you are using realtime models, the generate_reply() method is recommended for text-based initializations, while session.say() is more suitable for audio-based initializations.
Let me know if you need further assistance with implementing these approaches!