jensinjames
commited on
Commit
•
ed21180
1
Parent(s):
c102199
Upload 9 files
Browse files- .gitignore +51 -0
- .pre-commit-config.yaml +34 -0
- LICENSE +21 -0
- MANIFEST.in +1 -0
- Makefile +53 -0
- README.md +60 -3
- ROADMAP.md +47 -0
- pyproject.toml +90 -0
- requirements.txt +9 -0
.gitignore
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
2 |
+
|
3 |
+
# Byte-compiled / optimized / DLL files
|
4 |
+
__pycache__/
|
5 |
+
*.py[cod]
|
6 |
+
*$py.class
|
7 |
+
|
8 |
+
# Distribution / packaging
|
9 |
+
dist/
|
10 |
+
build/
|
11 |
+
*.egg-info/
|
12 |
+
*.egg
|
13 |
+
|
14 |
+
# Virtual environments
|
15 |
+
.env
|
16 |
+
.env.sh
|
17 |
+
venv/
|
18 |
+
ENV/
|
19 |
+
|
20 |
+
# IDE-specific files
|
21 |
+
.vscode/
|
22 |
+
.idea/
|
23 |
+
|
24 |
+
# Compiled Python modules
|
25 |
+
*.pyc
|
26 |
+
*.pyo
|
27 |
+
*.pyd
|
28 |
+
|
29 |
+
# Python testing
|
30 |
+
.pytest_cache/
|
31 |
+
.ruff_cache/
|
32 |
+
.coverage
|
33 |
+
.mypy_cache/
|
34 |
+
|
35 |
+
# macOS specific files
|
36 |
+
.DS_Store
|
37 |
+
|
38 |
+
# Windows specific files
|
39 |
+
Thumbs.db
|
40 |
+
|
41 |
+
# this application's specific files
|
42 |
+
archive
|
43 |
+
|
44 |
+
# any log file
|
45 |
+
*log.txt
|
46 |
+
todo
|
47 |
+
scratchpad
|
48 |
+
|
49 |
+
# Ignore GPT Engineer files
|
50 |
+
projects
|
51 |
+
!projects/example
|
.pre-commit-config.yaml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# See https://pre-commit.com for more information
|
2 |
+
# See https://pre-commit.com/hooks.html for more hooks
|
3 |
+
fail_fast: true
|
4 |
+
|
5 |
+
|
6 |
+
repos:
|
7 |
+
|
8 |
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
9 |
+
rev: v1.3.0
|
10 |
+
hooks:
|
11 |
+
- id: mypy
|
12 |
+
|
13 |
+
- repo: https://github.com/psf/black
|
14 |
+
rev: 23.3.0
|
15 |
+
hooks:
|
16 |
+
- id: black
|
17 |
+
args: [--config, pyproject.toml]
|
18 |
+
types: [python]
|
19 |
+
|
20 |
+
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
21 |
+
rev: "v0.0.272"
|
22 |
+
hooks:
|
23 |
+
- id: ruff
|
24 |
+
args: [--fix, --exit-non-zero-on-fix]
|
25 |
+
|
26 |
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
27 |
+
rev: v4.4.0
|
28 |
+
hooks:
|
29 |
+
- id: check-toml
|
30 |
+
id: check-yaml
|
31 |
+
id: detect-private-key
|
32 |
+
id: end-of-file-fixer
|
33 |
+
id: trailing-whitespace
|
34 |
+
|
LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2023 Anton Osika
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
MANIFEST.in
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
recursive-include gpt_engineer/preprompts *
|
Makefile
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
SHELL := /bin/bash
|
2 |
+
|
3 |
+
# Color codes
|
4 |
+
COLOR_RESET=\033[0m
|
5 |
+
COLOR_CYAN=\033[1;36m
|
6 |
+
COLOR_GREEN=\033[1;32m
|
7 |
+
|
8 |
+
.PHONY: help install dev-install run
|
9 |
+
|
10 |
+
.DEFAULT_GOAL := help
|
11 |
+
|
12 |
+
.SILENT:
|
13 |
+
|
14 |
+
name := $(word 2,$(MAKECMDGOALS))
|
15 |
+
|
16 |
+
help:
|
17 |
+
@echo "Please use 'make <target>' where <target> is one of the following:"
|
18 |
+
@echo " help Return this message with usage instructions."
|
19 |
+
@echo " install Will install the dependencies and create a virtual environment."
|
20 |
+
@echo " dev-install Will install the dev dependencies too."
|
21 |
+
@echo " run <folder_name> Runs GPT Engineer on the folder with the given name."
|
22 |
+
|
23 |
+
dev-install: install
|
24 |
+
|
25 |
+
install: create-venv upgrade-pip install-dependencies install-pre-commit farewell
|
26 |
+
|
27 |
+
create-venv:
|
28 |
+
@echo -e "$(COLOR_CYAN)Creating virtual environment...$(COLOR_RESET)" && \
|
29 |
+
python -m venv venv
|
30 |
+
|
31 |
+
upgrade-pip:
|
32 |
+
@echo -e "$(COLOR_CYAN)Upgrading pip...$(COLOR_RESET)" && \
|
33 |
+
source venv/bin/activate && \
|
34 |
+
pip install --upgrade pip >> /dev/null
|
35 |
+
|
36 |
+
install-dependencies:
|
37 |
+
@echo -e "$(COLOR_CYAN)Installing dependencies...$(COLOR_RESET)" && \
|
38 |
+
source venv/bin/activate && \
|
39 |
+
pip install -e . >> /dev/null
|
40 |
+
|
41 |
+
install-pre-commit:
|
42 |
+
@echo -e "$(COLOR_CYAN)Installing pre-commit hooks...$(COLOR_RESET)" && \
|
43 |
+
source venv/bin/activate && \
|
44 |
+
pre-commit install
|
45 |
+
|
46 |
+
farewell:
|
47 |
+
@echo -e "$(COLOR_GREEN)All done!$(COLOR_RESET)"
|
48 |
+
|
49 |
+
run:
|
50 |
+
@echo -e "$(COLOR_CYAN)Running GPT Engineer on $(COLOR_GREEN)$(name)$(COLOR_CYAN) folder...$(COLOR_RESET)" && \
|
51 |
+
source venv/bin/activate && \
|
52 |
+
gpt-engineer projects/$(name)
|
53 |
+
|
README.md
CHANGED
@@ -1,3 +1,60 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# GPT Engineer
|
2 |
+
[![Discord Follow](https://dcbadge.vercel.app/api/server/4t5vXHhu?style=flat)](https://discord.gg/4t5vXHhu)
|
3 |
+
[![GitHub Repo stars](https://img.shields.io/github/stars/AntonOsika/gpt-engineer?style=social)](https://github.com/AntonOsika/gpt-engineer)
|
4 |
+
[![Twitter Follow](https://img.shields.io/twitter/follow/antonosika?style=social)](https://twitter.com/AntonOsika)
|
5 |
+
|
6 |
+
|
7 |
+
**Specify what you want it to build, the AI asks for clarification, and then builds it.**
|
8 |
+
|
9 |
+
GPT Engineer is made to be easy to adapt, extend, and make your agent learn how you want your code to look. It generates an entire codebase based on a prompt.
|
10 |
+
|
11 |
+
[Demo](https://twitter.com/antonosika/status/1667641038104674306) 👶🤖
|
12 |
+
|
13 |
+
## Project philosophy
|
14 |
+
- Simple to get value
|
15 |
+
- Flexible and easy to add new own "AI steps". See `steps.py`.
|
16 |
+
- Incrementally build towards a user experience of:
|
17 |
+
1. high level prompting
|
18 |
+
2. giving feedback to the AI that it will remember over time
|
19 |
+
- Fast handovers back and forth between AI and human
|
20 |
+
- Simplicity, all computation is "resumable" and persisted to the filesystem
|
21 |
+
|
22 |
+
## Setup
|
23 |
+
- `git clone git@github.com:AntonOsika/gpt-engineer.git`
|
24 |
+
- `cd gpt-engineer`
|
25 |
+
- `pip install -e .`
|
26 |
+
- (or: `make install && source venv/bin/activate` for a venv)
|
27 |
+
|
28 |
+
With an api key that has GPT4 access run:
|
29 |
+
|
30 |
+
- `export OPENAI_API_KEY=[your api key]`
|
31 |
+
|
32 |
+
|
33 |
+
**Run**:
|
34 |
+
- Create an empty folder. If inside the repo, you can run:
|
35 |
+
- `cp -r projects/example/ projects/my-new-project`
|
36 |
+
- Fill in the `main_prompt` file in your new folder
|
37 |
+
- Run: `gpt-engineer projects/my-new-project`
|
38 |
+
|
39 |
+
**Results**
|
40 |
+
- Check the generated files in `projects/my-new-project/workspace`
|
41 |
+
|
42 |
+
|
43 |
+
## Features
|
44 |
+
You can specify the "identity" of the AI agent by editing the files in the `identity` folder.
|
45 |
+
|
46 |
+
Editing the identity, and evolving the `main_prompt`, is currently how you make the agent remember things between projects.
|
47 |
+
|
48 |
+
Each step in `steps.py` will have its communication history with GPT4 stored in the logs folder, and can be rerun with `scripts/rerun_edited_message_logs.py`.
|
49 |
+
|
50 |
+
## Contributing
|
51 |
+
We are building the open platform for devs to tinker with and build their personal code-generation toolbox.
|
52 |
+
|
53 |
+
If you want to contribute, please check out the [roadmap](https://github.com/AntonOsika/gpt-engineer/blob/main/ROADMAP.md), [projects](https://github.com/AntonOsika/gpt-engineer/projects?query=is%3Aopen) or [issues tab](https://github.com/AntonOsika/gpt-engineer/issues) in the GitHub repo. You are welcome to read the [contributing document](.github/CONTRIBUTING.md) and join our [Discord 💬](https://discord.gg/4t5vXHhu).
|
54 |
+
|
55 |
+
We are currently looking for more maintainers and community organisers. Email anton.osika@gmail.com if you are interested in an official role.
|
56 |
+
|
57 |
+
|
58 |
+
## Example
|
59 |
+
|
60 |
+
https://github.com/AntonOsika/gpt-engineer/assets/4467025/6e362e45-4a94-4b0d-973d-393a31d92d9b
|
ROADMAP.md
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Roadmap
|
2 |
+
|
3 |
+
We are building AGI by first creating the code generation tooling of the future.
|
4 |
+
|
5 |
+
There are three main milestones we think can improve gpt-engineer's capability 2x:
|
6 |
+
- Continuous evaluation of our progress
|
7 |
+
- Make code generation become small, verifiable steps
|
8 |
+
- Run tests and fix errors with GPT4
|
9 |
+
|
10 |
+
|
11 |
+
## Steps to achieve our roadmap
|
12 |
+
|
13 |
+
- [ ] Continuous evaluation of our progress
|
14 |
+
- [ ] Create a step that asks “did it run/work/perfect” in the end of each run [#240](https://github.com/AntonOsika/gpt-engineer/issues/240)
|
15 |
+
- [ ] Run the benchmark multiple times, and document the results for the different "step configs" (`STEPS` in `steps.py`) [#239](https://github.com/AntonOsika/gpt-engineer/issues/239)
|
16 |
+
- [ ] Document the best performing configs, and feed these learnings into our roadmap
|
17 |
+
- [ ] Collect a dataset for gpt engineer to learn from, by storing code generation runs, and if they fail/succeed (on an opt out basis)
|
18 |
+
- [ ] Self healing code
|
19 |
+
- [ ] Feed the results of failing tests back into GPT4 and ask it to fix the code
|
20 |
+
- [ ] Let human give feedback
|
21 |
+
- [ ] Ask human for what is not working as expected in a loop, and feed it into GPT4 to fix the code, until the human is happy or gives up
|
22 |
+
- [ ] Make code generation become small, verifiable steps
|
23 |
+
- [ ] Ask GPT4 to decide how to sequence the entire generation, and do one
|
24 |
+
prompt for each subcomponent
|
25 |
+
- [ ] For each small part, generate tests for that subpart, and do the loop of running the tests for each part, feeding
|
26 |
+
results into GPT4, and let it edit the code until they pass
|
27 |
+
- [ ] LLM tests in CI
|
28 |
+
- [ ] Run very small tests with GPT3.5 in CI, to make sure we don't worsen
|
29 |
+
performance over time
|
30 |
+
- [ ] Dynamic planning
|
31 |
+
- [ ] Let gpt-engineer plan which "steps" to carry out itself, depending on the
|
32 |
+
task, by giving it few shot example of what are usually "the right-sized steps" to carry
|
33 |
+
out for other projects
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
# How you can help out
|
38 |
+
You can:
|
39 |
+
- Sign up to help [measure the progress of gpt-engineer towards "bootstrapping"](https://forms.gle/TMX68mScyxQUsE6Y9)
|
40 |
+
- Submit PRs to address one of the items in the roadmap
|
41 |
+
|
42 |
+
### Repository ergonomics
|
43 |
+
- [ ] Set up automatic AI/LLM based PR review
|
44 |
+
|
45 |
+
### Ad hoc experiments
|
46 |
+
- [ ] Microsoft guidance, and benchmark if this helps improve performance
|
47 |
+
|
pyproject.toml
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[build-system]
|
2 |
+
requires = ["setuptools", "wheel"]
|
3 |
+
|
4 |
+
[project]
|
5 |
+
name = "gpt-engineer"
|
6 |
+
version = "0.0.6"
|
7 |
+
description = "Specify what you want it to build, the AI asks for clarification, and then builds it."
|
8 |
+
readme = "README.md"
|
9 |
+
requires-python = ">=3"
|
10 |
+
dependencies = [
|
11 |
+
'black == 23.3.0',
|
12 |
+
'mypy == 1.3.0',
|
13 |
+
'openai == 0.27.8',
|
14 |
+
'pre-commit == 3.3.3',
|
15 |
+
'pytest == 7.3.1',
|
16 |
+
'ruff == 0.0.272',
|
17 |
+
'termcolor==2.3.0',
|
18 |
+
'typer == 0.9.0',
|
19 |
+
]
|
20 |
+
|
21 |
+
[project.scripts]
|
22 |
+
gpt-engineer = 'gpt_engineer.main:app'
|
23 |
+
|
24 |
+
[tool.setuptools]
|
25 |
+
packages = ["gpt_engineer"]
|
26 |
+
|
27 |
+
# https://beta.ruff.rs/docs/configuration/#using-rufftoml
|
28 |
+
[tool.ruff]
|
29 |
+
select = ["F", "E", "W", "I001"]
|
30 |
+
line-length = 90
|
31 |
+
show-fixes = false
|
32 |
+
target-version = "py311"
|
33 |
+
task-tags = ["TODO", "FIXME"]
|
34 |
+
exclude = [
|
35 |
+
".bzr",
|
36 |
+
".direnv",
|
37 |
+
".eggs",
|
38 |
+
".git",
|
39 |
+
".ruff_cache",
|
40 |
+
".svn",
|
41 |
+
".tox",
|
42 |
+
".venv",
|
43 |
+
"__pypackages__",
|
44 |
+
"_build",
|
45 |
+
"buck-out",
|
46 |
+
"build",
|
47 |
+
"dist",
|
48 |
+
"node_modules",
|
49 |
+
"venv",
|
50 |
+
]
|
51 |
+
|
52 |
+
[project.urls]
|
53 |
+
"Homepage" = "https://github.com/AntonOsika/gpt-engineer"
|
54 |
+
"Bug Tracker" = "https://github.com/AntonOsika/gpt-engineer/issues"
|
55 |
+
|
56 |
+
|
57 |
+
[tool.ruff.isort]
|
58 |
+
known-first-party = []
|
59 |
+
known-third-party = []
|
60 |
+
section-order = [
|
61 |
+
"future",
|
62 |
+
"standard-library",
|
63 |
+
"third-party",
|
64 |
+
"first-party",
|
65 |
+
"local-folder",
|
66 |
+
]
|
67 |
+
combine-as-imports = true
|
68 |
+
split-on-trailing-comma = false
|
69 |
+
lines-between-types = 1
|
70 |
+
|
71 |
+
# https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html
|
72 |
+
[tool.black]
|
73 |
+
line-length = 90
|
74 |
+
target-version = ["py311"]
|
75 |
+
include = '\.pyi?$'
|
76 |
+
exclude = '''
|
77 |
+
(
|
78 |
+
/(
|
79 |
+
\.direnv
|
80 |
+
| \.eggs
|
81 |
+
| \.git
|
82 |
+
| \.tox
|
83 |
+
| \.venv
|
84 |
+
| _build
|
85 |
+
| build
|
86 |
+
| dist
|
87 |
+
| venv
|
88 |
+
)/
|
89 |
+
)
|
90 |
+
'''
|
requirements.txt
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
black==23.3.0
|
2 |
+
mypy==1.3.0
|
3 |
+
openai==0.27.8
|
4 |
+
pre-commit==3.3.3
|
5 |
+
pytest==7.3.1
|
6 |
+
ruff==0.0.272
|
7 |
+
termcolor==2.3.0
|
8 |
+
typer==0.9.0
|
9 |
+
|