Find answers from the community

Updated 3 months ago

Trying to build a RAG pipeline using

Trying to build a RAG pipeline using chat engine but the metadata around page numbers and filenames seems to be missing. I can possible add it in prompt - but any other ways to get the same ?
T
1 comment
Do you already have the metadata in your index? If so you can either prompt it or access the response source nodes:
Plain Text
print(response.source_nodes)


Or alternatively directly access the filename:

Plain Text
for node_with_score in response.source_nodes:
    node = node_with_score.node
    file_name = node.metadata.get('file_name')
    print(file_name)
Add a reply
Sign up and join the conversation on Discord