Files
guides/backend/models.py
2026-05-25 22:59:37 +02:00

35 lines
745 B
Python

from pydantic import BaseModel, Field
from typing import Literal
FormatType = Literal[
"OnePager",
"Cheatsheet",
"MiniGuide",
"BeginnerGuide",
"IntermediateGuide",
"ExtendedGuide",
]
class GuideCreateRequest(BaseModel):
topic: str = Field(min_length=1, max_length=100)
format: FormatType
instructions: str = Field(default="", max_length=2000)
class GuideReworkRequest(BaseModel):
instructions: str = Field(min_length=1, max_length=2000)
class GuideResponse(BaseModel):
id: str
topic: str
format: str
status: str
progress: str | None = None
error_msg: str | None = None
html_path: str | None = None
pdf_path: str | None = None
created_at: str
updated_at: str