The community member is trying to extract structured data from unstructured text using structured_predict, but is encountering an issue where llama-index is unable to parse a datetime.date field in their Pydantic model, throwing an "Invalid Date Format" error. The community members suggest writing a custom validator for the field to handle the formatting, as the LLM is writing a string that Pydantic cannot parse. They also discuss whether this functionality could be provided out-of-the-box in llama-index, as date parsing is a common requirement. Additionally, a community member inquires about why llama-index expects Pydantic v1 for BaseModels, and the response explains that the recent v0.11.x release has added full Pydantic v2 support, which was a significant undertaking.
I am trying to extract structure data from the unstructured text using structured_predict, but if my Pydantic model has a field with type as datetime.date, llama-index is not able to parse the string and throws an error saying "Invalid Date Format". How can this be rectified
because v0.10.x and below is built entirely on pydantic v1, and uses the pydantic.v1 layer to maintain compatibility
We actually JUST released v0.11.x, with one of the main changes being full pdyantic v2 support (no more v1). You'd be surprised just how breaking of a change this was under the hood, it was a huge amount of work to migrate π