Skip to content

hwchase17/conversation-qa-gradio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LangChain <> Gradio Custom QA Over Docs Bot

This repo shows how to create a Chatbot over your documents using LangChain and Gradio. Importantly, this has an emphasis on using some of the lower level components of LangChain rather than a predefined chain.

This also uses:

  • Cohere for embeddings
  • ChromaDB for a vectorstore
  • OpenAI for a text generation model

Setup

To setup, please install requirements with pip install -r requirements.txt

Then, set various environment variables:

export OPENAI_API_KEY=...
export COHERE_API_KEY=

Ingest

First, we need to ingest data. For this example, we will work with a state of the union address (state_of_the_union.txt). You can modify the code in ingest.py to ingest anything you want. To ingest, run python ingest.py

Chat

Now we can chat with this data! In order to do that, run python app.py. This will spin up a Gradio application that you can chat with in the frontend. For details on how to customize the chatbot, see the code in app.py. The code in app.py should be well commented so you can understand what is going on.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages