Simplify 55* examples: inline the settings update directly in the on_client_connected handler instead of wrapping it in a separate async task

This commit is contained in:
Paul Kompfner
2026-02-18 11:06:33 -05:00
parent a7ada79fd9
commit e98bb1df66
42 changed files with 192 additions and 330 deletions

View File

@@ -96,14 +96,11 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
messages.append({"role": "system", "content": "Please introduce yourself to the user."})
await task.queue_frames([LLMRunFrame()])
async def update_settings():
await asyncio.sleep(10)
logger.info("Updating Google HTTP TTS settings: speaking_rate=1.4")
await task.queue_frame(
TTSUpdateSettingsFrame(update=GoogleHttpTTSSettings(speaking_rate=1.4))
)
asyncio.create_task(update_settings())
await asyncio.sleep(10)
logger.info("Updating Google HTTP TTS settings: speaking_rate=1.4")
await task.queue_frame(
TTSUpdateSettingsFrame(update=GoogleHttpTTSSettings(speaking_rate=1.4))
)
@transport.event_handler("on_client_disconnected")
async def on_client_disconnected(transport, client):