Find answers from the community

Updated 3 months ago

After updating to the current version of llama_index, I get the error "'TextNode' object h

After updating to the current version of llama_index, I get the error "'TextNode' object has no attribute 'source_text'". What is the correct attribute now?
k
e
4 comments
Please stand by @ethan0807 as I search the knowledge base. I normally take about 20 seconds or so. :wave:
----------------------
The error you're encountering is likely due to changes in the API. In the recent updates, the Node object has been renamed to TextNode and some of its properties have been changed. The source_text attribute is no longer available. Instead, you should use the text attribute to access the text content of a TextNode object.

Here is an example of how to instantiate a TextNode:

Plain Text
from llama_index.schema import TextNode

node = TextNode(text="<text_chunk>", id_="<node_id>")


You can find more details about these changes in the changelog ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
@kapa.ai After updating to the current version of llama_index, I get the error "'NodeWithScore' object has no attribute 'extra_info'". What is the correct attribute now?
@kapa.ai After updating to the current version of llama_index, I get the error "'NodeWithScore' object has no attribute 'extra_info'". What is the correct attribute now?
Add a reply
Sign up and join the conversation on Discord