newjersey / uibot

An experiment using GPT-3.5-turbo to make a UI chatbot

Home Page:https://newjersey.github.io/uibot/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AI Q&A Bot

This is an experiment, for reference only. Try here: https://newjersey.github.io/uibot/

example of 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).

Initial Setup

Install required packages by running:

pip install llama-index

Ongoing Operations

Loading Data and Creating 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

Ask questions

To start a Q&A dialogue run the following:

python ask.py

Serverless API

  • 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

Build index

  • make sure requirements are installed pip3 install -r requirements.txt
  • build index locally by setting env var OPENAI_API_KEY and running python3 createindex.py

Chatbot example

Downloading website content to index

wget -r -np -nd -E -A html,pdf https://nj.gov/labor/myleavebenefits/

About

An experiment using GPT-3.5-turbo to make a UI chatbot

https://newjersey.github.io/uibot/


Languages

Language:HTML 99.8%Language:Python 0.2%Language:Dockerfile 0.0%