- FastAPI backend with JWT auth, roles (admin/moderator/user) - PDF upload (up to 500MB) with streaming, PyMuPDF text extraction - ChromaDB vectorization per page with metadata - LiteLLM AI question extraction from PDF (not generation) - Image extraction from PDF pages, graceful fallback - Quiz modes: timed (countdown timer) + learning (answers shown inline) - Page-by-page question navigation with dot navigator - TTS endpoint using LiteLLM (Google Vertex / OpenAI voices) - Admin dashboard: AI model management per task, user role management - Moderator role: upload PDFs, create sections, generate quizzes - Spaced repetition reminders via SMTP email (SM-2 intervals) - APScheduler daily reminder jobs - Celery + Redis for background PDF processing - React frontend with all pages - Docker Compose deployment (nginx + backend + celery + redis) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
851 B
Python
37 lines
851 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class AIModelConfigCreate(BaseModel):
|
|
model_config = {"protected_namespaces": ()}
|
|
name: str
|
|
model_id: str
|
|
task: str # extraction, tts, general
|
|
api_key: str | None = None
|
|
is_active: bool = True
|
|
is_default: bool = False
|
|
|
|
|
|
class AIModelConfigResponse(BaseModel):
|
|
model_config = {"protected_namespaces": ()}
|
|
id: int
|
|
name: str
|
|
model_id: str
|
|
task: str
|
|
is_active: bool
|
|
is_default: bool
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class AIModelConfigUpdate(BaseModel):
|
|
model_config = {"protected_namespaces": ()}
|
|
name: str | None = None
|
|
model_id: str | None = None
|
|
task: str | None = None
|
|
api_key: str | None = None
|
|
is_active: bool | None = None
|
|
is_default: bool | None = None
|