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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user