instructor

Extract and validate structured data from LLM responses using Pydantic.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/LynxLabVN/office-agent --skill instructor-lynxlabvn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instructor
Source: https://github.com/LynxLabVN/office-agent/tree/main/agent-core/optional-skills/mlops/instructor
Command: npx skills add https://github.com/LynxLabVN/office-agent --skill instructor-lynxlabvn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pydantic, openai, anthropic, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Extracting structured data from LLM responses reliably and validating outputs is a challenging task. This Skill unit streamlines this process, automating data extraction and providing robust error handling and validation.

Core Features & Use Cases

  • Structured Data Extraction: Extract structured data from LLM responses using Pydantic validation.
  • Automatic Retries: Retry failed extractions automatically with built-in error handling.
  • Complex JSON Parsing: Parse complex JSON with type safety and validation.
  • Streaming Partial Results: Stream partial results for real-time processing.
  • Supports Multiple LLM Providers: Offers consistent API support for multiple LLM providers like OpenAI, Anthropic, and Claude.
  • Use Case: Extract user information (name, age, email) from a JSON response and automatically validate the output format.

Quick Start

Run the script extract_data.py to automatically validate and extract structured data from LLM responses.

Frequently Asked Questions about instructor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract structured data from LLM responses using Pydantic validation?

To extract structured data from LLM responses using Pydantic validation, define your data structures with Pydantic and run the extraction script to automatically parse and validate the output format.

Can I use this approach to parse complex JSON from multiple LLM providers?

Yes, you can parse complex JSON from multiple LLM providers. It offers consistent API support for OpenAI and Anthropic, ensuring type safety and validation across different platforms.

What is the best way to handle failed data extraction from LLM outputs?

The best way to handle failed data extraction from LLM outputs is using automatic retries. The system provides built-in error handling to retry failed extractions automatically.

Does structured data extraction support streaming partial results for real-time processing?

Yes, structured data extraction supports streaming partial results for real-time processing. This allows you to process data chunks as they are generated by the LLM.

Do I need Pydantic to validate complex JSON extracted from Claude responses?

Yes, you need Pydantic to validate complex JSON extracted from Claude responses. Pydantic defines the data structures and ensures type safety and validation accuracy.