Spaces:
Sleeping
Sleeping
File size: 1,423 Bytes
72c55b8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
---
title: UnivAI Chatbot
emoji: π€
colorFrom: purple
colorTo: blue
sdk: docker
sdk_version: "1.0.0"
app_file: app.py
pinned: false
---
# UnivAI Chatbot Interface & AI Backend
This project merges a React UI (Vite) and a Flask AI backend into a single Hugging Face Space using Docker.
## Features
- Conversational UI for university handbook queries
- AI backend (Sentence Transformers + LLM) for semantic search and natural responses
- Feedback API for upvote/downvote tuning
## Running Locally
```bash
docker build -t univai-chatbot .
docker run -p 7860:7860 univai-chatbot
```
- UI available at `http://localhost:7860`
- API available at `http://localhost:7860/api/chat` and `/api/feedback`
## Endpoints
- **POST /api/chat**
`{ "query": "your question", "dev_mode": false }` β `{ "response": "answer" }`
- **POST /api/feedback**
`{ "query": "...", "response": "...", "feedback": "positive"|"negative" }` β `{ "status": "success" }`
## Hugging Face Spaces
- Push this repo and select Docker SDK.
- The UI and AI will run together, with Nginx proxying `/api/` to the backend.
## File Structure
- `src/` β React UI
- `app.py` β Flask AI backend
- `Dockerfile` β unified build
- `nginx.conf` β reverse proxy config
- `requirements.txt` β Python dependencies
- `dataset.json` β university Q&A set
## Connecting UI to AI
- The UI should send requests to `/api/chat` and `/api/feedback`.
|