AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

pydantic-models-py

Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants. Use when defining API request/response schemas, database models, or data validation in Python applications using Pydantic v2.

Original source
microsoft
License
MIT
Pinned revision
3f5b461b2314e01c400564051e92469114c5b68f

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read microsoft--pydantic-models-py at revision 3f5b461b2314e01c400564051e92469114c5b68f, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 2

references/capabilities.md

pydantic-models-py capability coverage

SDK/package: pydantic

This reference captures additional non-hero capabilities and API breadth so the main SKILL.md can stay focused on copy/paste hero flows.

Hero scenarios covered in SKILL.md

  • Quick Start
  • Multi-Model Pattern
  • camelCase Aliases
  • Optional Update Fields

Important non-hero scenarios to include when needed

  • Database Document
  • Integration Steps

API breadth checklist

  • Verify field validators (@field_validator) and model validators (@model_validator) cover all required constraints.
  • Confirm serialization behavior: use model_dump(mode="json") for JSON-safe output and model_dump(exclude_unset=True) for partial updates.
  • Include schema generation examples (model_json_schema()) when the model drives API contracts or documentation.
  • Use model_validate when validating an existing dict or object; direct BaseModel(...) construction also runs validators and coercion.
  • Ensure new code uses Pydantic v2 patterns (@field_validator, model_config) rather than deprecated v1 patterns (@validator, orm_mode).