Files
guides/backend/models.py
2026-05-29 15:49:22 +02:00

65 lines
1.3 KiB
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
created_at: str
updated_at: str
class BausteinCreateRequest(BaseModel):
topic: str = Field(min_length=1, max_length=100)
title: str = Field(min_length=1, max_length=200)
instructions: str = Field(default="", max_length=2000)
class BausteinReworkRequest(BaseModel):
instructions: str = Field(min_length=1, max_length=2000)
class BausteinResponse(BaseModel):
id: str
topic: str
title: str
description: str
purpose: str
example: str
created_at: str
updated_at: str
class SuggestionResponse(BaseModel):
id: str
topic: str
title: str
description: str
purpose: str
example: str
status: str
created_at: str