Make steps configurable

This commit is contained in:
Anton Osika
2023-06-17 13:02:16 +02:00
parent ee0737b6e3
commit 03d8fff5d2
10 changed files with 27 additions and 8 deletions

View File

@@ -0,0 +1 @@
Build a currency converter app using an API for exchange rates. Use HTML, CSS, and JavaScript for the frontend and Node.js for the backend. Allow users to convert between different currencies.

View File

@@ -0,0 +1 @@
Create a file organizer CLI tool in Python that sorts files in a directory based on their file types (e.g., images, documents, audio) and moves them into corresponding folders.

View File

@@ -0,0 +1 @@
Build a simple markdown editor using HTML, CSS, and JavaScript. Allow users to input markdown text and display the formatted output in real-time.

View File

@@ -0,0 +1 @@
Create a password generator CLI tool in Python that generates strong, random passwords based on user-specified criteria, such as length and character types (letters, numbers, symbols).

View File

@@ -0,0 +1 @@
Develop a Pomodoro timer app using HTML, CSS, and JavaScript. Allow users to set work and break intervals and receive notifications when it's time to switch.

View File

@@ -0,0 +1 @@
Create a URL shortener app using HTML, CSS, JavaScript, and a backend language like Python or Node.js. Allow users to input a long URL and generate a shortened version that redirects to the original URL. Store the shortened URLs in a database.

View File

@@ -0,0 +1 @@
Develop a weather app using Python and a weather API. Display current weather conditions for a given location, including temperature, humidity, and weather description.

View File

@@ -21,6 +21,7 @@ def chat(
), ),
model: str = "gpt-4", model: str = "gpt-4",
temperature: float = 0.1, temperature: float = 0.1,
steps_config: str = "default",
): ):
app_dir = pathlib.Path(os.path.curdir) app_dir = pathlib.Path(os.path.curdir)
input_path = project_path input_path = project_path
@@ -40,7 +41,7 @@ def chat(
identity=DB(app_dir / "identity"), identity=DB(app_dir / "identity"),
) )
for step in STEPS: for step in STEPS[steps_config]:
messages = step(ai, dbs) messages = step(ai, dbs)
dbs.logs[step.__name__] = json.dumps(messages) dbs.logs[step.__name__] = json.dumps(messages)

View File

@@ -62,7 +62,11 @@ def run_clarified(ai: AI, dbs: DBs):
return messages return messages
STEPS = [clarify, run_clarified] # Different configs of what steps to run
STEPS = {
'default': [run],
'clarify': [clarify, run_clarified],
}
# Future steps that can be added: # Future steps that can be added:
# improve_files, # improve_files,

View File

@@ -10,19 +10,26 @@ import shutil
import argparse import argparse
import json import json
from pathlib import Path from pathlib import Path
from typer import run
from itertools import islice
def main(
def main(): n_benchmarks: int | None = None,
):
processes = [] processes = []
files = [] files = []
benchmarks = Path('benchmark') path = Path('benchmark')
for folder in benchmarks.iterdir():
if n_benchmarks:
benchmarks = islice(path.iterdir(), n_benchmarks)
for folder in benchmarks:
if os.path.isdir(folder): if os.path.isdir(folder):
print('Running benchmark for {}'.format(folder)) print('Running benchmark for {}'.format(folder))
log_path = folder / 'log.txt' log_path = folder / 'log.txt'
log_file = open(log_path, 'w') log_file = open(log_path, 'w')
processes.append(subprocess.Popen(['python', '-m', 'gpt_engineer.main', folder], stdout=log_file, stderr=log_file)) processes.append(subprocess.Popen(['python', '-m', 'gpt_engineer.main', folder], stdout=log_file, stderr=log_file, bufsize=0))
files.append(log_file) files.append(log_file)
print('You can stream the log file by running: tail -f {}'.format(log_path)) print('You can stream the log file by running: tail -f {}'.format(log_path))
@@ -34,6 +41,6 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
main() run(main)