Change8
Error1 reports

Fix PydanticUserError

in Instructor

Solution

PydanticUserError in instructor often arises from mismatches between type annotations and the actual data or functions being passed within instructor models or functions, particularly with generics like `List[Annotated[MyType, ...]]` or mixins. Review your type annotations and ensure they accurately reflect the expected structure and types, paying close attention to any custom validators or coercers used within `Annotated` and within mixins such as `Partial`. Explicitly defining `__pydantic_config__` in classes that inherit from Pydantic models, even with an empty dictionary, can also resolve some issues.

Related Issues

Real GitHub issues where developers encountered this error:

Timeline

First reported:Feb 13, 2025
Last reported:Feb 13, 2025

Need More Help?

View the full changelog and migration guides for Instructor

View Instructor Changelog