Find answers from the community

Updated 2 years ago

Custom Tree Summary Prompt

what's the best way to use custom prompts when querying a GPTSImpleVectorIndex?

I've tried doing something like this but it doesn't seem to actually be using the prompt when i do index_with_query.query()

SUMMARY_PROMPT_TMPL = ( "Context information is below. \n" "---------------------\n" "{context_str}" "\n---------------------\n" "Always answer the question in bullet points" ) SUMMARY_PROMPT = SummaryPrompt(SUMMARY_PROMPT_TMPL) # Build GPTTreeIndex: pass in custom prompt index_with_query = GPTTreeIndex(documents, summary_template=SUMMARY_PROMPT)
L
1 comment
What does the code for calling the query look like?

I think to use the summary prompt, your query should look something like this:
response = index_with_query.query('<string>', mode="summarize")
Add a reply
Sign up and join the conversation on Discord