Saumya / README.md
mrpoddaa's picture
Upload 4 files
dd2fe9c verified
---
title: Saumya Movie AI Assistant
emoji: 🎬
colorFrom: purple
colorTo: pink
sdk: docker
app_port: 7860
pinned: false
---
# 🎬 Saumya — AI Movie & TV Show Assistant
**Created by Samith Dilshan** · Supports English & Sinhala 🇱🇰
Saumya is an intelligent movie and TV show assistant powered by **Mistral-7B** via HuggingFace.
Ask about any film or series and get AI-generated summaries, genre info, and download links — in **English or Sinhala**.
---
## ✨ Features
| Feature | Details |
|---|---|
| 🎬 Movie search | Natural language — *"I want to watch Inception"* |
| 📺 TV show support | Series, episodes, seasons |
| 🇱🇰 Sinhala support | Full bilingual (EN / SI) |
| 🤖 AI summaries | Emotional, engaging — not boring translations |
| 📥 Download links | Quality + size from movie database |
| 💬 General QA | Ask anything movie/show related |
| 🎯 Recommendations | *"Suggest a good thriller"* |
---
## 🔌 REST API Endpoints
### GET `/api/chat`
```
GET /api/chat?q=Tell me about Breaking Bad
GET /api/chat?q=මට Inception ෆිල්ම් ගැන කියන්න
```
### POST `/api/chat`
```json
POST /api/chat
{ "query": "Recommend a horror movie" }
```
### GET `/api/movie`
```
GET /api/movie?user_query=Avatar
GET /api/movie?imdb_id=tt0499549
```
### POST `/api/movie`
```json
POST /api/movie
{ "user_query": "මට avatar ෆිල්ම් එක බලන්න ඕනේ" }
```
### GET `/api/status`
Returns assistant info, version, and Gradio toggle state.
### POST `/api/admin/gradio-toggle`
```json
POST /api/admin/gradio-toggle
{ "admin_key": "your_secret", "enabled": false }
```
### Swagger UI
`GET /api/docs`
---
## 🔑 Required Secrets (HF Space Settings → Secrets)
| Secret | Description |
|---|---|
| `TMDB_API_KEY` | [TMDb API Key](https://www.themoviedb.org/settings/api) |
| `HF_TOKEN` | [HuggingFace Token](https://huggingface.co/settings/tokens) (read) |
| `ADMIN_KEY` | Your chosen secret for the Gradio toggle endpoint |
---
## 📐 Response Shape
```json
{
"intent": "movie",
"poster": "https://...",
"movie_name": "Inception",
"categories": ["Action", "Sci-Fi", "Thriller"],
"download_links": [
{ "quality": "1080p", "url": "...", "size": "2.1 GB" }
],
"response_language": "en",
"message": "Saumya's AI-generated summary..."
}
```
---
*Built with FastAPI · Gradio · TMDb API · HuggingFace Inference*