diff --git a/app/llmops/src/rag_adaptive_evaluation/prompts_library.py b/app/llmops/src/rag_adaptive_evaluation/prompts_library.py index c72e100..143e1a6 100644 --- a/app/llmops/src/rag_adaptive_evaluation/prompts_library.py +++ b/app/llmops/src/rag_adaptive_evaluation/prompts_library.py @@ -6,9 +6,9 @@ Use the vectorstore for questions on these topics. Otherwise, use web-search. system_retriever_grader = """You are a grader assessing relevance of a retrieved document to a user question. \n If the document contains keyword(s) or semantic meaning related to the user question, grade it as relevant. \n - You must make sure that read carefully that the document contains a sentence or chunk of sentences that is exactly related but not closely related to the question subject (e.g. must be the exact disease or subject in question). \n + You must make sure to read carefully that the document contains a sentence or chunk of sentences that is exactly related but not closely related to the question subject (e.g. must be the exact disease or subject in question). \n The goal is to filter out erroneous retrievals. \n - Give a binary score 'yes' or 'no' score to indicate whether the document is relevant to the question.""" + Must return a binary score 'yes' or 'no' score to indicate whether the document is relevant to the question.""" system_hallucination_grader = """You are a grader assessing whether an LLM generation is grounded in / supported by a set of retrieved facts. \n Give a binary score 'yes' or 'no'. 'Yes' means that the answer is grounded in / supported by the set of facts.""" @@ -21,16 +21,17 @@ system_question_rewriter = """You a question re-writer that converts an input qu # prompt for question answering based on retrieved documents qa_prompt_template = """You are an expert at answering questions based on the following retrieved context.\n -Before answering the question, you must have your own thought process what are the general scope to cover when answering this question, step-by-step. Do not include this thought process in the answer.\n -Then, given your thought process, you must read the provided context carefully and extract the relevant information. You must not use any information that is not present in the context to answer the question. Make sure to remove those information not present in the provided context.\n +Before answering the question, you must have your own thought process what are the general scopes to cover when answering this question, step-by-step. Do not include this thought process in the answer.\n +Then, given your thought process, you must read the provided context carefully and extract the relevant information.\n -For example: -1. For cancer diseases, usually what are the general treatments to cover when answering treatment question? \n +If the question is about medical question, you must answer the question in a medical way and assume that the audience is a junior doctor or a medical student: \n +1. For cancer diseases, you must include comprehensive treatment advices that encompasses multidisciplinary treatment options that included but not limited to surgery, chemotherapy, radiology, internal medicine (drugs), nutritional ratio (protein), etc. You must layout out the treatment options like what are the first-line, second-line treatment etc.\n 2. For cancer diseases, don't consider context that is not primary tumor/cancer related, unless the question specifically mention it is secondary tumor/cancer related.\n 3. If the question didn't state the stage of the cancer disease, you must reply with treatment options for each stage of the cancer disease, if they are availalbe in the provided context. If they are not available in the provided context, give a general one.\n +You must not use any information that is not present in the provided context to answer the question. Make sure to remove those information not present in the provided context.\n If you don't know the answer, just say that you don't know.\n -Keep the answer concise.\n +Provide the answer in a concise and organized manner. \n Question: {question} \n Context: {context} \n