examples: use EndFrame() when the participant leaves

This commit is contained in:
Aleix Conchillo Flaqué
2024-10-18 10:27:53 -07:00
parent 020f371ecb
commit 4550545528
4 changed files with 21 additions and 12 deletions

View File

@@ -57,7 +57,11 @@ async def main():
@transport.event_handler("on_first_participant_joined")
async def on_first_participant_joined(transport, participant):
await task.queue_frames([LLMMessagesFrame(messages), EndFrame()])
await task.queue_frame(LLMMessagesFrame(messages))
@transport.event_handler("on_participant_left")
async def on_participant_left(transport, participant, reason):
await task.queue_frame(EndFrame())
await runner.run(task)