tatianija commited on
Commit
0a26b0c
·
verified ·
1 Parent(s): bddeb43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -670,8 +670,8 @@ Answer:"""
670
  time.sleep(10)
671
  search_results = self.search(question)
672
 
673
- if self.debug:
674
- print(f"Search results type: {type(search_results)}")
675
 
676
  if not search_results:
677
  return "No search results found. Let me try to answer based on my knowledge:\n\n" + self._answer_with_llm(question, attachment_context, url_context)
@@ -694,6 +694,7 @@ Answer:"""
694
  formatted_results.append(str(result))
695
 
696
  search_context = "\n\n".join(formatted_results)
 
697
 
698
  # Generate answer using search context, attachment context, and URL context
699
  context_sections = [f"Search Results:\n{search_context}"]
@@ -705,6 +706,10 @@ Answer:"""
705
  context_sections.append(f"URL Content:\n{url_context}")
706
 
707
  full_context = "\n\n".join(context_sections)
 
 
 
 
708
 
709
  answer_prompt = f"""\no_think You are a general AI assistant. I will ask you a question.
710
  Based on the search results and the context sections below, provide an answer to the question.
 
670
  time.sleep(10)
671
  search_results = self.search(question)
672
 
673
+ #if self.debug:
674
+ # print(f"Search results type: {type(search_results)}")
675
 
676
  if not search_results:
677
  return "No search results found. Let me try to answer based on my knowledge:\n\n" + self._answer_with_llm(question, attachment_context, url_context)
 
694
  formatted_results.append(str(result))
695
 
696
  search_context = "\n\n".join(formatted_results)
697
+
698
 
699
  # Generate answer using search context, attachment context, and URL context
700
  context_sections = [f"Search Results:\n{search_context}"]
 
706
  context_sections.append(f"URL Content:\n{url_context}")
707
 
708
  full_context = "\n\n".join(context_sections)
709
+
710
+ if self.debug:
711
+ print(f"Full context: {full_context}")
712
+
713
 
714
  answer_prompt = f"""\no_think You are a general AI assistant. I will ask you a question.
715
  Based on the search results and the context sections below, provide an answer to the question.