Find answers from the community

Updated 2 months ago

Qa prompt

Hello

i am using QuestionAnswerPrompt in llama-index 0.6.8. I am only getting the following error while i am using QuestionAnswerPrompt :

Plain Text
QA_PROMPT_TMPL = (
    
    "We have provided context information below. \n"
    "---------------------\n"
    "{context_str}"
    "\n---------------------\n"
    "Given this information, please answer the question: {query_str}\n"
)
QA_PROMPT = QuestionAnswerPrompt(QA_PROMPT_TMPL)

query_engine = index.as_query_engine(streaming=True, similarity_top_k=10, text_qa_template=QuestionAnswerPrompt)

response = query_engine.query(query_str)

OUTPUT ERROR:

TypeError: Prompt.partial_format() missing 1 required positional argument: 'self'

Anyone help here . Thanks!
L
1 comment
It looks like you didn't actually pass in QA_PROMPT πŸ‘€
Add a reply
Sign up and join the conversation on Discord