Add materials, exam images, storage quota, and API guide

Upload documents for AI context, exam images for Moodle questions, per-template storage limits, embedded images in XML export, and GUIA_API_Y_FLUJO.md with full endpoint documentation.
This commit is contained in:
Mireya Cueto Garrido
2026-06-01 10:30:40 +02:00
parent ba2507918b
commit 7bc27da33a
29 changed files with 1892 additions and 59 deletions
+11
View File
@@ -22,6 +22,17 @@ class Settings(BaseSettings):
jwt_algorithm: str = "HS256"
jwt_expire_minutes: int = Field(default=60 * 24, ge=5)
google_client_id: str | None = None
upload_dir: str = "/app/uploads"
max_upload_bytes: int = Field(default=20_971_520, ge=1_024)
max_materials_per_template: int = Field(default=10, ge=1, le=50)
max_reference_chars: int = Field(default=12_000, ge=1_000, le=100_000)
max_image_bytes: int = Field(default=5_242_880, ge=1_024)
max_images_per_template: int = Field(default=20, ge=1, le=100)
max_storage_bytes_per_template: int = Field(
default=52_428_800,
ge=1_024,
description="Cupo total por examen (materiales + imágenes). Por defecto 50 MB.",
)
model_config = SettingsConfigDict(
env_file=".env",
+2 -2
View File
@@ -32,8 +32,8 @@ def clean_text(value: str, *, max_length: int = 8_000) -> str:
return cleaned
def sanitize_prompt_input(value: str) -> str:
cleaned = clean_text(value, max_length=4_000)
def sanitize_prompt_input(value: str, *, max_length: int = 4_000) -> str:
cleaned = clean_text(value, max_length=max_length)
return ROLE_INJECTION_HINTS.sub("[filtered instruction]", cleaned)