Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
pbharrin authored Aug 15, 2023
2 parents 962d2be + 48950c2 commit 3ec3bdf
Show file tree
Hide file tree
Showing 50 changed files with 1,501 additions and 48 deletions.
60 changes: 60 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
dist/
build/
*.egg-info/
*.egg

# Virtual environments
.env
.env.sh
venv/
ENV/

# IDE-specific files
.vscode/
.idea/

# Compiled Python modules
*.pyc
*.pyo
*.pyd

# Python testing
.pytest_cache/
.ruff_cache/
.coverage
.mypy_cache/

# macOS specific files
.DS_Store

# Windows specific files
Thumbs.db

# this application's specific files
archive

# any log file
*log.txt
todo
scratchpad

# Ignore GPT Engineer files
projects
!projects/example

# Pyenv
.python-version

# Benchmark files
benchmark
!benchmark/*/prompt

.gpte_consent
4 changes: 4 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### OpenAI Setup ###

# OPENAI_API_KEY=Your personal OpenAI API key from https://platform.openai.com/account/api-keys
OPENAI_API_KEY=$key
4 changes: 4 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ To enforce this we use [`pre-commit`](https://pre-commit.com/) to run [`black`](
```bash
$ pip install -e .

# For docs building, install doc dependencies too

$ pip install -e .[doc]

# And then install the `pre-commit` hooks with:

$ pre-commit install
Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

github: [antonosika]
patreon: user?u=2497970
patreon: gpt_eng
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,22 @@ benchmark
!benchmark/*/prompt

.gpte_consent

.gpte_consent

# docs

docs/_build
docs/__init__
docs/ai
docs/chat_to_files
docs/collect
docs/learning
docs/main
docs/steps/
docs/db
docs/db/

# poetry

poetry.lock
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ fail_fast: true
default_stages: [commit]

repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
hooks:
- id: mypy
additional_dependencies: [types-tabulate==0.9.0.2]

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
Expand Down
32 changes: 32 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,25 @@ Choose either **stable** or **development**.

For **stable** release:

- `pip install gpt-engineer`
- `python -m pip install gpt-engineer`

For **development**:
- `git clone https://github.com/AntonOsika/gpt-engineer.git`
- `cd gpt-engineer`
- `pip install -e .`
- `python -m pip install -e .`
- (or: `make install && source venv/bin/activate` for a venv)

**Setup**

With an OpenAI API key (preferably with GPT-4 access) run:

**API Key**
Either just:
- `export OPENAI_API_KEY=[your api key]`

To set API key on windows check the [Windows README](./WINDOWS_README.md).
Or:
- Create a copy of `.env.template` named `.env`
- Add your OPENAI_API_KEY in .env

Check the [Windows README](./WINDOWS_README.md) for windows usage.

**Run**:
**Running**

- Create an empty folder. If inside the repo, you can run:
- `cp -r projects/example/ projects/my-new-project`
Expand All @@ -54,14 +56,15 @@ To set API key on windows check the [Windows README](./WINDOWS_README.md).
By running gpt-engineer you agree to our [terms](https://github.com/AntonOsika/gpt-engineer/blob/main/TERMS_OF_USE.md).

**Results**
- Check the generated files in `projects/my-new-project/workspace`

Check the generated files in `projects/my-new-project/workspace`

To **run in the browser** you can simply:

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/AntonOsika/gpt-engineer/codespaces)
**Alternatives**

You can check [Docker instructions](docker/README.md) to use Docker, or simply
do everything in your browser:

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/AntonOsika/gpt-engineer/codespaces)

## Features

