llama_index
llama_index copied to clipboard
Looking for 'Ref-Query', to learn about query_kwargs
Hi! first of all, thanks for a really cool open source project!
I've been working on getting up to speed, and am now trying to put together a text summary with a custom template.
response = index.query("What is a summary of this collection of text?", response_mode='tree_summarize', text_qa_template = SUMMARY_PROMPT)
I believe 'text_qa_template' should be something like 'text_summary_template' ; but I'm not able to find a list or docs on the available query_kwargs for the tree_summarize mode option (or others for that matter)
Digging in, i was able to get as far as this note:
For a comprehensive documentation of available `mode` and `query_kwargs` to
query a given index, please visit :ref:`Ref-Query`.
But couldn't find the Ref-Query referenced there
Thanks for the help!
-Z
https://github.com/jerryjliu/gpt_index/blob/ab736bd0e607312a9a34ac1f64e97597c1942837/gpt_index/indices/tree/base.py#L38
hi @zmrubin, this is part of our sphinx autogenerated docs. You can find the link here: https://gpt-index.readthedocs.io/en/latest/reference/indices.html#gpt_index.indices.base.BaseGPTIndex
Ok got it;
Is there a kwargs summary alternative to text_qa_template ? \
Once I have the SummaryPrompt , i need to pass it to index.query() as a different kwarg (not text_qa_template) . Been looking all over in the docs and haven't been able to find info in this.
thanks in advance
Hi @jerryjliu help really appreciated on this one! sorry to bug. Probably a simple answer, I just have not been able to find it in the Docs, or source code.
If index.query() support for SummaryPrompt templates is not yet supported, maybe i could build it and open up a PR. Would need a bit of guidance before digging into that though
Sorry, could you explain more why need to pass it in as something other thantext_qa_template
?
AFAIK, text_qa_template
is the correct arg to customize the query template, i.e. you should define a subclass of QuestionAnswerPrompt
with context_str
, query_str
as input variables.
But I do agree that our custom prompt support is a bit confusing 😅. Would love to see some contribution on this front. Happy to help review any PR!
@Disiok actually, @zmrubin is correct, we don't currently expose the summary prompt template for things like tree_summarize
A PR for this would be very cool!