REST API created with FastAPI, OpenAI API and LangChain (for RAG). Ask questions concerning David Hume's A Treatise of Human Nature.
App performs semantic search on the book and using retrieved context pieces generates answers to your questions.
Clone/download this repository and create .env file in project directory. It should look like this
ENVIRONMENT = "production" (or "development")
OPENAI_API_KEY="your_key"
MODEL_TEMPERATURE = 0.3
AUTH_SECRET_KEY = "auth_secret_key" (use 'openssl rand -hex 32' to generate)
LANGCHAIN_API_KEY="your_key"
LANGCHAIN_TRACING_V2="true"
Install uv
Open terminal in your project directory and run the following command
uv run -- fastapi run src/main.py
In your project directory:
docker build -t firstchain .
docker run --env-file .env -p 8000:8000 firstchain
