🎯Core Definition
Instructor is a client-side structured extraction and runtime self-healing validation framework for Python; built on Pydantic validators (`@field_validator`), it evaluates deep domain-specific business rules (e.g., date ranges, numeric bounds, inter-field dependencies) against LLM outputs; upon encountering a `ValidationError`, Instructor automatically catches the exception, injects formatted error tracebacks into an error-correction prompt, and executes an automated Self-Healing Retry Loop until validation passes or retry caps are reached.
💡Use Cases
Strict business logic validation (e.g., `end_date > start_date`), multi-provider structured extraction, and retrofitting legacy models lacking native Structured Outputs.