Explorar el Código

fix: pass header to Tika if PDF_EXTRACT_IMAGES is true

ayan4m1 hace 11 meses
padre
commit
039dec6820
Se han modificado 1 ficheros con 3 adiciones y 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:
             headers = {}
 
+        if self.kwargs.get("PDF_EXTRACT_IMAGES") == True:
+            headers['X-Tika-PDFextractInlineImages'] = 'true'
+
         endpoint = self.url
         if not endpoint.endswith("/"):
             endpoint += "/"