mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-08 14:05:16 +00:00
Fix AttributeError on calling LLMGraphTransformer.convert_to_graph_documents #21482 since raw_schema is always a str @baskaryan
This commit is contained in:
parent
6db25b4e31
commit
8fd231086e
@ -609,7 +609,9 @@ class LLMGraphTransformer:
|
||||
else:
|
||||
nodes_set = set()
|
||||
relationships = []
|
||||
parsed_json = self.json_repair.loads(raw_schema.content)
|
||||
if not isinstance(raw_schema, str):
|
||||
raw_schema = raw_schema.content
|
||||
parsed_json = self.json_repair.loads(raw_schema)
|
||||
for rel in parsed_json:
|
||||
# Nodes need to be deduplicated using a set
|
||||
nodes_set.add((rel["head"], rel["head_type"]))
|
||||
|
Loading…
Reference in New Issue
Block a user