TEXT_QA_PROMPT_TMPL = ( "Context information is below. \n" "---------------------\n" "{context_str}" "\n---------------------\n" "If the context is not relavent, ignore it completely. \n" "Given the context information and using the best of your prior knowledge, \n" "answer the question: {query_str}\n" ) qa_prompt = QuestionAnswerPrompt(TEXT_QA_PROMPT_TMPL)
index.query
Tool into an agentREFINE_PROMPT_TMPL = ( "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 some more context below.\n" "------------\n" "{context_msg}\n" "------------\n" "Given the new context, respond in a comical style." )
query_str
, existing_answer
and context_msg
. How are these being fetched?agent_kwargs={"prefix": prefix, "suffix": suffix}
and it appears to work!CONVERSATIONAL_REACT_DESCRIPTION