Skip to main content
In this example, we’re going to build an chatbot QA app. We’ll learn how to:
  • Upload a document
  • Create vector embeddings from a file
  • Create a chatbot app with the ability to display sources used to generate an answer
This example is inspired from the LangChain doc

Prerequisites

This example has extra dependencies. You can install them with:
Then, you need to go to create an OpenAI key here.
The state of the union file is available here

Conversational Document QA with LangChain

qa.py

Try it out

You can then upload any .txt file to the UI and ask questions about it. If you are using state_of_the_union.txt you can ask questions like What did the president say about Ketanji Brown Jackson?. QA