SS-2005's picture
Upload 17 files
8490649 verified
|
Raw
History Blame Contribute Delete
1.33 kB
---
title: SCN Consultation API
emoji: 🤖
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
---
# SCN Consultation API
FastAPI backend for generating personalized consultation videos.
## Deploying to Hugging Face Spaces
Use a **Docker Space**. Hugging Face Spaces are git repositories, and each push triggers an automatic rebuild and restart. Docker Spaces support custom containers, including FastAPI endpoints, and the default external port is `7860`. citeturn109903view0turn109903view1turn109903view2
### Files used by the Space
- `Dockerfile`
- `app.py`
- `consultation_api.py`
- `requirements-hf.txt`
- `src/`
### Required Space secrets
Add these in **Space Settings → Variables and secrets**:
- `GEMINI_API_KEY`
- `PINECONE_API_KEY`
- `PINECONE_INDEX_NAME`
Optional:
- `SUMMARY_API_URL`
- `GOOGLE_MODEL`
- `TECHNICAL_TERMS`
If you want S3 upload to work, also add:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_DEFAULT_REGION`
### Local run
```bash
pip install -r requirements-hf.txt
uvicorn app:app --host 0.0.0.0 --port 7860
```
### API
- `GET /` → health check
- `POST /consultation-video` → body: `{ "user_id": "mock_user_riya_020" }`
- `GET /consultation-video/download/{user_id}` → downloads the most recent generated MP4 for that user if it was created locally