Find answers from the community

Updated 8 months ago

Hi Guys, can someone explain me what is

Hi Guys, can someone explain me what is meant by node_type in the relationships here, how do i know which is the parent node and which is child

"relationships": {
"1": {
"node_id": "bc1645fa-af52-4327-94a7-aa7102704971",
"node_type": "4",
"metadata": {},
"hash": "56a1a345ed0647823feae3a85db88d6eed6ea3d945889c26ed92a30cdcb6563f",
"class_name": "RelatedNodeInfo"
},
"2": {
"node_id": "d55d1f53-850e-4f9a-8d56-777a42c30609",
"node_type": "1",
"metadata": {},
"hash": "83546b66853221cddd7f3755a81bb2eb982c4c34029a99b9005572524defeb5e",
"class_name": "RelatedNodeInfo"
},
"3": {
"node_id": "27969805-5249-492d-bb9b-359b973dbd07",
"node_type": "1",
"metadata": {},
"hash": "4c71879d3ca7791657a4af99355072d89e2cc827ba3d262102a6eb192f082b1d",
"class_name": "RelatedNodeInfo"
}
},
L
l
10 comments
Ah, classic enum to int

The keys are all node relationships

Plain Text
>>> from llama_index.core.schema import NodeRelationship
>>> NodeRelationship("1")
<NodeRelationship.SOURCE: '1'>
>>> 
so is it like this
2 3
1
4
Pretty much

Plain Text
    SOURCE = 1
    PREVIOUS = 2
    NEXT = 3
    PARENT = 4
    CHILD = 5
I should update those enums to be strings
(they used auto() in the code)
ok what is meant by node_type key inside dict
Any video or tutorial i can read to understand this fully
node type is just some internal marker (text node, image node) to help with re-loading the node after its serialized
Attachment
image.png
I wouldn't worry too much about it unless you are manually doing that yourself
Helpful, thx a lot!
Add a reply
Sign up and join the conversation on Discord