quivr/examples/chatbot
Stan Girard e71e46bcdf
feat(ask): non-streaming now calls streaming (#3409)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-10-21 08:30:34 -07:00
..
.chainlit feat(quivr-core): beginning (#3388) 2024-10-21 00:50:31 -07:00
.gitignore feat(quivr-core): beginning (#3388) 2024-10-21 00:50:31 -07:00
.python-version feat(quivr-core): beginning (#3388) 2024-10-21 00:50:31 -07:00
chainlit.md feat(quivr-core): beginning (#3388) 2024-10-21 00:50:31 -07:00
main.py feat(quivr-core): beginning (#3388) 2024-10-21 00:50:31 -07:00
pyproject.toml fix : removed megaparse and fix dependencies (#3406) 2024-10-21 08:03:14 -07:00
README.md feat(quivr-core): beginning (#3388) 2024-10-21 00:50:31 -07:00
requirements-dev.lock feat(ask): non-streaming now calls streaming (#3409) 2024-10-21 08:30:34 -07:00
requirements.lock feat(ask): non-streaming now calls streaming (#3409) 2024-10-21 08:30:34 -07:00

Quivr Chatbot Example

This example demonstrates how to create a simple chatbot using Quivr and Chainlit. The chatbot allows users to upload a text file and then ask questions about its content.

Prerequisites

  • Python 3.8 or higher

Installation

  1. Clone the repository or navigate to the core/examples/chatbot directory.

  2. Install the required dependencies:

    pip install -r requirements.lock
    

Running the Chatbot

  1. Start the Chainlit server:

    chainlit run main.py
    
  2. Open your web browser and go to the URL displayed in the terminal (usually http://localhost:8000).

Using the Chatbot

  1. When the chatbot interface loads, you will be prompted to upload a text file.

  2. Click on the upload area and select a .txt file from your computer. The file size should not exceed 20MB.

  3. After uploading, the chatbot will process the file and inform you when it's ready.

  4. You can now start asking questions about the content of the uploaded file.

  5. Type your questions in the chat input and press Enter. The chatbot will respond based on the information in the uploaded file.

How It Works

The chatbot uses the Quivr library to create a "brain" from the uploaded text file. This brain is then used to answer questions about the file's content. The Chainlit library provides the user interface and handles the chat interactions.

Enjoy chatting with your documents!