feat: add Gradio web UI
- app.py: Gradio Interface wrapping BoschProductRAG.query() - Index built once at startup (not per-request) - Markdown output: answer + linked sources + latency - Example prompts included for quick demo - Verified: launches on :7860, returns correct answers Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
19
README.md
19
README.md
@@ -1,6 +1,6 @@
|
||||
# Bosch HVAC Product Knowledge Bot
|
||||
|
||||
A CLI-based **Retrieval-Augmented Generation (RAG)** system that answers sales and specification questions about Bosch HVAC products.
|
||||
A **Retrieval-Augmented Generation (RAG)** system that answers sales and specification questions about Bosch HVAC products. Available as both a **web UI (Gradio)** and a **CLI**.
|
||||
|
||||
## What It Does
|
||||
|
||||
@@ -26,7 +26,16 @@ cp .env.example .env
|
||||
uv sync
|
||||
```
|
||||
|
||||
### 2. Query the Knowledge Bot
|
||||
### 2. Launch the Web UI
|
||||
|
||||
```bash
|
||||
source .venv/bin/activate
|
||||
python app.py
|
||||
```
|
||||
|
||||
Opens at `http://127.0.0.1:7860` — type a question, get an answer with sources and latency. Includes example prompts.
|
||||
|
||||
### 3. Or Use the CLI
|
||||
|
||||
```bash
|
||||
# Activate the uv environment
|
||||
@@ -66,7 +75,7 @@ LATENCY: 1234.5ms
|
||||
============================================================
|
||||
```
|
||||
|
||||
### 3. Evaluate Metrics
|
||||
### 4. Evaluate Metrics
|
||||
|
||||
```bash
|
||||
# Run full evaluation (latency + accuracy)
|
||||
@@ -85,7 +94,9 @@ src/products_catalog.json ← Product specs (6 Bosch HVAC systems)
|
||||
↓
|
||||
src/rag.py ← RAG pipeline (embeddings + retrieval)
|
||||
↓
|
||||
src/cli.py ← CLI interface (Click)
|
||||
┌────┴────┐
|
||||
app.py src/cli.py ← Gradio web UI / CLI interface
|
||||
(Web) (CLI)
|
||||
↓
|
||||
User questions
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user