tatianija commited on
Commit
bf21355
·
verified ·
1 Parent(s): ca21820

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -695,6 +695,7 @@ Answer with just "YES" if web search would be helpful, or "NO" if the available
695
  print(f"Error extracting URLs: {e}")
696
  url_context = ""
697
 
 
698
  try:
699
  # Detect and download attachments
700
  if self.debug:
@@ -721,11 +722,11 @@ Answer with just "YES" if web search would be helpful, or "NO" if the available
721
 
722
  image_files, audio_files, code_files = self._detect_and_process_direct_attachments(attachment_name, local_file_path)
723
 
724
- # Process attachments to get context
725
- attachment_context = self._process_attachments(image_files, audio_files, code_files)
726
 
727
- if self.debug and attachment_context:
728
- print(f"Attachment context: {attachment_context[:200]}...")
729
 
730
  # Decide whether to search
731
  if self._should_search(question_text, attachment_context, url_context):
 
695
  print(f"Error extracting URLs: {e}")
696
  url_context = ""
697
 
698
+ attachment_context = ""
699
  try:
700
  # Detect and download attachments
701
  if self.debug:
 
722
 
723
  image_files, audio_files, code_files = self._detect_and_process_direct_attachments(attachment_name, local_file_path)
724
 
725
+ # Process attachments to get context
726
+ attachment_context = self._process_attachments(image_files, audio_files, code_files)
727
 
728
+ if self.debug and attachment_context:
729
+ print(f"Attachment context: {attachment_context[:200]}...")
730
 
731
  # Decide whether to search
732
  if self._should_search(question_text, attachment_context, url_context):