Files
video-gen/video-gen-api/app/schemas/credit_ratio.py
T
2026-05-25 17:08:18 +08:00

20 lines
557 B
Python

from pydantic import BaseModel, Field
from app.schemas.common import NaiveDatetime
class CreditRatioCreate(BaseModel):
model_config_id: str = Field(..., max_length=32)
gen_type: str = Field(default="video", max_length=16)
resolution: str = Field(..., max_length=16)
ratio: float = Field(..., gt=0)
base_credits: float = Field(default=80.0, ge=0)
per_second_credits: float = Field(default=2.0, ge=0)
class CreditRatioOut(CreditRatioCreate):
id: str
created_at: NaiveDatetime
model_config = {"from_attributes": True}