From b197d6dd5ab94aeb22f4341b17a03d6a9ae4aeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Ho=CC=88nicke?= Date: Sun, 30 Apr 2023 21:45:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20level=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/options/generate/generator.py | 20 +++++++++++++++----- src/options/generate/templates_user.py | 9 +++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/options/generate/generator.py b/src/options/generate/generator.py index d2a129b..cfb0a24 100644 --- a/src/options/generate/generator.py +++ b/src/options/generate/generator.py @@ -432,17 +432,27 @@ gptdeploy deploy --path {self.microservice_root_path} 'task', '', template_pm_task_iteration, - micro_service_initial_description=f'Microservice description: {self.microservice_specification.task}' + micro_service_initial_description=f'''Microservice description: +{self.microservice_specification.task} +''', ) - # replacing the system message of the task with the system message of the test - messages[0] = SystemMessage(content=system_task_introduction + system_test_iteration) + + messages = [ + SystemMessage(content=system_task_introduction + system_test_iteration), + + ] self.refine_requirements( pm, messages, 'test', '''Note that the test scenario must not contain information that was already mentioned in the microservice description. Note that you must not ask for information that were already mentioned before.''', - template_pm_test_iteration + template_pm_test_iteration, + micro_service_initial_description=f'''Microservice original description: +{original_task} +Microservice refined description: +{self.microservice_specification.task} +''', ) break except self.TaskRefinementException as e: @@ -465,7 +475,7 @@ Test scenario: agent_response_raw = conversation.chat( template_pm_iteration.format( custom_suffix=custom_suffix, - **{'micro_service_initial_description': micro_service_initial_description} if refinement_type == 'task' and len(messages) == 1 else {} + **{'micro_service_initial_description': micro_service_initial_description} if len(messages) == 1 else {} ), role='user' ) diff --git a/src/options/generate/templates_user.py b/src/options/generate/templates_user.py index ab2a913..b6a5876 100644 --- a/src/options/generate/templates_user.py +++ b/src/options/generate/templates_user.py @@ -177,7 +177,9 @@ Name all packages which need to be installed via `apt-get install` in above Dock {requirements_file_wrapped} -Output them as a white space separated list:''' +Note that you must not list packages that are already installed in the Dockerfile. +Output the packages as a white space separated list: +''' ) @@ -374,7 +376,10 @@ Note that if urls, secrets, database names, etc. are mentioned, they must be par ) template_pm_test_iteration = PromptTemplate.from_template( - '''If the example input for the microservice was mentioned already, then output final.txt. + '''{micro_service_initial_description} +1. Look at the original description and the refined description. +2. find out if the original description and the refined description contain an example input for the microservice. +If the example input for the microservice is mentioned in the refined description or the original description, then output final.txt. Otherwise, output prompt.txt where you ask for the example input file as URL. Except for urls, you should come up with your own example input that makes sense for the microservice description.