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

@@ -87,14 +87,11 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
logger.info(f"Client connected")
await task.queue_frames([LLMRunFrame()])
async def update_settings():
await asyncio.sleep(10)
logger.info("Updating Gemini Live LLM settings: temperature=0.1")
await task.queue_frame(
LLMUpdateSettingsFrame(update=GeminiLiveLLMSettings(temperature=0.1))
)
asyncio.create_task(update_settings())
await asyncio.sleep(10)
logger.info("Updating Gemini Live LLM settings: temperature=0.1")
await task.queue_frame(
LLMUpdateSettingsFrame(update=GeminiLiveLLMSettings(temperature=0.1))
)
@transport.event_handler("on_client_disconnected")
async def on_client_disconnected(transport, client):