mirror of
https://github.com/gadievron/raptor.git
synced 2026-04-24 21:46:00 +03:00
[GH-ISSUE #40] Add Pydantic model support to LLM schema handler #8
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/raptor#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gadievron on GitHub (Dec 22, 2025).
Original GitHub issue: https://github.com/gadievron/raptor/issues/40
Problem
The function
_dict_schema_to_pydantic()inpackages/llm_analysis/llm/providers.pyonly handles dict schemas, but RAPTOR's hybrid design allows both dicts and Pydantic models. When Instructor library passes Pydantic models directly, TypeError occurs, breaking LLM structured output generation.Root Cause
RAPTOR intentionally uses hybrid Pydantic/dict approach for flexibility, but current implementation doesn't detect when Pydantic model is passed.
Impact
Fix
Add Pydantic model detection:
File:
packages/llm_analysis/llm/providers.py:88-95Also requires type annotation updates across codebase.
Type
Related
@gadievron commented on GitHub (Dec 22, 2025):
Fixed in PR #46