tessl install tessl/pypi-pydantic@2.11.0Data validation using Python type hints
Agent Success
Agent success rate when using this tile
90%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.3x
Baseline
Agent success rate without this tile
69%
A system for managing user account statuses with automatic validation and JSON serialization.
@generates
from enum import Enum
from typing import Dict, Any
class AccountStatus(Enum):
"""Enumeration of possible account statuses."""
ACTIVE = "active"
SUSPENDED = "suspended"
BANNED = "banned"
class User:
"""
User model with validated account status.
When serialized to JSON/dict, the status should be represented
as its string value (e.g., "active") rather than the enum instance.
"""
username: str
status: AccountStatus
def to_dict(self) -> Dict[str, Any]:
"""
Convert user to dictionary representation.
Status should be serialized as its string value.
"""
passProvides data validation support.