from pydantic import BaseModel from pydantic import Field class TextRequest(BaseModel): text: str = Field( min_length=1, max_length=5000 )