Spaces:
Sleeping
Sleeping
| title: PensionBot | |
| emoji: π€ | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: docker | |
| sdk_version: "latest" | |
| app_file: app.py | |
| pinned: false | |
| # PensionBot - Voice Assistant π€ | |
| A sophisticated AI-powered voice assistant designed for government pension queries and document searches. Built with FastAPI, this backend provides comprehensive API endpoints for voice interaction, document processing, and intelligent responses. | |
| ## π Features | |
| - **Voice Processing**: Advanced ASR and TTS capabilities | |
| - **Document Search**: RAG-based government document knowledge base | |
| - **Hybrid AI**: Multiple LLM providers for optimal responses | |
| - **WebSocket Support**: Real-time communication | |
| - **Authentication**: JWT-based secure access | |
| ## π‘ API Endpoints | |
| - `GET /` - Service information and available endpoints | |
| - `GET /health` - Health check with service status | |
| - `POST /chat` - Text-based conversation interface | |
| - `WebSocket /ws` - Real-time voice and text communication | |
| - `GET /docs` - Interactive API documentation | |
| ## π Technology Stack | |
| - **FastAPI**: High-performance web framework | |
| - **LangChain**: AI orchestration and document processing | |
| - **LanceDB**: Vector database for document search | |
| - **Whisper**: Speech-to-text processing | |
| - **Edge-TTS**: Text-to-speech synthesis | |
| ## π Usage | |
| The API is accessible at the base URL of this space. Use the `/docs` endpoint to explore the interactive API documentation. | |
| ### Example Usage: | |
| ```bash | |
| # Health check | |
| curl https://chabhishek28-pensionbot.hf.space/health | |
| # Chat endpoint | |
| curl -X POST https://chabhishek28-pensionbot.hf.space/chat \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"message": "Tell me about pension policies"}' | |
| ``` | |
| ## π Environment Variables | |
| The following environment variables are required: | |
| - `GOOGLE_API_KEY`: Google Gemini API key | |
| - `GROQ_API_KEY`: Groq API key for Whisper | |
| - `TAVILY_API_KEY`: Tavily search API key | |
| - `JWT_SECRET_KEY`: JWT authentication secret | |
| ## π Security | |
| This API includes JWT-based authentication for secure access to protected endpoints. | |
| Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |