chasemc67 / TinyGen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TinyGen

A simple API to generate code diffs using ChatGPT

Running the Application Locally

  1. First, clone the repository to your local machine and navigate to the project directory:
git clone <repository-url>
cd <project-directory>
source venv/bin/activate
pip install -r requirements.txt

Teardown:

deactivate
  1. create a new .env file for secrets, you can get this information from supabase your .env file should look like this:
SUPABASE_URL=your_supabase_url
SUPABASE_API_KEY=your_supabase_api_key
OPENAI_API_KEY=your_openapi_key
  1. Run the app
uvicorn main:app --reload

Now, the server should be up and running at http://localhost:8000. You can view the interactive API documentation at http://localhost:8000/docs.

To test the server and run sample requests, open the openAPI page at

http://localhost:8000/docs

Deploy changes to prod

Use Heroku for production:

heroku login
git push heroku main
heroku open
heroku logs --tail

Run tests:

pytest tests/test_github.py

Run tests through docker:

docker build -t tinygen .
docker run tinygen pytest tests/test_github.py

Run tests with docker-compose:

docker-compose run app pytest tests/test_github.py

Python things:

source venv/bin/activate # activate virtual env
deactive # deactivate virtual env
pip freeze > requirements.txt # update deps

About


Languages

Language:Jupyter Notebook 96.6%Language:Python 3.1%Language:Dockerfile 0.2%Language:Shell 0.1%Language:Procfile 0.0%