This is the backend API for EVA, using FastAPI and Python.
The most significant file is the GPT handler, which is responsible for handling all prompts, decoding all responses, and building the report. It can be found here. Additionally, the entire prompting behavior is configurable and can be modified by changing the values in the config directory found here.
FastAPI Docs Local DynamoDB (Part 1) Local DynamoDB (Part 2)
Before starting, make sure you have Python 3.9.
-
Create a new virtual environment:
python3 -m venv .venv source .venv/Scripts/activate
-
Install the required Python libraries using pip:
pip install -r requirements.txt
-
Add your environment variables. For example:
PORT=5000 DB_REGION_NAME="us-east-1" DB_ACCESS_KEY_ID="..." DB_SECRET_ACCESS_KEY="..." OPENAI_API_KEY="..." CLIENT_ORIGIN_URL="http://localhost:3000" AUTH0_DOMAIN="...us.auth0.com" AUTH0_AUDIENCE="https://example.com"
-
Run the server:
python main.py
-
Navigate to http://localhost:5000/docs to test that the server is working.
This project is deployed to AWS Lambda using the serverless library. More information about how to do this will be added soon.