Skip to content

Migrate to Pydantic v2 APIs for Python 3.14 support#50

Open
fzowl wants to merge 1 commit intovoyage-ai:mainfrom
fzowl:fix/python-3.14-pydantic-v2-migration
Open

Migrate to Pydantic v2 APIs for Python 3.14 support#50
fzowl wants to merge 1 commit intovoyage-ai:mainfrom
fzowl:fix/python-3.14-pydantic-v2-migration

Conversation

@fzowl
Copy link
Copy Markdown
Contributor

@fzowl fzowl commented Mar 21, 2026

The previous fix (#46) swapped the pydantic import order but still fell back to the broken pydantic.v1 path since Extra was removed in v2.

  • Remove pydantic.v1 fallback and Extra import
  • Replace Extra.forbid with string "forbid"
  • Replace min_items with min_length (v2 rename)
  • Replace .parse_obj() with .model_validate()
  • Replace .dict() with .model_dump()
  • Bump pydantic lower bound to >=2.7.4 (already required transitively by langchain-text-splitters via langchain-core)

Fixes #36

The previous fix (voyage-ai#46) swapped the pydantic import order but still fell
back to the broken pydantic.v1 path since Extra was removed in v2.

- Remove pydantic.v1 fallback and Extra import
- Replace Extra.forbid with string "forbid"
- Replace min_items with min_length (v2 rename)
- Replace .parse_obj() with .model_validate()
- Replace .dict() with .model_dump()
- Bump pydantic lower bound to >=2.7.4 (already required transitively
  by langchain-text-splitters via langchain-core)

Fixes voyage-ai#36
@fzowl fzowl force-pushed the fix/python-3.14-pydantic-v2-migration branch from a84267a to 7a11bd0 Compare March 21, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compatibility issue with Python 3.14 (caused by Pydantic v1)

1 participant