Update CodeGeneratorAtomicFlow.yaml
Browse files- CodeGeneratorAtomicFlow.yaml +21 -12
CodeGeneratorAtomicFlow.yaml
CHANGED
|
@@ -4,9 +4,13 @@ enable_cache: True
|
|
| 4 |
|
| 5 |
input_interface_non_initialized: # initial input keys
|
| 6 |
- "goal"
|
|
|
|
|
|
|
| 7 |
|
| 8 |
input_interface_initialized: # input_keys
|
| 9 |
- "goal"
|
|
|
|
|
|
|
| 10 |
|
| 11 |
#######################################################
|
| 12 |
# Output keys
|
|
@@ -22,19 +26,24 @@ system_message_prompt_template:
|
|
| 22 |
template: |2-
|
| 23 |
You are a world class programmer that can complete any goal with code. All code you write should be functions.
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
Your
|
| 28 |
-
|
| 29 |
-
|
| 30 |
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
An example of a function you write:
|
| 40 |
### begin of example ###
|
|
@@ -50,10 +59,8 @@ system_message_prompt_template:
|
|
| 50 |
Performance Evaluation:
|
| 51 |
1. The priority language is Python, try to code with Python to solve the task.
|
| 52 |
2. All code you write must be functions.
|
| 53 |
-
3.
|
| 54 |
-
4.
|
| 55 |
-
5. All imports must be done within the function body.
|
| 56 |
-
6. All functions must have docstrings.
|
| 57 |
|
| 58 |
**It's important that you should only respond in JSON format as described below:**
|
| 59 |
Response Format:
|
|
@@ -67,6 +74,8 @@ system_message_prompt_template:
|
|
| 67 |
|
| 68 |
**It's important that the code you generate can be written by Python write, and is human-readable. The written file must also be indented and formatted, so that it is human-readable.**
|
| 69 |
|
|
|
|
|
|
|
| 70 |
human_message_prompt_template:
|
| 71 |
_target_: flows.prompt_template.JinjaPrompt
|
| 72 |
template: |2-
|
|
|
|
| 4 |
|
| 5 |
input_interface_non_initialized: # initial input keys
|
| 6 |
- "goal"
|
| 7 |
+
- "code_library"
|
| 8 |
+
- "memory_files"
|
| 9 |
|
| 10 |
input_interface_initialized: # input_keys
|
| 11 |
- "goal"
|
| 12 |
+
- "code_library"
|
| 13 |
+
- "memory_files"
|
| 14 |
|
| 15 |
#######################################################
|
| 16 |
# Output keys
|
|
|
|
| 26 |
template: |2-
|
| 27 |
You are a world class programmer that can complete any goal with code. All code you write should be functions.
|
| 28 |
|
| 29 |
+
You have a library of executable functions located at {{code_library_file_location}} for your disposal, the code you write will also be added to this file.
|
| 30 |
|
| 31 |
+
Your tasks are:
|
| 32 |
+
1. Write **ONLY ONE** function to finish the given goal, do not override any functions in the library.
|
| 33 |
+
2. Also write docstrings to the new function.
|
| 34 |
|
| 35 |
+
Notice that:
|
| 36 |
+
1. Write functions only.
|
| 37 |
+
2. Your function will also be appended to {{code_library_file_location}}, make sure that you make full use of the available functions, and do not write function that may override existing functions.
|
| 38 |
+
3. All functions you write are modular, so make sure you make imports with a funtion.
|
| 39 |
+
4. You must write docstrings for every function you write.
|
| 40 |
|
| 41 |
+
Here are the contents in the code library located ta {{code_library_file_location}}, make sure you make full use of them:
|
| 42 |
+
{{code_library}}
|
| 43 |
|
| 44 |
+
Your function will then be imported and called by an executor to finish the goal, you do not need to worry about the execution part.
|
| 45 |
|
| 46 |
+
You can access the Internet, using APIs of online services could be useful.
|
| 47 |
|
| 48 |
An example of a function you write:
|
| 49 |
### begin of example ###
|
|
|
|
| 59 |
Performance Evaluation:
|
| 60 |
1. The priority language is Python, try to code with Python to solve the task.
|
| 61 |
2. All code you write must be functions.
|
| 62 |
+
3. All imports must be done within the function body.
|
| 63 |
+
4. All functions must have docstrings.
|
|
|
|
|
|
|
| 64 |
|
| 65 |
**It's important that you should only respond in JSON format as described below:**
|
| 66 |
Response Format:
|
|
|
|
| 74 |
|
| 75 |
**It's important that the code you generate can be written by Python write, and is human-readable. The written file must also be indented and formatted, so that it is human-readable.**
|
| 76 |
|
| 77 |
+
input_variables: ["code_library_file_location", "code_library"]
|
| 78 |
+
|
| 79 |
human_message_prompt_template:
|
| 80 |
_target_: flows.prompt_template.JinjaPrompt
|
| 81 |
template: |2-
|