docs: Enhance example/chatbot with added instructions (#3506)

# Description

Instructions in README of example/chatbot is a little out-dated. Updated
it to match the latest codebase.

## Checklist before requesting a review

Please delete options that are not relevant.

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented hard-to-understand areas
- [x] I have ideally added tests that prove my fix is effective or that
my feature works


## Screenshots (if appropriate):

NA
This commit is contained in:
Yunfei 2024-11-28 18:56:49 +08:00 committed by GitHub
parent d20f58c147
commit d1d608d19f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 5 deletions

View File

@ -230,6 +230,7 @@ class LLMEndpointConfig(QuivrBaseConfig):
if not self.llm_api_key:
logger.warning(f"The API key for supplier '{self.supplier}' is not set. ")
logger.warning(f"Please set the environment variable: '{self.env_variable_name}'. ")
def set_llm_model_config(self):
# Automatically set context_length and tokenizer_hub based on the supplier and model

View File

@ -8,23 +8,32 @@ This example demonstrates how to create a simple chatbot using Quivr and Chainli
## Installation
1. Clone the repository or navigate to the `core/examples/chatbot` directory.
1. Clone the repository and navigate to the `examples/chatbot` directory.
2. Install the required dependencies:
2. Make sure you have [rye](https://rye.astral.sh/) installed.
3. Install the requirements using `rye`:
```sh
rye sync
```
pip install -r requirements.lock
4. Activate the venv
```sh
source ./venv/bin/activate
```
## Running the Chatbot
1. Start the Chainlit server:
1. Define your API key as environment variable. e.g. `export OPENAI_API_KEY=your-key-here`
2. 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`).
3. Open your web browser and go to the URL displayed in the terminal (usually `http://localhost:8000`).
## Using the Chatbot