Spaces:
Sleeping
Sleeping
JerameeUC commited on
Commit ·
c15fa88
1
Parent(s): 1796b9b
README.md
Browse files
README.md
CHANGED
|
@@ -1,134 +1,10 @@
|
|
| 1 |
-
<<<<<<< HEAD
|
| 2 |
-
<!-- README.md -->
|
| 3 |
-
# Agentic Chatbot
|
| 4 |
-
|
| 5 |
-
Agentic Chatbot with Retrieval-Augmented Generation (RAG), session memory, and privacy guardrails.
|
| 6 |
-
The project follows a **modular architecture** with:
|
| 7 |
-
- Gradio UI for interactive demos
|
| 8 |
-
- AIOHTTP backend with lightweight routes
|
| 9 |
-
- Anonymous and logged-in flows
|
| 10 |
-
- Guardrails for safety and PII redaction
|
| 11 |
-
- Optional cloud providers (Azure, Hugging Face, OpenAI, Cohere, DeepAI)
|
| 12 |
-
|
| 13 |
---
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
```bash
|
| 20 |
-
python -m venv .venv && source .venv/bin/activate
|
| 21 |
-
pip install -r requirements.txt
|
| 22 |
-
```
|
| 23 |
-
|
| 24 |
-
Run in dev mode:
|
| 25 |
-
|
| 26 |
-
```bash
|
| 27 |
-
make dev
|
| 28 |
-
make run
|
| 29 |
-
# open http://localhost:7860 (Gradio UI)
|
| 30 |
-
```
|
| 31 |
-
|
| 32 |
-
Or run the backend directly:
|
| 33 |
-
|
| 34 |
-
```bash
|
| 35 |
-
python app/app.py
|
| 36 |
-
```
|
| 37 |
-
|
| 38 |
-
---
|
| 39 |
-
|
| 40 |
-
## Health Checks
|
| 41 |
-
|
| 42 |
-
The AIOHTTP backend exposes simple endpoints:
|
| 43 |
-
|
| 44 |
-
```bash
|
| 45 |
-
curl http://127.0.0.1:3978/healthz
|
| 46 |
-
# -> {"status":"ok"}
|
| 47 |
-
|
| 48 |
-
curl -X POST http://127.0.0.1:3978/plain-chat -H "Content-Type: application/json" -d '{"text":"reverse hello"}'
|
| 49 |
-
# -> {"reply":"olleh"}
|
| 50 |
-
```
|
| 51 |
-
|
| 52 |
-
---
|
| 53 |
-
|
| 54 |
-
## Agentic Integration
|
| 55 |
-
|
| 56 |
-
- **Core bot:** `agenticcore/chatbot/services.py`
|
| 57 |
-
- **Providers:** `agenticcore/providers_unified.py`
|
| 58 |
-
- **CLI:** `python -m agenticcore.cli agentic "hello"` (loads `.env`)
|
| 59 |
-
- **FastAPI demo:**
|
| 60 |
-
```bash
|
| 61 |
-
uvicorn integrations.web.fastapi.web_agentic:app --reload --port 8000
|
| 62 |
-
```
|
| 63 |
-
|
| 64 |
-
---
|
| 65 |
-
|
| 66 |
-
## Environment Variables
|
| 67 |
-
|
| 68 |
-
Provider integrations are selected automatically, or you can pin one with `AI_PROVIDER`. Supported keys:
|
| 69 |
-
|
| 70 |
-
- Hugging Face: `HF_API_KEY`, `HF_MODEL_SENTIMENT`
|
| 71 |
-
- Azure: `MICROSOFT_AI_SERVICE_ENDPOINT`, `MICROSOFT_AI_API_KEY`
|
| 72 |
-
- OpenAI: `OPENAI_API_KEY`
|
| 73 |
-
- Cohere: `COHERE_API_KEY`
|
| 74 |
-
- DeepAI: `DEEPAI_API_KEY`
|
| 75 |
-
|
| 76 |
-
If no keys are set, the system falls back to **offline sentiment mode**.
|
| 77 |
-
|
| 78 |
-
---
|
| 79 |
-
|
| 80 |
-
## Samples & Tests
|
| 81 |
-
|
| 82 |
-
- **UI samples:**
|
| 83 |
-
- `app/assets/html/chat.html` – open in browser for local test
|
| 84 |
-
- **Bots:**
|
| 85 |
-
- `integrations/botframework/bots/echo_bot.py`
|
| 86 |
-
- **Notebooks:**
|
| 87 |
-
- `notebooks/ChatbotIntegration.ipynb`
|
| 88 |
-
- `notebooks/SimpleTraditionalChatbot.ipynb`
|
| 89 |
-
- **Tests:**
|
| 90 |
-
- `tests/smoke_test.py`
|
| 91 |
-
- `tests/test_routes.py`
|
| 92 |
-
- `tests/test_anon_bot.py`
|
| 93 |
-
- **Misc:**
|
| 94 |
-
- `tools/quick_sanity.py`
|
| 95 |
-
- `examples/example.py`
|
| 96 |
-
- `samples/service.py`
|
| 97 |
-
|
| 98 |
-
Run all tests:
|
| 99 |
-
|
| 100 |
-
```bash
|
| 101 |
-
pytest -q
|
| 102 |
-
```
|
| 103 |
-
|
| 104 |
-
---
|
| 105 |
-
|
| 106 |
-
## Documentation
|
| 107 |
-
|
| 108 |
-
- [Brief Academic Write Up](docs/Brief_Academic_Write_Up.md)
|
| 109 |
-
- [README](../README.md)
|
| 110 |
-
- [Architecture Overview](docs/architecture.md)
|
| 111 |
-
- [Design Notes](docs/design.md)
|
| 112 |
-
- [Implementation Notes](docs/storefront/IMPLEMENTATION.md)
|
| 113 |
-
- [Dev Doc](docs/DEV_DOC.md)
|
| 114 |
-
- [Developer Guide Build Test](docs/Developer_Guide_Build_Test.md)
|
| 115 |
-
|
| 116 |
-
---
|
| 117 |
-
|
| 118 |
-
_Developed for MSAI 631 – Human-Computer Interaction Group Project._
|
| 119 |
-
=======
|
| 120 |
-
---
|
| 121 |
-
title: Agentic Chat Bot
|
| 122 |
-
emoji: ðŸ‘
|
| 123 |
-
colorFrom: gray
|
| 124 |
-
colorTo: blue
|
| 125 |
sdk: gradio
|
| 126 |
-
sdk_version:
|
| 127 |
-
app_file:
|
| 128 |
pinned: false
|
| 129 |
-
|
| 130 |
-
short_description: Agentic Chat-bot with RAG, Memory, and Privacy
|
| 131 |
-
---
|
| 132 |
-
|
| 133 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 134 |
-
>>>>>>> hf/main
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Agentic-Chat-bot
|
| 3 |
+
emoji: 💬
|
| 4 |
+
colorFrom: teal
|
| 5 |
+
colorTo: green
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: "4.0"
|
| 8 |
+
app_file: space_app.py
|
| 9 |
pinned: false
|
| 10 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|