Find answers from the community

Updated 9 months ago

I'm trying to use the `output_cls`

I'm trying to use the output_cls parameter of TreeSummarize to extract some common information from my documents. I have metadata in place that will allow me to capture exactly the document subset I want to summarize over.

My current approach is to use a SummaryIndex and then filter on the metadata after retrieval. I also tried using my normal vector store with filters set during retriever creation, but it is hard to create a query that captures all the documents pre-filtering, because there is no default embedding for an empty query and i can't see a place to pass one in (like you can with the VectorIndexAutoRetriever).

Just wondering if my summary approach is the correct one, or if there is a more direct route to get to where i am trying to go. Thanks in advance for any advice.
L
a
3 comments
You can indeed pass an empty query, although it is maybe a tad hidden

Plain Text
from llama_index.core import QueryBundle

vector_index.query(QueryBundle(query_str="empty", embedding=[0]*embed_dim))
As usual, you have all the answers. Thanks again.
:dotsCATJAM: :dotsHARDSTYLE:
Add a reply
Sign up and join the conversation on Discord