This is an experiment, for reference only. Try here: https://newjersey.github.io/uibot/
Q&A bot using LlamaIndex. This is a simple implementation using OpenAI's models, but the documentation contains extensive customization options (including changing the LLM).
Install required packages by running:
pip install llama-index
Load the knowledge base files (such as pdf, jpg, png, docx, txt, csv) into the 'data' folder. Llama-index has support for third-party connectors as well.
Run the following whenever changes are made to the data folder to re-generate the knowledge base:
python createindex.py
To start a Q&A dialogue run the following:
python ask.py
- set an env var using AWS SSM call
openaiApiKey
with an API key for OpenAI - deploy with
serverless deploy
, which will build required dependencies as a container and publish
- make sure requirements are installed
pip3 install -r requirements.txt
- build index locally by setting env var
OPENAI_API_KEY
and runningpython3 createindex.py
- simple chatbot hosted on github pages: https://newjersey.github.io/uibot/
wget -r -np -nd -E -A html,pdf https://nj.gov/labor/myleavebenefits/