| """Pydantic models for text generation""" | |
| from pydantic import BaseModel | |
| from typing import Optional | |
| class GenerateRequest(BaseModel): | |
| input_text: str | |
| max_length: Optional[int] = 128 | |
| num_beams: Optional[int] = 4 | |
| class GenerateResponse(BaseModel): | |
| input_text: str | |
| generated_text: str | |
| timestamp: str | |