From cd408ccefde5a015274b32e353777e52d73653a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Ho=CC=88nicke?= Date: Mon, 5 Jun 2023 17:35:31 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9E=95=20refactor:=20summarize=20error=20mes?= =?UTF-8?q?sage=20without=20line=20number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../generate/chains/auto_refine_description.py | 12 +++++++++--- test/unit/test_self_refinement.py | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dev_gpt/options/generate/chains/auto_refine_description.py b/dev_gpt/options/generate/chains/auto_refine_description.py index a3f275d..b1d23b2 100644 --- a/dev_gpt/options/generate/chains/auto_refine_description.py +++ b/dev_gpt/options/generate/chains/auto_refine_description.py @@ -43,10 +43,16 @@ def auto_refine_description(context): better_description_prompt = f'''{{context_string}} -Update the description of the Microservice to make it more precise without adding or removing information. -Note: the output must be a list of tasks the Microservice has to perform. -Note: you must uses the following tools if necessary: +Based on this description, update the tasks for the Microservice to be more precise. This update should neither add nor remove information. + +Constraints: + +- The output must be a list of tasks that the Microservice has to perform. +- The updated description must be unambiguous, using precise language and direct instructions. +- Use of non-specific formulations, such as 'like', 'such as', is strictly not allowed. +- The tools that can be used in the updated description: {get_available_tools()} +- Note: You are not required to use all tools for every task. Use them only when necessary. Example for the description: "return an image representing the current weather for a given location." \ when the tools gpt_3_5_turbo and google_custom_search are available: 1. get the current weather information from the https://openweathermap.org/ API diff --git a/test/unit/test_self_refinement.py b/test/unit/test_self_refinement.py index b367a61..2f4c013 100644 --- a/test/unit/test_self_refinement.py +++ b/test/unit/test_self_refinement.py @@ -12,3 +12,4 @@ def test_better_description(tmpdir): 'microservice_description': 'Input is a tweet that contains passive aggressive language. The output is the positive version of that tweet.' }) assert 'gpt_3_5_turbo' in better_description + assert 'such as' not in better_description