Pydantic Models
Create Pydantic models following the multi-model pattern for clean API contracts.
Quick Start
Copy the template from assets/template.py and replace placeholders:
{{ResourceName}}→ PascalCase name (e.g.,Project){{resource_name}}→ snake_case name (e.g.,project)
Multi-Model Pattern
| 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 |
camelCase Aliases
class 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
Optional Update Fields
class MyUpdate(BaseModel):
"""All fields optional for PATCH requests."""
name: Optional[str] = Field(None, min_length=1)
description: Optional[str] = None
Database Document
class MyInDB(MyResponse):
"""Adds doc_type for Cosmos DB queries."""
doc_type: str = "my_resource"
Integration Steps
- Create models in
src/backend/app/models/ - Export from
src/backend/app/models/__init__.py - Add corresponding TypeScript types
Skill Information
- Source
- Microsoft
- Category
- AI & ML
- Repository
- View on GitHub
Related Skills
agents-v2-py
Build container-based Foundry Agents using Azure AI Projects SDK with ImageBasedHostedAgentDefinition. Use when creating hosted agents that run custom code in Azure AI Foundry with your own container images. Triggers: "ImageBasedHostedAgentDefinition", "hosted agent", "container agent", "Foundry Agent", "create_version", "ProtocolVersionRecord", "AgentProtocol.RESPONSES", "custom agent image".
Microsofthosted-agents-v2-py
Build hosted agents using Azure AI Projects SDK with ImageBasedHostedAgentDefinition. Use when creating container-based agents that run custom code in Azure AI Foundry. Triggers: "ImageBasedHostedAgentDefinition", "hosted agent", "container agent", "create_version", "ProtocolVersionRecord", "AgentProtocol.RESPONSES".
Microsoftm365-agents-dotnet
Microsoft 365 Agents SDK for .NET. Build multichannel agents for Teams/M365/Copilot Studio with ASP.NET Core hosting, AgentApplication routing, and MSAL-based auth. Triggers: "Microsoft 365 Agents SDK", "Microsoft.Agents", "AddAgentApplicationOptions", "AgentApplication", "AddAgentAspNetAuthentication", "Copilot Studio client", "IAgentHttpAdapter".
Microsoftm365-agents-py
Microsoft 365 Agents SDK for Python. Build multichannel agents for Teams/M365/Copilot Studio with aiohttp hosting, AgentApplication routing, streaming responses, and MSAL-based auth. Triggers: "Microsoft 365 Agents SDK", "microsoft_agents", "AgentApplication", "start_agent_process", "TurnContext", "Copilot Studio client", "CloudAdapter".
Microsoftcreating-financial-models
This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions
Anthropic Cookbooks