Expand All @@ -80,7 +83,7 @@ If you want to see our broader ambitions, check out the [roadmap](https://github
[discord](https://discord.gg/8tcDQ89Ej2)
to get input on how you can [contribute](.github/CONTRIBUTING.md) to it.

We are currently looking for more maintainers and community organisers. Email [email protected] if you are interested in an official role.
We are currently looking for more maintainers and community organizers. Email [email protected] if you are interested in an official role.


## Example
Expand Down
6 changes: 4 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Roadmap

<img width="800" alt="image" src="https://github.com/AntonOsika/gpt-engineer/assets/4467025/1af9a457-1ed8-4ab3-90e6-4fa52bbb8c09">


There are three main milestones we believe will greatly increase gpt-engineer's reliability and capability:
- [x] Continuous evaluation of our progress 🎉
- [ ] Test code and fix errors with LLMs
Expand All @@ -20,8 +23,7 @@ There are three main milestones we believe will greatly increase gpt-engineer's
- [ ] **Improve existing projects**
- [ ] Decide on the "flow" for the CLI commands and where the project files are created
- [ ] Add an "improve code" command
- [ ] Architect how gpt-engineer becomes a platform
- [ ] Integrate Aider
- [ ] Benchmark capabilities against other tools

## Experimental research
This is not our current focus, but if you are interested in experimenting: Please
Expand Down
13 changes: 7 additions & 6 deletions TERMS_OF_USE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Terms of Use

By using gpt-engineer you are aware of and agree to the below Terms of Use, as well as the attached [disclaimer of warranty](https://github.com/AntonOsika/gpt-engineer/blob/main/DISCLAIMER.md).
Welcome to gpt-engineer! By utilizing this powerful tool, you acknowledge and agree to the following comprehensive Terms of Use. We also encourage you to review the linked [disclaimer of warranty](https://github.com/AntonOsika/gpt-engineer/blob/main/DISCLAIMER.md) for additional information.

Both OpenAI, L.L.C. and the creators of gpt-engineer **store data
about how gpt-engineer is used** with the sole intent of improving the capability of the product. Care is taken to not store any information that can be tied to a person.
Both OpenAI, L.L.C. and the dedicated creators behind the remarkable gpt-engineer have implemented a data collection process focused on enhancing the product's capabilities. This endeavor is undertaken with utmost care and dedication to safeguarding user privacy. Rest assured that no information that could be directly attributed to any individual is stored.

Please beware that natural text input, such as the files `prompt` and `feedback`, will be stored and this can, in theory, be used to (although the gpt-engineer creators will never attempt to do so) connect a person's style of writing or content in the files to a real person.
It's important to be aware that the utilization of natural text inputs, including the 'prompt' and 'feedback' files, may be subject to storage. While it's theoretically possible to establish connections between a person's writing style or content within these files and their real-life identity, please note that the creators of gpt-engineer explicitly assure that such attempts will never be made.

More information about OpenAI's terms of use [here](https://openai.com/policies/terms-of-use).
For a deeper understanding of OpenAI's overarching terms of use, we encourage you to explore the details available [here](https://openai.com/policies/terms-of-use).

You can disable storing usage data by gpt-engineer, **but not OpenAI**, by setting the environment variable COLLECT_LEARNINGS_OPT_OUT=true.
Should you desire to curtail the collection of usage data by gpt-engineer itself (but not by OpenAI), you have the option to exercise control by setting the environment variable COLLECT_LEARNINGS_OPT_OUT=true.

Your engagement with gpt-engineer is an acknowledgment and acceptance of these terms, demonstrating your commitment to using this tool responsibly and within the bounds of ethical conduct. We appreciate your trust and look forward to the exciting possibilities that gpt-engineer can offer in your endeavors.
4 changes: 2 additions & 2 deletions WINDOWS_README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Windows Setup
## Short version

On Windows, follow the standard [README.md](https://github.com/AntonOsika/gpt-engineer/blob/main/README.md), but to set API key do one of:
On Windows, follow the standard [README.md](./README.md), but to set API key do one of:
- `set OPENAI_API_KEY=[your api key]` on cmd
- `$env:OPENAI_API_KEY="[your api key]"` on powershell

Expand All @@ -11,7 +11,7 @@ Choose either **stable** or **development**.

For **stable** release:

Run `pip install gpt-engineer` in the command line
Run `pip install gpt-engineer` in the command line as an administrator

Or:

Expand Down
4 changes: 2 additions & 2 deletions benchmark/RESULTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ python scripts/benchmark.py
| password_generator ||||
| todo_list ||||

## Notes on the errors
### Notes on the errors

Most errors come from that the "generate entrypoint" are incorrect. Ignoring
those, we get 8/11 fully correct.
Expand All @@ -47,7 +47,7 @@ One error is that a dependency was used incorrectly and easy to fix
| password_generator ||||
| todo_list ||||

## Notes on the errors
### Notes on the errors

**timer_app** almost works with unit tests config

Expand Down
13 changes: 13 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.9-slim

RUN apt-get update \
&& apt-get install -y sudo

WORKDIR /app

COPY . .
COPY docker/entrypoint.sh ./entrypoint.sh

RUN sudo pip install -e .

ENTRYPOINT ["bash", "/app/entrypoint.sh"]
24 changes: 24 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Getting Started using Docker

**Running using docker cli**:

Building the image:
- `git clone https://github.com/AntonOsika/gpt-engineer.git`
- `cd gpt-engineer`
- `docker build --rm -t gpt-engineer -f docker/Dockerfile .`

Running the container:
- `docker run -it --rm -e OPENAI_API_KEY="YOUR OPENAI KEY" -v ./your-project:/project gpt-engineer`

The `-v` flag mounts the `your-project` folder into the container. Make sure to have a `prompt` file in there.

**Running using docker-compose cli**:

Building the image:
- `git clone https://github.com/AntonOsika/gpt-engineer.git`
- `cd gpt-engineer`
- `docker-compose build -f docker/docker-compose.yml`
- `docker-compose run --rm gpt-engineer`


Set the OPENAI_API_KEY in docker/docker-compose.yml using .env file or environment variable, and mount your project folder into the container using volumes. for example "./projects/example:/project" ./projects/example is the path to your project folder.
18 changes: 18 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "3"

services:
gpt-engineer:
build:
context: .
dockerfile: Dockerfile
stdin_open: true
tty: true
# Set the API key from the .env file
env_file:
- .env
## OR set the API key directly
# environment:
# - OPENAI_API_KEY="YOUR_API_KEY_HERE"
image: gpt-engineer
volumes:
- ./projects/example:/project
13 changes: 13 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
project_dir="/project"

# Run the gpt engineer script
gpt-engineer $project_dir "$@"

# Patch the permissions of the generated files to be owned by nobody except prompt file
for item in "$project_dir"/*; do
if [[ "$item" != "$project_dir/prompt" ]]; then
chown -R nobody:nogroup "$item"
chmod -R 777 "$item"
fi
done
Loading

0 comments on commit 3ec3bdf

Please sign in to comment.