Skip to content

Commit

Permalink
Fix prompt for alice/faber demo
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Costanzo <[email protected]>
  • Loading branch information
ianco committed Mar 5, 2025
1 parent 6bddc88 commit 8a9fd3f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions demo/runners/support/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import prompt_toolkit
import pygments
from prompt_toolkit.application import run_in_terminal
from prompt_toolkit.eventloop.defaults import use_asyncio_event_loop
from prompt_toolkit.formatted_text import FormattedText, PygmentsTokens
from prompt_toolkit.patch_stdout import patch_stdout
from prompt_toolkit.shortcuts import ProgressBar
Expand Down Expand Up @@ -141,7 +142,15 @@ def flatten(args):
yield arg


def prompt_init():
if hasattr(prompt_init, "_called"):
return
prompt_init._called = True
use_asyncio_event_loop()


async def prompt(*args, **kwargs):
prompt_init()
with patch_stdout():
try:
while True:
Expand Down

0 comments on commit 8a9fd3f

Please sign in to comment.