如果响应[“answer”]包含“无法找到答案”,我需要条件才能工作
尝试:
instructions =instruction
prompt_query = query + instructions
response = await conv_chain.acall({"question": prompt_query, "chat_history": chat_history_new})
end_time = time.time()
logger.info("response generated in :"+str(end_time-start_time)+"secs")
if response["answer"] == "Unable to find the relevant answer":
second_instruction=instruction1
retry_prompt_query = query + second_instruction
response = await conv_chain.acall({"question": retry_prompt_query, "chat_history": chat_history_new})
except:
if "unable to find the relevant answer" in response["answer"]: