diff --git a/libs/experimental/langchain_experimental/graph_transformers/llm.py b/libs/experimental/langchain_experimental/graph_transformers/llm.py index ae68d32..d4624c1 100644 --- a/libs/experimental/langchain_experimental/graph_transformers/llm.py +++ b/libs/experimental/langchain_experimental/graph_transformers/llm.py @@ -753,7 +753,8 @@ def process_response( for rel in parsed_json: # Check if mandatory properties are there if ( - not rel.get("head") + not isinstance(rel, dict) + or not rel.get("head") or not rel.get("tail") or not rel.get("relation") ):