This project is a FastAPI application.
To manage your project dependencies and environments, you'll need to install Poetry CLI. Follow the instructions based on your operating system:
Use the following command to install Poetry CLI:
curl -sSL https://install.python-poetry.org | python3 -Note: On some systems, python may still refer to Python 2 instead of Python 3. We always suggest using the python3 binary to avoid ambiguity.
In the Windows Subsystem for Linux (WSL), you can install Poetry using the same command as in Linux:
curl -sSL https://install.python-poetry.org | python3 -Use the following command to install Poetry CLI using Powershell:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -After installing Poetry, navigate to the project directory and install the dependencies using the following command:
poetry installThis will install all dependencies specified in the pyproject.toml file.
This project uses environment variables for configuration. You need to create a .env file inside the server/ directory and specify the necessary environment variables as shown in the provided .env.example file.
- OpenAI API Key: Set the
OPENAI_API_KEYenvironment variable in your.envfile to access GPT and Ada embedding models. - Pinecone API Key and Index: Set the
PINECONE_API_KEYandPINECONE_INDEXenvironment variables in your.envfile to connect to Pinecone as the vector database.
To run the project, first make sure you are inside the project directory. Then, use the following command to run the application:
poetry run devThis will execute the FastAPI application using Uvicorn as the server.
You can access the FastAPI Swagger documentation at http://localhost:8000/docs once the server is running. This documentation provides an overview of the available endpoints, request and response formats, and other details about your FastAPI application.