Skip to content

Commit 8b48252

Browse files
authored
fix asyncio.Future crash in console mode (#4952)
1 parent 69e66fa commit 8b48252

File tree

1 file changed

+1
-1
lines changed
  • livekit-agents/livekit/agents/cli

1 file changed

+1
-1
lines changed

livekit-agents/livekit/agents/cli/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ def _done_callback(task: asyncio.Task[list[RunEvent]]) -> None:
11711171
task = asyncio.create_task(_generate(text))
11721172
task.add_done_callback(_done_callback)
11731173

1174-
h: asyncio.Future[list[RunEvent]] = asyncio.Future()
1174+
h: asyncio.Future[list[RunEvent]] = c.io_loop.create_future()
11751175
c.io_loop.call_soon_threadsafe(_generate_with_context, text, h, context=c.io_context)
11761176

11771177
c.console.print()

0 commit comments

Comments
 (0)