From 6c22629bce289615a3a19d05f44339340c5c4212 Mon Sep 17 00:00:00 2001 From: Kevin Gilpin Date: Thu, 22 Aug 2024 18:35:38 -0400 Subject: [PATCH] feat: Accept optional question name to Editor#ask --- navie/client.py | 4 +--- navie/editor.py | 5 +++-- navie/format_instructions.py | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/navie/client.py b/navie/client.py index d915e83..c595727 100644 --- a/navie/client.py +++ b/navie/client.py @@ -142,9 +142,7 @@ def context( ) self._execute(command, log_file) - def plan( - self, issue_file, output_file, context_file=None, prompt_file=None, options=None - ): + def plan(self, issue_file, output_file, context_file=None, prompt_file=None): log_file = os.path.join(self.work_dir, "plan.log") input_file = os.path.join(self.work_dir, "plan.txt") diff --git a/navie/editor.py b/navie/editor.py index 8396ada..5dc0def 100644 --- a/navie/editor.py +++ b/navie/editor.py @@ -67,6 +67,7 @@ def apply(self, filename, replace, search=None): def ask( self, question, + question_name="ask", prompt=None, options=None, context=None, @@ -75,8 +76,8 @@ def ask( ): self._log_action("@explain", options, question) - work_dir = self._work_dir("ask") - input_file = os.path.join(work_dir, "ask.input.txt") + work_dir = self._work_dir(question_name) + input_file = os.path.join(work_dir, f"ask.input.txt") output_file = os.path.join(work_dir, "ask.md") def read_output(save_cache): diff --git a/navie/format_instructions.py b/navie/format_instructions.py index 1377c64..5df5169 100644 --- a/navie/format_instructions.py +++ b/navie/format_instructions.py @@ -1,6 +1,5 @@ def xml_format_instructions(): - return """ -For each change you want to make, generate a pair of tags called and . + return """For each change you want to make, generate a pair of tags called and . Wrap these tags with a tag that also includes a tag with the file path.