🧪 test: level 2

This commit is contained in:
Florian Hönicke
2023-04-30 21:45:31 +02:00
parent 6ae41d6ae2
commit b197d6dd5a
2 changed files with 22 additions and 7 deletions

View File

@@ -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'
)

View File

@@ -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.