From b0a06c09d2f831e77a2889dab39d2cad47a6d7a1 Mon Sep 17 00:00:00 2001 From: Yunfei <687418+OtaconBYF@users.noreply.github.com> Date: Thu, 28 Nov 2024 18:15:57 +0800 Subject: [PATCH 1/2] Update README to fill in correct steps to run example chatbot project. --- examples/chatbot/README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/examples/chatbot/README.md b/examples/chatbot/README.md index 3cfa916ae568..2602d54bbf50 100644 --- a/examples/chatbot/README.md +++ b/examples/chatbot/README.md @@ -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 From e3dbcb7ceec8efdb2cb17a05799f5c3090b53dc9 Mon Sep 17 00:00:00 2001 From: Yunfei <687418+OtaconBYF@users.noreply.github.com> Date: Thu, 28 Nov 2024 18:38:21 +0800 Subject: [PATCH 2/2] More informative warning message when API key is not set --- core/quivr_core/rag/entities/config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/core/quivr_core/rag/entities/config.py b/core/quivr_core/rag/entities/config.py index cb455ab42d39..1e848bdcde61 100644 --- a/core/quivr_core/rag/entities/config.py +++ b/core/quivr_core/rag/entities/config.py @@ -230,6 +230,7 @@ def set_api_key(self, force_reset: bool = False): 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