Open Anindyadeep opened 17 hours ago
The error you're encountering, PydanticSerializationError: Error calling function <lambda>: AttributeError: 'str' object has no attribute 'value'
, typically arises when there is an attempt to access an attribute or method on a string that doesn't exist. This can happen if a Pydantic model is expecting an object with certain attributes, but instead receives a plain string.
Here are a few steps you can take to troubleshoot and potentially resolve this issue:
Check Data Types: Ensure that all data being passed to Pydantic models, especially those related to the TextNode
or any other custom models, are of the expected types. If a field is expected to be an object with attributes, make sure it is not a plain string.
Review Model Definitions: Look at the Pydantic models involved in the process, particularly those that might be serialized or deserialized. Ensure that the fields are correctly defined and that the data being passed matches these definitions.
Debugging: Add logging or print statements before the point of failure to inspect the data being processed. This can help identify if a string is being passed where an object is expected.
Check for Updates: Ensure that all packages, including LlamaIndex and its dependencies, are up to date. Sometimes, bugs are fixed in newer versions.
Custom Serializers: If you have custom serialization logic (e.g., using __pydantic_serializer__
), verify that it correctly handles all expected data types.
If these steps do not resolve the issue, you may need to delve deeper into the specific part of the code where the error occurs, focusing on how data is being transformed and passed to Pydantic models.
To continue talking to Dosu, mention @dosu.
Hi, sorry but it would be great, if I get to know any possible solution of this issue. Thanks
cc: @logan-markewich @ravi03071991
@Anindyadeep what version of pydantic do you have? This seems related.
v2.10 of pydantic is very breaking, newer versions of llama-index had to pin it. Try pip install "pydantic<2.10"
@Anindyadeep what version of pydantic do you have? This seems related.
v2.10 of pydantic is very breaking, newer versions of llama-index had to pin it. Try
pip install "pydantic<2.10"
I see, makes sense, let me try to downgrade pydantic. Thanks for the headsup
Bug Description
Initially I was following these tutorials:
Which was working on Neo4J local free version (running on docker), but when I switched to Neo4J Aura DB (which is the cloud version), I started to get some error.
Version
Steps to Reproduce
Till here everything was working fine, I could even see the visualization inside my cloud database. Now problem starts when doing retrieval
Above lines of code gave error, so tried different method
This also gave me the same error.
Relevant Logs/Tracbacks
And for this:
I got this error: