# Refine Prompt
CHAT_REFINE_PROMPT_TMPL_MSGS = [
HumanMessagePromptTemplate.from_template("{query_str}"),
AIMessagePromptTemplate.from_template("{existing_answer}"),
HumanMessagePromptTemplate.from_template(
"We have the opportunity to refine the above answer "
"(only if needed) with some more context below.\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, output the original answer again.",
),
]
this is my refine template
# define query configs for graph
query_configs = [
{
"index_struct_type": "simple_dict",
"query_mode": "default",
"query_kwargs": {
"similarity_top_k": 1,
"include_summary": True,
"refine_template": CHAT_REFINE_PROMPT_TMPL_MSGS
},
"query_transform": decompose_transform
},
{
"index_struct_type": "list",
"query_mode": "default",
"query_kwargs": {
"response_mode": "tree_summarize",
"verbose": True,
"refine_template": CHAT_REFINE_PROMPT_TMPL_MSGS
}
},
]
this is my query_configs
However, when I run
response = graph.query(q, query_configs=query_configs)
, I got error
line 117, in refine_response_single
refine_template = self.refine_template.partial_format(
AttributeError: 'list' object has no attribute 'partial_format'