Find answers from the community

Updated 2 months ago

I need help on sending top K results to

I need help on sending top K results to open AI
My code :
query_engine = index.as_query_engine(response_mode="tree_summarize", use_async=True, similarity_top_k=5,service_context=service_context) response = query_engine.query(qry)
In debug i see :


Initial prompt template: Context information is below. --------------------- pageNumber: 55 TPS ....... <Text> pageNumber: 52 TPS ....... <Text> pageNumber: 56 TPS <Text> pageNumber: 54 TPS ....... <Text> --------------------- Given the context information and not prior knowledge, answer the question: how much is TPS for Region A ?

My Question : Instead of combining all 5 results and sending to LLM , can i send individually then finally combine to get final results. Is there any way ?
Note : One of the paragraph may contain the answer
m
r
L
4 comments
Thanks. Let me check that
The "refine" response mode may also help, it will iterate over nodes one by one
Add a reply
Sign up and join the conversation on Discord