prompt-engineering-instructor
使用 Pydantic 校验从 LLM 响应中提取结构化数据,自动重试失败的提取,以类型安全方式解析复杂 JSON,并用 Instructor 流式输出部分结果——经过实战检验的结构化输出库。
机器翻译查看英文原文
Extract structured data from LLM responses with Pydantic validation, retry failed extractions automatically, parse complex JSON with type safety, and stream partial results with Instructor - battle-tested structured output library
适用对象:学习与科研。自动收录 · 待核查。
原作者说明节选
从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。
查看英文原文
原文涵盖的主题
- Instructor: Structured LLM Outputs
- When to Use This Skill
- Installation
- Quick Start
- Basic Example: Extract User Data
- With OpenAI
- Core Concepts
- 1. Response Models (Pydantic)
Use Instructor when you need to: Extract structured data from LLM responses reliably Validate outputs against Pydantic schemas automatically Retry failed extractions with automatic error handling Parse complex JSON with type safety and validation Stream partial results for real-time processing Support multiple LLM providers with consistent API GitHub Stars: 15,000+ | Battle-tested: 100,000+ developers Response models define the structure and validation rules for LLM outputs. Benefits: Type safety with Python type hints Automatic validation (wordcount > 0) Self-documenting with Field descriptions IDE autocomplete support Pydantic validates LLM outputs automatically. If validation fails, Instructor retries. Instructor retries automatically when validation fails, providing error feedback to the LLM. How it works: 1. LLM generates output 2. Pydantic validates 3. If invalid: Error message sent back to LLM 4. LLM tries again with error feedback 5. Repeats up to maxretries Stream partial results for real-time processing. | Feature | Instructor | Manual JSON | LangChain | DSPy | |---------|------------|-------------|-----------|------| | Type Safety | ✅ Yes | ❌ No | ⚠️ Partial | ✅ Yes | |
这里只展示节选,请以完整原文和当前要求为准。
- 来源仓库
- davila7/claude-code-templates
- 源文件
- cli-tool/components/skills/ai-research/prompt-engineering-instructor/SKILL.md
- 固定版本
- 21be197f100a12b8d0dd9a211cc244c8179f84d3
来源与内容状态
本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。
原作者:davila7/claude-code-templates · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T14:01:43.369Z。
分类由名称、说明与路径规则生成,分类不代表已核实适配。
许可与权利归属
MIT。第三方内容及版权归原作者,使用条件以原文为准。
许可原文 ↗本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。
限制与注意事项
- 元数据收录不代表本站已经安装、适配、实测或进行安全审查。