Hi, I am trying to experiment with custom nodes.
I tried creating a parent-child relationship like this:
child_node.relationships[NodeRelationship.PARENT] = RelatedNodeInfo(
node_id=parent_node.node_id
)
parent_node.relationships[NodeRelationship.CHILD] = RelatedNodeInfo(
node_id=child_node.node_id
)
But I keep getting the error:
ValueError: Child objects must be a list of RelatedNodeInfo objects.
When I do
print(parent_node.child_nodes)
It seems I am missing something. Can someone help me out here? Thanks!
The documentation I used as a reference to write this is here:
https://docs.llamaindex.ai/en/stable/module_guides/loading/documents_and_nodes/usage_nodes/Edit: Can we only connect 1 child node at a time?
Edit 2: Nevermind, I figured it out after looking at the source code. Please ignore