Skip to content

Commit

Permalink
fix: fixed leftover call to ask_execute instead of confirm func
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Oct 15, 2024
1 parent 9498343 commit b7d2a3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gptme/tools/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pathlib import Path

from ..message import Message
from ..util import ask_execute, print_preview
from ..util import print_preview
from .base import ConfirmFunc, ToolSpec, ToolUse
from .patch import Patch

Expand Down Expand Up @@ -77,7 +77,7 @@ def execute_save(

# if the folder doesn't exist, ask to create it
if not path.parent.exists():
if not ask_execute("Folder doesn't exist, create it?"):
if not confirm("Folder doesn't exist, create it?"):
# early return
yield Message("system", "Save cancelled.")
return
Expand Down
1 change: 0 additions & 1 deletion gptme/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def print_preview(code: str, lang: str): # pragma: no cover


def ask_execute(question="Execute code?", default=True) -> bool: # pragma: no cover
# TODO: add a way to outsource ask_execute decision to another agent/LLM, possibly by overriding rich console somehow
print_bell() # Ring the bell just before asking for input
termios.tcflush(sys.stdin, termios.TCIFLUSH) # flush stdin

Expand Down

0 comments on commit b7d2a3f

Please sign in to comment.