From 3ca4793a6a63a45f00cd8596e3c1a1dd99f571ac Mon Sep 17 00:00:00 2001 From: Liqun Li Date: Thu, 21 Dec 2023 15:24:02 +0800 Subject: [PATCH 1/2] remove executor_name --- taskweaver/code_interpreter/code_generator/code_generator.py | 3 --- .../code_interpreter/code_generator/code_generator_prompt.yaml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/taskweaver/code_interpreter/code_generator/code_generator.py b/taskweaver/code_interpreter/code_generator/code_generator.py index 178c8c07..878d47d9 100644 --- a/taskweaver/code_interpreter/code_generator/code_generator.py +++ b/taskweaver/code_interpreter/code_generator/code_generator.py @@ -20,7 +20,6 @@ class CodeGeneratorConfig(ModuleConfig): def _configure(self) -> None: self._set_name("code_generator") self.role_name = self._get_str("role_name", "ProgramApe") - self.executor_name = self._get_str("executor_name", "CodeExecutor") self.load_plugin = self._get_bool("load_plugin", True) self.load_example = self._get_bool("load_example", True) self.prompt_file_path = self._get_path( @@ -67,7 +66,6 @@ def __init__( self.llm_api = llm_api self.role_name = self.config.role_name - self.executor_name = self.config.executor_name self.post_translator = PostTranslator(logger) self.prompt_data = read_yaml(self.config.prompt_file_path) @@ -86,7 +84,6 @@ def __init__( self.instruction = self.instruction_template.format( ROLE_NAME=self.role_name, - EXECUTOR_NAME=self.executor_name, ) self.round_compressor: RoundCompressor = round_compressor diff --git a/taskweaver/code_interpreter/code_generator/code_generator_prompt.yaml b/taskweaver/code_interpreter/code_generator/code_generator_prompt.yaml index 3403cef7..cda67f5c 100644 --- a/taskweaver/code_interpreter/code_generator/code_generator_prompt.yaml +++ b/taskweaver/code_interpreter/code_generator/code_generator_prompt.yaml @@ -25,7 +25,7 @@ content: |- - {ROLE_NAME} generates the reply to the user with 'type' that must be one of the following: - "thought": the thoughts on the intermediate steps - "sample": textual descriptions including the sample code - - "python": the code that can be executed by {EXECUTOR_NAME}; comments must be added calling functions from the pre-defined plugins, including the description of the function and the parameters. + - "python": the code that can be executed by the User; comments must be added calling functions from the pre-defined plugins, including the description of the function and the parameters. - "text": the direct response in text without code - The "response" array can include multiple thought replies, but it can have only one of sample, python, or text, exclusively. - The value of "content" is a string that contains the actual content and {ROLE_NAME} must be very careful about escaping the special characters (e.g., '\', '/', and '"') in the string for JSON format. From 1a3ed4db5821ae26181f28b7ee09e9ff47e4eeda Mon Sep 17 00:00:00 2001 From: Liqun Li Date: Thu, 21 Dec 2023 15:40:19 +0800 Subject: [PATCH 2/2] fix ut --- tests/unit_tests/data/prompts/generator_prompt.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/data/prompts/generator_prompt.yaml b/tests/unit_tests/data/prompts/generator_prompt.yaml index 16818a27..a062802b 100644 --- a/tests/unit_tests/data/prompts/generator_prompt.yaml +++ b/tests/unit_tests/data/prompts/generator_prompt.yaml @@ -25,7 +25,7 @@ content: |- - {ROLE_NAME} generates the reply to the user with 'type' that must be one of the following: - "thought": the thoughts on the intermediate steps - "sample": textual descriptions including the sample code - - "python": the code that can be executed by {EXECUTOR_NAME}; comments must be added calling functions from the pre-defined plugins, including the description of the function and the parameters. + - "python": the code that can be executed by the User; comments must be added calling functions from the pre-defined plugins, including the description of the function and the parameters. - "text": the direct response in text without code - The "response" array can include multiple thought replies, but it can have only one of sample, python, or text, exclusively. - The value of "content" is a string that contains the actual content and {ROLE_NAME} must be very careful about escaping the special characters (e.g., '\', '/', and '"') in the string for JSON format.