Explorar o código

fix: pass header to Tika if PDF_EXTRACT_IMAGES is true

ayan4m1 hai 5 meses
pai
achega
039dec6820
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      backend/open_webui/retrieval/loaders/main.py

+ 3 - 0
backend/open_webui/retrieval/loaders/main.py

@@ -99,6 +99,9 @@ class TikaLoader:
         else:
         else:
             headers = {}
             headers = {}
 
 
+        if self.kwargs.get("PDF_EXTRACT_IMAGES") == True:
+            headers['X-Tika-PDFextractInlineImages'] = 'true'
+
         endpoint = self.url
         endpoint = self.url
         if not endpoint.endswith("/"):
         if not endpoint.endswith("/"):
             endpoint += "/"
             endpoint += "/"