semantic-router
semantic-router copied to clipboard
Migration to Pydantic V2
The Route
object still uses pydantic V1. Are there plans to migrate to V2?
Out of curiosity, is there a reason why Route
was based on pydantic V1 and not pydantic V2?
Inscoping this as part of our backlog
@bruvduroiu there are so many projects that use pydantic v1 and upgrading to pydantic v2 is not an option for them due to the amount of change it requires. Currently, I am resorting to maintaining my own fork of this library and supporting v1 as in the following snippet. Do you think there is a way to keep supporting both the versions in the library itself for some time at least to make this project actually useful?
try:
from pydantic.v1 import BaseModel # type: ignore
except ImportError:
from pydantic import BaseModel # type: ignore
Pydantic just released 1.10.15
like 7 hours ago, so I think we must support it. I can make a PR from my fork if this is on the roadmap.