I'm using now:
from llama_index.prompts.base import PromptTemplate
from llama_index.prompts.prompt_type import PromptType
CUST_QA_PROMPT = PromptTemplate(CUST_PROMPT_TEMPLATE, prompt_type=PromptType.QUESTION_ANSWER)
CUST_REFINE_PROMPT = PromptTemplate(CUST_REFINE_PROMPT_TEMPLATE, prompt_type=PromptType.REFINE)
I should fallow new format from here
https://gpt-index.readthedocs.io/en/stable/core_modules/model_modules/prompts.html#usage-pattern ?
from llama_index.prompts import PromptTemplate
template = (
"We have provided context information below. \n"
"---------------------\n"
"{context_str}"
"\n---------------------\n"
"Given this information, please answer the question: {query_str}\n"
)
qa_template = PromptTemplate(template)
# you can create text prompt (for completion API)
prompt = qa_template.format(context_str=..., query_str=...)
# or easily convert to message prompts (for chat API)
messages = qa_template.format_messages(context_str=..., query_str=...)