Update README.md
Browse files
README.md
CHANGED
|
@@ -1,60 +1,38 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
-
|
| 12 |
-
- **Streaming Support**: Real-time question generation
|
| 13 |
-
|
| 14 |
-
## π‘ API Endpoints
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
- `POST /api/generate` - Generate questions from text
|
| 18 |
-
- `POST /api/generate-more` - Generate follow-up questions
|
| 19 |
-
- `POST /api/validate` - Validate content before processing
|
| 20 |
-
- `POST /api/analyze-concepts` - Extract key concepts
|
| 21 |
-
|
| 22 |
-
### Health & Info
|
| 23 |
-
- `GET /` - Service info
|
| 24 |
-
- `GET /health` - Health check
|
| 25 |
-
- `GET /models` - Available AI models
|
| 26 |
-
- `GET /admin/stats` - Admin statistics
|
| 27 |
-
|
| 28 |
-
## π§ Configuration
|
| 29 |
-
|
| 30 |
-
### Environment Variables
|
| 31 |
-
- `HF_TOKEN`: Hugging Face API token (optional)
|
| 32 |
-
- `ENVIRONMENT`: `development` or `production`
|
| 33 |
-
- `PORT`: Server port (default: 7860)
|
| 34 |
|
| 35 |
-
|
| 36 |
-
Primary models used (all free tier):
|
| 37 |
-
- `microsoft/phi-2`: Fast and capable
|
| 38 |
-
- `google/flan-t5-small`: Reliable fallback
|
| 39 |
-
- `facebook/bart-large-cnn`: For explanations
|
| 40 |
|
| 41 |
-
##
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
| 51 |
|
|
|
|
| 52 |
```bash
|
| 53 |
-
#
|
| 54 |
-
curl https://
|
| 55 |
|
| 56 |
# Generate questions
|
| 57 |
-
curl -X POST https://
|
| 58 |
-
-F "text=
|
| 59 |
-F "session_id=test123" \
|
| 60 |
-F "options={\"num_questions\": 5}"
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: StudyLoop AI
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
sdk_version: "3.0"
|
| 8 |
+
python_version: "3.11"
|
| 9 |
+
app_file: app.py
|
| 10 |
+
pinned: false
|
| 11 |
+
---
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
# StudyLoop AI Backend
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
π **Intelligent study question generator powered by Hugging Face AI**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
## π Features
|
| 18 |
|
| 19 |
+
- **π€ AI-Powered Questions**: Generate multiple choice, short answer, true/false questions
|
| 20 |
+
- **π― Smart Content Analysis**: Extracts key concepts and learning objectives
|
| 21 |
+
- **β‘ Fast & Reliable**: Optimized for Hugging Face Spaces with intelligent fallbacks
|
| 22 |
+
- **π Smart Caching**: Reduces API calls and improves response times
|
| 23 |
+
- **π‘οΈ Safe & Secure**: Content validation and rate limiting
|
| 24 |
|
| 25 |
+
## π Quick Start
|
| 26 |
|
| 27 |
+
Your API is live at: **`https://andevs-studyloop.hf.space`**
|
| 28 |
|
| 29 |
+
### Test the API:
|
| 30 |
```bash
|
| 31 |
+
# Health check
|
| 32 |
+
curl https://andevs-studyloop.hf.space/health
|
| 33 |
|
| 34 |
# Generate questions
|
| 35 |
+
curl -X POST https://andevs-studyloop.hf.space/api/generate \
|
| 36 |
+
-F "text=Photosynthesis is the process plants use to convert sunlight into chemical energy." \
|
| 37 |
-F "session_id=test123" \
|
| 38 |
-F "options={\"num_questions\": 5}"
|