----------------------
The error you're encountering is likely due to changes in the LlamaIndex API. In the recent updates, the
Node
object has been renamed to
TextNode
and it seems like the attribute
node_text
is no longer available. Instead, you should use the
text
attribute to access the text of a
TextNode
object.
Here is an example of how to instantiate a
TextNode
and access its text:
from llama_index.schema import TextNode
# Instantiate a TextNode
node = TextNode(text="Your text here")
# Access the text
print(node.text)
For
NodeWithScore
objects, you can access the
TextNode
(formerly
Node
) and its text like this:
from llama_index.schema import NodeWithScore, TextNode
# Instantiate a NodeWithScore
node_with_score = NodeWithScore(node=TextNode(text="Your text here"), score=0.7)
# Access the TextNode and its text
print(node_with_score.node.text)
Please refer to the
changelog () and the
API reference () for more details.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------