Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create Pydantic models following the multi-model pattern for clean API contracts.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | -41% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -34% | 0% |
| case-01 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -58% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 5% | 0% |
Create Pydantic models following the multi-model pattern for clean API contracts.
Copy the template from assets/template.py and replace placeholders:
{{ResourceName}} → PascalCase name (e.g., Project){{resource_name}} → snake_case name (e.g., project)| Model | Purpose | |-------|---------| | Base | Common fields shared across models | | Create | Request body for creation (required fields) | | Update | Request body for updates (all optional) | | Response | API response with all fields | | InDB | Database document with doc_type |
pythonclass MyModel(BaseModel): workspace_id: str = Field(..., alias="workspaceId") created_at: datetime = Field(..., alias="createdAt") class Config: populate_by_name = True # Accept both snake_case and camelCase
pythonclass MyUpdate(BaseModel): """All fields optional for PATCH requests.""" name: Optional[str] = Field(None, min_length=1) description: Optional[str] = None
pythonclass MyInDB(MyResponse): """Adds doc_type for Cosmos DB queries.""" doc_type: str = "my_resource"
src/backend/app/models/src/backend/app/models/__init__.pyThis skill is applicable to execute the workflow or actions described in the overview.
Other measured skills in the registry, with their headline benchmark lift.