eager-window-33590
06/10/2025, 1:57 AMclass Assistant(Agent):
def __init__(self) -> None:
self._agent_session = None
super().__init__(instructions="hello")
async def on_user_turn_completed(self, turn_ctx: agents.ChatContext, new_message: agents.ChatMessage) -> None:
return await super().on_user_turn_completed(turn_ctx, new_message)
async def entrypoint(ctx: agents.JobContext):
print(f"Room value: {ctx.room}")
session = AgentSession(
stt=openai.STT(model="gpt-4o-transcribe"),
llm=openai.LLM(model="gpt-4o-mini"),
tts=openai.TTS(
model="gpt-4o-mini-tts",
voice="alloy",
instructions="Speak in a friendly and conversational tone.",
),
vad=silero.VAD.load(),
turn_detection=MultilingualModel(),
)
agent = Assistant()
await session.start(
room=ctx.room,
agent=agent,
room_input_options=RoomInputOptions(
# LiveKit Cloud enhanced noise cancellation
# - If self-hosting, omit this parameter
# - For telephony applications, use `BVCTelephony` for best results
noise_cancellation=noise_cancellation.BVC(),
),
)
await ctx.connect()
# greeting_instructions = "Greet the user and offer your assistance."
# await session.generate_reply(
# instructions=greeting_instructions
# )
if __name__ == "__main__":
agents.cli.run_app(agents.WorkerOptions(entrypoint_fnc=entrypoint))
Do I need to do something on the server side, for it to reply to my message??