or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pydantic@2.11.x
tile.json

tessl/pypi-pydantic

tessl install tessl/pypi-pydantic@2.11.0

Data 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%

rubric.jsonevals/scenario-10/

{
  "context": "This criteria evaluates how well the engineer uses Pydantic's @model_serializer decorator to customize model serialization behavior. The focus is on proper implementation of custom serialization logic for both individual fields and computed summary data.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "BaseModel usage",
      "description": "Both UserActivity and ActivityReport classes inherit from pydantic.BaseModel with proper field type annotations (user_id: int, action: str, timestamp: datetime, activities: list[UserActivity])",
      "max_score": 10
    },
    {
      "name": "@model_serializer decorator",
      "description": "Uses @model_serializer decorator on methods in UserActivity and ActivityReport classes to customize serialization behavior",
      "max_score": 25
    },
    {
      "name": "model_dump invocation",
      "description": "Serializer methods properly call self.__pydantic_serializer__.to_python(self) or use SerializerFunctionWrapHandler to access default serialization output",
      "max_score": 20
    },
    {
      "name": "Timestamp formatting",
      "description": "UserActivity serializer formats the timestamp field as a human-readable string (e.g., 'January 15, 2024 at 10:30 AM') instead of ISO format",
      "max_score": 15
    },
    {
      "name": "Action uppercasing",
      "description": "UserActivity serializer converts the action field to uppercase in the serialized output",
      "max_score": 10
    },
    {
      "name": "Computed total count",
      "description": "ActivityReport serializer adds a total_activities field to the serialized output containing the count of activities",
      "max_score": 10
    },
    {
      "name": "Action breakdown",
      "description": "ActivityReport serializer adds an action_breakdown field containing a dictionary that groups activities by action type with counts for each type",
      "max_score": 10
    }
  ]
}