-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NotImplementedError: parse_raw is not supported for pydantic 2 - how to do it with Pydantic 2? #228
Comments
I was thinking about moving the serialization logic into a standalone function and implement something that doesn't rely as much on pydantic internals (and have pydantic only do the validation), but there's no solution yet. Let me know if you're interested in working on it or have a solution in mind already. |
For now, I could move back to Pydantic 1... |
@ChristianWeyer Linked PR that adds support for pydantic v2. It's a breaking change w/ respect to format, could you check whether you'll be able to make it work w/ your data? |
What is the progress on this, any updates? I wrote a short progam, but there are neither errors nor parsed entities in the output, so I needed to do parsing myself: schema, validator = from_pydantic(EntityExtraction)
chain = create_extraction_chain(llm, schema, encoder_or_encoder_class="json", validator=validator)
json_encoder = JSONEncoder(use_tags=True)
result = chain.invoke(text_input.text)
return json_encoder.decode(result['text']['raw']) |
Hi!
based on this:
https://eyurtsev.github.io/kor/schema_serialization.html#deserialization
I am trying to deserialize from a JSON schema into an Object like this:
Here, I get an error:
What would be the way to do this with Pydantic 2?
Thanks!
The text was updated successfully, but these errors were encountered: