From 9a7555871de1c2d7d551cdab64fb7d67979375d4 Mon Sep 17 00:00:00 2001 From: bigvo Date: Tue, 24 Oct 2023 00:05:20 +0000 Subject: [PATCH 1/2] IGNORE_FOLDERS env variable added --- pilot/const/common.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pilot/const/common.py b/pilot/const/common.py index 4d57d74d..bdf06c31 100644 --- a/pilot/const/common.py +++ b/pilot/const/common.py @@ -1,3 +1,6 @@ +import os + + APP_TYPES = ['Web App', 'Script', 'Mobile App', 'Chrome Extension'] ROLES = { 'product_owner': ['project_description', 'user_stories', 'user_tasks'], @@ -18,6 +21,8 @@ STEPS = [ 'finished' ] +additional_ignore_folders = os.environ.get('IGNORE_FOLDERS', '').split(',') + IGNORE_FOLDERS = [ '.git', '.gpt-pilot', @@ -29,6 +34,8 @@ IGNORE_FOLDERS = [ 'venv', 'dist', 'build', -] + # Used by Rust compiler + 'target' +] + [folder for folder in additional_ignore_folders if folder] PROMPT_DATA_TO_IGNORE = {'directory_tree', 'name'} From 3ecf30a3579cd873e675bce577684d36b70dfb21 Mon Sep 17 00:00:00 2001 From: bigvo Date: Tue, 24 Oct 2023 10:33:18 +0000 Subject: [PATCH 2/2] README and env example update --- README.md | 7 +++++-- docker-compose.yml | 7 +++++-- pilot/.env.example | 4 +++- pilot/const/common.py | 1 - 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2ddb9695..21db8662 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,11 @@ After you have Python and (optionally) PostgreSQL installed, follow these steps: 5. `pip install -r requirements.txt` (install the dependencies) 6. `cd pilot` 7. `mv .env.example .env` (create the .env file) -8. Add your environment (OpenAI/Azure), your API key, and the SQLite/PostgreSQL database info to the `.env` file - - to change from SQLite to PostgreSQL in your .env, just set `DATABASE_TYPE=postgres` +8. Add your environment to the `.env` file: + - LLM Provider (OpenAI/Azure/Openrouter) + - your API key + - database settings: SQLite/PostgreSQL (to change from SQLite to PostgreSQL, just set `DATABASE_TYPE=postgres`) + - optionally set IGNORE_FOLDERS for the folders which shouldn't be tracked by GPT Pilot in workspace, useful to ignore folders created by compilers (i.e. `IGNORE_FOLDERS=folder1,folder2,folder3`) 9. `python db_init.py` (initialize the database) 10. `python main.py` (start GPT Pilot) diff --git a/docker-compose.yml b/docker-compose.yml index 44c0ac40..d8277769 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,12 +2,13 @@ version: '3' services: gpt-pilot: environment: - #OPENAI or AZURE + # OPENAI/AZURE/OPENROUTER - ENDPOINT=OPENAI - OPENAI_API_KEY= # - AZURE_API_KEY= # - AZURE_ENDPOINT= - #In case of Azure endpoint, change this to your deployed model name + # - OPENROUTER_API_KEY= + # In case of Azure endpoint, change this to your deployed model name - MODEL_NAME=gpt-4 - MAX_TOKENS=8192 - DATABASE_TYPE=postgres @@ -16,6 +17,8 @@ services: - DB_PORT=5432 - DB_USER=pilot - DB_PASSWORD=pilot + # Folders which shouldn't be tracked in workspace (useful to ignore folders created by compiler) + # IGNORE_FOLDERS=folder1,folder2 volumes: - ~/gpt-pilot-workspace:/usr/src/app/workspace build: diff --git a/pilot/.env.example b/pilot/.env.example index db2ecd2c..9552d92a 100644 --- a/pilot/.env.example +++ b/pilot/.env.example @@ -8,13 +8,15 @@ AZURE_API_KEY= AZURE_ENDPOINT= OPENROUTER_API_KEY= -OPENROUTER_ENDPOINT=https://openrouter.ai/api/v1/chat/completions # In case of Azure/OpenRouter endpoint, change this to your deployed model name MODEL_NAME=gpt-4 # MODEL_NAME=openai/gpt-3.5-turbo-16k MAX_TOKENS=8192 +# Folders which shouldn't be tracked in workspace (useful to ignore folders created by compiler) +# IGNORE_FOLDERS=folder1,folder2 + # Database # DATABASE_TYPE=postgres diff --git a/pilot/const/common.py b/pilot/const/common.py index bdf06c31..7443c0e9 100644 --- a/pilot/const/common.py +++ b/pilot/const/common.py @@ -34,7 +34,6 @@ IGNORE_FOLDERS = [ 'venv', 'dist', 'build', - # Used by Rust compiler 'target' ] + [folder for folder in additional_ignore_folders if folder]