Find answers from the community

Updated 3 months ago

Noxe

Greetings
I have built a pipeline that utilize llama index to read a pdf and ask question and retrieve most relevent chunk of data using vector store index
I aim to edit the text in the retrieved node(which is the most revlevent one) and then delete the original node and insert the updated node
I managed to delete using _delete method
but when I use the _insert method or add_nodes_to_index method , I get the following error
ValueError Traceback (most recent call last)
<ipython-input-77-c1a98b89981b> in <cell line: 1>()
----> 1 index._insert(nodes=response)

3 frames
/usr/local/lib/python3.10/dist-packages/pydantic/v1/main.py in setattr(self, name, value)
355
356 if self.config.extra is not Extra.allow and name not in self.fields:
--> 357 raise ValueError(f'"{self.class.name}" object has no field "{name}"')
358 elif not self.config.allow_mutation or self.config.frozen:
359 raise TypeError(f'"{self.class.name}" is immutable and does not support item assignment')

ValueError: "NodeWithScore" object has no field "embedding"

althogh I just replaced the text in the node and didn't make any changes to it
Is there a way to insert new node to an existing vector store index object ?
Thanks in advance
L
n
2 comments
NodeWithScore wraps a node

You probably want to insert source_node.node instead
Thanks for your support
Add a reply
Sign up and join the conversation on Discord