new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

explore / Backend & APIs / mozg

Pydantic

Answer questions about Pydantic as documented today: model definition and field types, validation and serialization, ConfigDict options, custom validators and serializers, JSON Schema generation, settings management, the API reference, and the validation error codes — v2 semantics, not v1.

1,481 notes across 4 brains · updated 2026-08-15 · trained 66%

since last sitting: +39 newly passed — this brain is learning · the verified changelog →

use this brain
# sign in to get a token
$ claude mcp add --transport http mozg \
https://mozg.sh/mcp --header "Authorization: Bearer …"
> use mozg/pydantic — …
Sign in — get this command with your token in it

New here? Sign in and this exact command appears with your token already inside — copy, paste into your terminal, done.

Or just add it

Sign in and add it, and every agent you have connected can read it — nothing to download, and it stays current as the author updates it.

Sign in to add it

Ask it things like

answers 39/59 on its latest exam
How do you create a basic Pydantic model with field validation?Model Definition & Inheritance
What are the valid values for the extra configuration option in ConfigDict?ConfigDict & Configuration
When writing a field validator, what exceptions should you raise to signal validation failure?Custom Validators & Serializers
What does the @validate_call decorator do?Decorators & Functional API
How do you create a discriminated union in Pydantic?Discriminated Unions
How does Pydantic parse a datetime field from an ISO 8601 string vs a Unix timestamp?Field Types & Validation
How do you generate JSON Schema from a Pydantic model?JSON Schema Generation
What does model_dump() return and what is the purpose of the include parameter?Serialization & Output

What is inside

asking this brain searches all 3

What it can answer

59 coverage checks
66%
Answers 39 of the exam's 59 questionsIt answers 39 questions, 39 more than last time, out of an exam that grew by 59.Nothing it used to answer has stopped working.
ConfigDict & Configuration5 / 6
Field Types & Validation4 / 6
JSON Schema Generation4 / 6
Serialization & Output4 / 6
Custom Validators & Serializers3 / 8
Error Codes & Validation Errors3 / 5
TypeAdapter & Advanced APIs3 / 4
Validation Modes & Strict Mode3 / 3
Decorators & Functional API2 / 3
JSON Parsing & Performance2 / 3
Model Definition & Inheritance2 / 3
Settings Management2 / 3
Aliases & Field Configuration1 / 1
Discriminated Unions1 / 2
exam badge — share this score →

Attacks survived

re-run weekly · 2026-08-11
gate-battery12/12 known hostile payloads caught by the ingest gate
injection-corpusevery active note scanned — no steering language
secret-corpusevery active note scanned — no keys or credentials

heuristic scans against known attack classes — measured and dated, not a promise of unpoisonability

Inside

  • Three types of model validators · custom_validators
  • Accessing already validated data with ValidationInfo.data · custom_validators
  • Before validators defined with BeforeValidator or @field_validator · custom_validators
  • ValidatorFunctionWrapHandler import and usage · custom_validators
  • Model wrap validators take ModelWrapValidatorHandler · custom_validators
  • ValidationInfo argument in validators · custom_validators
  • Four types of field validators · custom_validators
  • After validators defined with AfterValidator or @field_validator · custom_validators
  • Plain validators terminate validation immediately · custom_validators
  • Wrap validators with ValidatorFunctionWrapHandler · custom_validators
  • Model after validators must return Self · custom_validators
  • Model before validators are classmethods taking Any · custom_validators
  • Raising validation errors with ValueError, AssertionError, or PydanticCustomError · custom_validators
  • Passing and accessing validation context · custom_validators

Licence

CC BY-NC-SA 4.0

Use it, copy it, build on it, with credit. Selling it is not allowed.