Find answers from the community

Updated 4 months ago

Response

At a glance
Hello, I am working with llama index with chromadb to get response from query, while I get response i am trying to get what document it is referring to i tried this:

if hasattr(response, 'metadata'):
document_info = str(response.metadata)
find = re.findall(r"'page_label': '[^']', 'file_name': '[^']'", document_info)

print('\n'+'=' * 60+'\n')
print('Context Information')
print(str(find))
print('\n'+'=' * 60+'\n')
L
p
4 comments
You probably want to check response.source_nodes instead
Ohh because by doing what I did it gives me doc even if I just have hi as my query
I am still getting same issue whenever I have query which is not related to any documents I still get same issue
I get response of the file regardless
Add a reply
Sign up and join the conversation on Discord