Find answers from the community

Updated 3 months ago

Is it possible to get the chunk s that

Is it possible to get the chunk(s) that was retrieved by a query engine?

VectorStoreIndex.from_documents().as_query_engine() has type llama_index.query_engine.retriever_query_engine.RetrieverQueryEngine but https://gpt-index.readthedocs.io/en/latest/reference/query/query_engines/retriever_query_engine.html does not have a query() function ....

This documentation is difficult to deal with
L
3 comments
the source chunks are available as a list on the response object

Plain Text
response = query_engine.query("query")

print(response.source_nodes)
retrievers only retrieve, not query πŸ™‚
nodes = index.as_retriever().retrieve("text")
Add a reply
Sign up and join the conversation on Discord