It's a little different for each index and types of queries, but here's a little example using a vector index (just from a quick failed experiment I did haha these prompts aren't useful)
query_prompt_template = (
"The following is text from an invoice, captured by OCR, where each word is followed by its XY position on the page.\n"
"---------------------\n"
"{context_str}"
"\n---------------------\n"
"Given this information and not prior knowledge, "
"answer the following question: {query_str}\n"
)
query_prompt_template = QuestionAnswerPrompt(query_prompt_template)
query_refine_propmt_template = (
"The original question is as follows: {query_str}\n"
"We have provided an existing answer: {existing_answer}\n"
"We have the opportunity to refine the existing answer"
"(only if needed) with more text captured by OCR. Each word is followed by it's XY position on the page.\n"
"------------\n"
"{context_msg}\n"
"------------\n"
"Given the new context, refine the original answer to better "
"answer the question. "
"If the context isn't useful, return the original answer."
)
query_refine_propmt_template = RefinePrompt(query_refine_propmt_template)
response = index.query(query_text, similarity_top_k=5, text_qa_template=query_prompt_template, refine_template=query_refine_propmt_template)