Fix example 2

This commit is contained in:
Moishe Lettvin
2024-03-11 13:00:29 -04:00
parent de026ccc8a
commit fd2fa23e9c

View File

@@ -42,15 +42,21 @@ async def main(room_url):
}
]
@transport.event_handler("on_first_other_participant_joined")
async def on_first_other_participant_joined(transport):
other_joined_event = asyncio.Event()
async def speak_from_llm():
await other_joined_event.wait()
await tts.run_to_queue(
transport.send_queue,
llm.run([LLMMessagesQueueFrame(messages)]),
add_end_of_stream=True
)
await transport.stop_when_done()
await transport.run()
@transport.event_handler("on_first_other_participant_joined")
async def on_first_other_participant_joined(transport):
other_joined_event.set()
await asyncio.gather(transport.run(), speak_from_llm())
if __name__ == "__main__":