Example of FastAPI for web-based RAG using Haystack.
The component that searches on the web uses the googlesearch
library, which will return 429 errors if used too much in a short period of time (related issue: here)
- Clone this repository.
- Install the required Python packages by running
pip install -r requirements.txt
, oruv sync
. - Set your
OPENAI_API_KEY
environment variable to your OpenAI API key.
Run the app with
python -m uvicorn app.main:app
or with just run dev
.