Update app.py
Browse files492 unmodified lines493494495496497498499500492 unmodified linesdef extract_answer(full_response, instructions=None):try:# Remove the context information more specificallycontext_pattern = r"Context:.*?Question:.*?Entities:.*?}\s*"full_response = re.sub(context_pattern, "", full_response, flags=re.DOTALL | re.IGNORECASE)# List of patterns to remove492 unmodified lines493494495496497498499500501502503492 unmodified linesdef extract_answer(full_response, instructions=None):try:# Remove the web search results and context informationweb_results_pattern = r"Answer based on: Web Results:.*?(?=\n\n)"context_pattern = r"Context:.*?Entities:.*?}\s*"full_response = re.sub(web_results_pattern, "", full_response, flags=re.DOTALL | re.IGNORECASE)full_response = re.sub(context_pattern, "", full_response, flags=re.DOTALL | re.IGNORECASE)# List of patterns to remove
app.py+5-2