feat: more stable

This commit is contained in:
Florian Hönicke
2023-03-29 14:59:42 +02:00
parent 11dbc8b162
commit a247779a19
4 changed files with 97 additions and 47 deletions

View File

@@ -27,14 +27,12 @@ def _task(task, tag_name, file_name):
)
def executor_file_task(executor_name, executor_description, test_scenario, input_modality, input_doc_field,
output_modality, output_doc_field):
def executor_file_task(executor_name, executor_description, test_scenario, package):
return _task(f'''
Write the executor called '{executor_name}'.
It matches the following description: '{executor_description}'.
It will be tested with the following scenario: '{test_scenario}'.
It gets a DocumentArray as input where each document has the input modality '{input_modality}' and can be accessed via document.{input_doc_field}.
It returns a DocumentArray as output where each document has the output modality '{output_modality}' that is stored in document.{output_doc_field}.
For the implementation use the following package: '{package}'.
Have in mind that d.uri is never a path to a local file. It is always a url.
''' + not_allowed(),
EXECUTOR_FILE_TAG,
@@ -53,7 +51,8 @@ def test_executor_file_task(executor_name, test_scenario):
+ "Use the following import to import the executor: "
f"from executor import {executor_name} "
+ not_allowed()
+ "The test is not allowed to open local files. ",
+ "The test is not allowed to open local files. "
+ "The test is not allowed to mock a function of the executor. ",
TEST_EXECUTOR_FILE_TAG,
TEST_EXECUTOR_FILE_NAME
)
@@ -105,8 +104,7 @@ def streamlit_file_task():
def chain_of_thought_creation():
return (
"First, write down some non-obvious thoughts about the challenges of the task and give multiple approaches on how you handle them. "
"For example, there are different libraries you could use and not all of them obay the rules: "
+ not_allowed()
"For example, the given package you could used in different ways and not all of them obay the rules: "
+ "Discuss the pros and cons for all of these approaches and then decide for one of the approaches. "
"Then write as I told you. "
)
@@ -131,4 +129,7 @@ The executor is not allowed to use the GPU.
The executor is not allowed to access a database.
The executor is not allowed to access a display.
The executor is not allowed to access external apis.
The executor is not allowed to access the file system.
The executor is not allowed to use a pre-trained model.
The executor is not allowed to train a model.
'''