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
thank you very much for this very helpful library - I like it a lot!
Processing some documents I stumbled around a NoneType error during the validation of the Node BaseModel.
In the for-loop of LLMGraphTransformer -> process_response with self._function_call == False there is a check for None values of the head, tail and relation keys in the parsed_json. A few lines later there is:
In my case it occurred, that rel["head_type"] is present but is None. In this case, rel.get("head_type", DEFAULT_NODE_TYPE) yields None instead of DEFAULT_NODE_TYPE and a pydantic.ValidatonError is raised.
Maybe there should be another sanity check like:
rel["head_type"] = rel.get("head_type", DEFAULT_NODE_TYPE) or DEFAULT_NODE_TYPE
rel["tail_type"] = rel.get("tail_type", DEFAULT_NODE_TYPE) or DEFAULT_NODE_TYPE
to make sure the type values are not None?
Best, Philipp
The text was updated successfully, but these errors were encountered:
Hi,
thank you very much for this very helpful library - I like it a lot!
Processing some documents I stumbled around a
NoneType
error during the validation of theNode
BaseModel.In the for-loop of LLMGraphTransformer -> process_response with
self._function_call == False
there is a check forNone
values of thehead
,tail
andrelation
keys in theparsed_json
. A few lines later there is:source_node = Node(id=rel["head"], type=rel.get("head_type", DEFAULT_NODE_TYPE))
In my case it occurred, that
rel["head_type"]
is present but isNone
. In this case,rel.get("head_type", DEFAULT_NODE_TYPE)
yieldsNone
instead ofDEFAULT_NODE_TYPE
and a pydantic.ValidatonError is raised.Maybe there should be another sanity check like:
to make sure the type values are not None?
Best, Philipp
The text was updated successfully, but these errors were encountered: