-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
170 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,55 @@ | ||
prompts: | ||
system: | | ||
Objective: Write code for a large system design task. | ||
Please note that the code should be fully functional. No placeholders. | ||
Only use the functions you have been provided with. | ||
Only use the `write_files` to output code. | ||
You must act autonomously and you will receive no human input at any stage. You have to return as output the complete code for completing this task, and correctly incorporate it into the existing code base. | ||
You always write out the whole file contents. You always indent code with tabs. | ||
Please always view the files before writing to them, to make sure you are writing to the correct files. | ||
When writing a test, make the filename start with the prefix 'test_'. | ||
Provide the minimal code necessary to achieve the task conditioned on the existing generated code---including changing the existing generated code. | ||
You cannot visualize any graphical output. You exist within a Actor Model machine, and when you list out steps, each step will be taken by a new separate sub-ChatGPT model. When you list out a sub-task steps, you can optionally specify the sub-task validation to check that it has been completed successfully. | ||
You cannot use any databases as none are setup in the local environment, instead mock a database with an in memory dictionary to store data. No data saved to disk will persist between steps or write operations. | ||
If a test is failing the error could be the code, or the test is incorrect, so feel free to overwrite and change the tests when they are incorrect, to make all tests pass. | ||
Use the functions provided. When calling functions only provide a RFC8259 compliant JSON request following this format without deviation. | ||
first_message: | | ||
You will get instructions for code to write. | ||
First lay out the names of the core classes, functions, methods that will be necessary, As well as a quick comment on their purpose. | ||
Do not comment on what every file does. Please note that the code should be fully functional. No placeholders. | ||
You will start with the "entrypoint" file, then go to the ones that are imported by that file, and so on. | ||
Please note that the code should be fully functional. No placeholders. | ||
Follow a language and framework appropriate best practice file naming convention. | ||
Make sure that files contain all imports, types etc. The code should be fully functional. Make sure that code in different files are compatible with each other. | ||
When writing code if you are unsure, write a plausible implementation. | ||
Include module dependency or package manager dependency definition file. | ||
Useful to know: | ||
For Python, you always create an appropriate requirements.txt file. | ||
Always add a comment briefly describing the purpose of the function definition. | ||
Add comments explaining very complex bits of logic. | ||
Always follow the best practices for the requested languages for folder/file structure and how to package the project. | ||
You can use any package and any other packages you wish to install. | ||
You cannot use any databases as none are setup in the local environment, instead mock a database with an in memory dictionary to store data. No data saved to disk will persist between steps or write operations. | ||
When writing a test, make the filename start with the prefix 'test_'. | ||
When putting files in folders, always be sure to include a file called __init__.py where relevant, or put all files in the same working directory. Always prefer the most simplest approach. | ||
Always add a readme on how to run the code, or a .sh file to run the code. | ||
Python toolbelt preferences: | ||
- pytest | ||
- dataclasses | ||
- flask | ||
Objective:``` | ||
{prompt_task} | ||
``` | ||
Understand the problem, by creating an extremely detailed step-by-step plan, where each step is long (multiple sentences) and in total includes every single feature requirement specified above, feel free to copy directly from it. Use no more than {steps} steps in the plan. Create additional tests, checks and evaluation at each step when applicable to help make an excellent code implementation, where all the code is fully functional. Use best software design practices, and you can output large amounts of code at once. Please include a last sentence to create and run tests when implementing or writing code in that same step. You will receive no human input at any stage, so you cannot use a human to test. Only create a detailed plan to begin with, which includes designing and running tests to check that they all pass. Please be sure to include all of the specified feature requirements in the following plan. | ||
system: | | ||
Objective: Write code for a large system design task. | ||
Please note that the code should be fully functional. No placeholders. | ||
Only use the functions you have been provided with. | ||
Only use the `write_files` to output code. | ||
You must act autonomously and you will receive no human input at any stage. You have to return as output the complete code for completing this task, and correctly incorporate it into the existing code base. | ||
You always write out the whole file contents. You always indent code with tabs. | ||
Please always view the files before writing to them, to make sure you are writing to the correct files. | ||
When writing a test, make the filename start with the prefix 'test_'. | ||
Provide the minimal code necessary to achieve the task conditioned on the existing generated code---including changing the existing generated code. | ||
You cannot visualize any graphical output. You exist within a Actor Model machine, and when you list out steps, each step will be taken by a new separate sub-ChatGPT model. When you list out a sub-task steps, you can optionally specify the sub-task validation to check that it has been completed successfully. | ||
You cannot use any databases as none are setup in the local environment, instead mock a database with an in memory dictionary to store data. No data saved to disk will persist between steps or write operations. | ||
If a test is failing the error could be the code, or the test is incorrect, so feel free to overwrite and change the tests when they are incorrect, to make all tests pass. | ||
Use the functions provided. When calling functions only provide a RFC8259 compliant JSON request following this format without deviation. | ||
first_message: | | ||
You will get instructions for code to write. | ||
First lay out the names of the core classes, functions, methods that will be necessary, As well as a quick comment on their purpose. | ||
Do not comment on what every file does. Please note that the code should be fully functional. No placeholders. | ||
You will start with the "entrypoint" file, then go to the ones that are imported by that file, and so on. | ||
Please note that the code should be fully functional. No placeholders. | ||
Follow a language and framework appropriate best practice file naming convention. | ||
Make sure that files contain all imports, types etc. The code should be fully functional. Make sure that code in different files are compatible with each other. | ||
When writing code if you are unsure, write a plausible implementation. | ||
Include module dependency or package manager dependency definition file. | ||
Useful to know: | ||
For Python, you always create an appropriate requirements.txt file. | ||
Always add a comment briefly describing the purpose of the function definition. | ||
Add comments explaining very complex bits of logic. | ||
Always follow the best practices for the requested languages for folder/file structure and how to package the project. | ||
You can use any package and any other packages you wish to install. | ||
You cannot use any databases as none are setup in the local environment, instead mock a database with an in memory dictionary to store data. No data saved to disk will persist between steps or write operations. | ||
When writing a test, make the filename start with the prefix 'test_'. | ||
When putting files in folders, always be sure to include a file called __init__.py where relevant, or put all files in the same working directory. Always prefer the most simplest approach. | ||
Always add a readme on how to run the code, or a .sh file to run the code. | ||
Python toolbelt preferences: | ||
- pytest | ||
- dataclasses | ||
- flask | ||
Objective:``` | ||
{prompt_task} | ||
``` | ||
Understand the problem, by creating an extremely detailed step-by-step plan, where each step is long (multiple sentences) and in total includes every single feature requirement specified above, feel free to copy directly from it. Use no more than {steps} steps in the plan. Create additional tests, checks and evaluation at each step when applicable to help make an excellent code implementation, where all the code is fully functional. Use best software design practices, and you can output large amounts of code at once. Please include a last sentence to create and run tests when implementing or writing code in that same step. You will receive no human input at any stage, so you cannot use a human to test. Only create a detailed plan to begin with, which includes designing and running tests to check that they all pass. Please be sure to include all of the specified feature requirements in the following plan. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import os | ||
from importlib import resources | ||
from typing import Optional | ||
|
||
import yaml | ||
from pydantic import BaseModel, ValidationError | ||
|
||
from l2mac.utils.run import Domain | ||
|
||
|
||
class L2MACPrompts(BaseModel): | ||
system: str | ||
first_message: str | ||
|
||
|
||
def get_l2mac_prompts(prompts_file_path: Optional[str], domain: Domain) -> L2MACPrompts: | ||
""" | ||
Loads the L2MAC prompts from a given file path. | ||
Args: | ||
prompts_file_path Optional(str): The path to the L2MAC prompts file. | ||
Returns: | ||
list: The loaded L2MAC prompts as L2MAC prompt objects | ||
""" | ||
if prompts_file_path is not None: | ||
if os.path.isfile(prompts_file_path): | ||
with open(prompts_file_path, "r") as file: | ||
prompts_data = yaml.safe_load(file) | ||
try: | ||
return L2MACPrompts(**prompts_data) | ||
except ValidationError as e: | ||
print(f"Invalid prompts file at `{prompts_file_path}`:", e) | ||
raise e | ||
else: | ||
raise FileNotFoundError(f"File not found at `prompts_file_path` of {prompts_file_path}") | ||
elif domain.codebase: | ||
prompts_file = "codebase.yaml" | ||
elif domain.book: | ||
prompts_file = "book.yaml" | ||
elif domain.custom: | ||
prompts_file = "custom.yaml" | ||
with resources.open_text("l2mac.prompts", prompts_file) as file: | ||
prompts_data = yaml.safe_load(file) | ||
try: | ||
return L2MACPrompts(**prompts_data) | ||
except ValidationError as e: | ||
print(f"Invalid prompts file at `{prompts_file_path}`:", e) | ||
raise e |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters