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%
{
"context": "This criteria evaluates how effectively an engineer uses Pydantic's Field() function to define model fields with constraints, defaults, and validation rules. The focus is on proper use of Field() parameters for numeric constraints, string validation, pattern matching, and default value handling.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Field() import",
"description": "Imports Field from pydantic to use for field definitions",
"max_score": 5
},
{
"name": "BaseModel usage",
"description": "Properly defines ProductConfig class inheriting from BaseModel",
"max_score": 5
},
{
"name": "Price numeric constraints",
"description": "Uses Field() with ge=1.0 and le=10000.0 parameters to constrain price between 1.0 and 10000.0",
"max_score": 20
},
{
"name": "Name length constraints",
"description": "Uses Field() with min_length=3 and max_length=100 parameters to constrain name length",
"max_score": 20
},
{
"name": "SKU pattern validation",
"description": "Uses Field() with pattern parameter (regex like r'^PROD-\\d{5}$') to validate SKU format",
"max_score": 20
},
{
"name": "Stock default value",
"description": "Uses Field() with default=0 parameter to provide default value for stock_quantity",
"max_score": 10
},
{
"name": "Stock non-negative constraint",
"description": "Uses Field() with ge=0 parameter to ensure stock_quantity is non-negative",
"max_score": 10
},
{
"name": "Tags default factory",
"description": "Uses Field() with default_factory=list (or lambda: []) to provide mutable default for tags field",
"max_score": 10
}
]
}