AI Agents Book

Primitive of the day · 2026-10-17

llm-validator-client-required

instructor.llm_validator's real 1.15.4 signature is llm_validator(statement, client, allow_override=False, model='gpt-3.5-turbo', temperature=0) — the client positional is REQUIRED and there is no allow_reask parameter (older examples showing it are stale; closest is allow_override).

When this applies

Delegating semantic field validation to an LLM inside a Pydantic validator.

Preconditions

Do this

Call llm_validator("<criterion>", validation_client, allow_override=False)(value) inside the field_validator; never copy the old client-less/allow_reask form.

What you should see

Semantic criterion enforced via the LLM, with a call that matches the installed signature (checked on instructor 1.15.4).

How it fails if ignored

Stale-doc call forms raise TypeError; default model param points at an OpenAI model unless overridden.

Do not use when

Rule-expressible validations (write a plain field_validator instead — cheaper and deterministic).

Corrected on 2026-10-23: an internal remark was removed.

Kind: gotcha-fix. Part of the skill Instructor pydantic extractor. Free to reuse in your own agent skills.

Get the whole skill

All 12 primitives of this skill as one package, with the order to apply them.

Get just this primitive

This one primitive for 1 credit (≈ €0.10); the other primitives of the skill are on its page.

Upgrade your own skill

Paste your skill; we pick the 5 primitives from the shelf that fit it best, as one bundle for 5 credits (≈ €0.50).

Upgrade my skill

Register interest

Interest only — no payment, no order, no reservation. After you confirm by email we send you one free sample primitive.