You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been loving kor so far (especially how it returns dicts with raw, errrors and validated data).
But is there some way to create your own "types" with validators with pydantic 2 e.g.:
PhoneNumber=Annotated[
str,
AfterValidator(lambdanum: ''.join(xforxinnumifx.isdigit())),
Field(
description="Phone number in E.164 format",
examples=["505505505"],
min_length=9,
max_length=9,
),
]
It would be quite useful for extraction tasks.
For now I've been kinda creating 2 models - 1 for kor which just gets strings, and 2nd to create more strict that validates the previous model, which is not ideal, but gets the job done.
The text was updated successfully, but these errors were encountered:
Hey,
I've been loving kor so far (especially how it returns dicts with raw, errrors and validated data).
But is there some way to create your own "types" with validators with pydantic 2 e.g.:
It would be quite useful for extraction tasks.
For now I've been kinda creating 2 models - 1 for kor which just gets strings, and 2nd to create more strict that validates the previous model, which is not ideal, but gets the job done.
The text was updated successfully, but these errors were encountered: