Spaces:
Configuration error
Configuration error
| from pydantic import BaseModel, field_validator | |
| class PersonalizeRequest(BaseModel): | |
| content: str | |
| user_id: int | |
| def content_not_empty(cls, v): | |
| if not v or not v.strip(): | |
| raise ValueError('Content cannot be empty') | |
| v = v.strip() | |
| if len(v) > 50000: | |
| raise ValueError('Content exceeds maximum length of 50000 characters') | |
| return v | |
| def user_id_positive(cls, v): | |
| if v <= 0: | |
| raise ValueError('User ID must be a positive integer') | |
| return v | |
| class PersonalizeResponse(BaseModel): | |
| personalized_content: str | |
| adjustments_made: str | |