Bläddra i källkod

Fix playwright in docker by updating unstructured

Rory 2 månader sedan
förälder
incheckning
a84e488a4e
3 ändrade filer med 5 tillägg och 5 borttagningar
  1. 3 3
      backend/open_webui/retrieval/web/utils.py
  2. 1 1
      backend/requirements.txt
  3. 1 1
      pyproject.toml

+ 3 - 3
backend/open_webui/retrieval/web/utils.py

@@ -175,7 +175,7 @@ class SafePlaywrightURLLoader(PlaywrightURLLoader):
                 yield document
             except Exception as e:
                 if self.continue_on_failure:
-                    log.error(f"Error processing {url}, exception: {e}")
+                    log.exception(e, "Error loading %s", url)
                     continue
                 raise e
 
@@ -190,7 +190,7 @@ class SafePlaywrightURLLoader(PlaywrightURLLoader):
                 yield document
             except Exception as e:
                 if self.continue_on_failure:
-                    log.error(f"Error processing {url}, exception: {e}")
+                    log.exception(e, "Error loading %s", url)
                     continue
                 raise e
 
@@ -210,7 +210,7 @@ class SafeWebBaseLoader(WebBaseLoader):
                 yield Document(page_content=text, metadata=metadata)
             except Exception as e:
                 # Log the error and continue with the next URL
-                log.error(f"Error loading {path}: {e}")
+                log.exception(e, "Error loading %s", path)
 
 RAG_WEB_LOADERS = defaultdict(lambda: SafeWebBaseLoader)
 RAG_WEB_LOADERS["playwright"] = SafePlaywrightURLLoader

+ 1 - 1
backend/requirements.txt

@@ -60,7 +60,7 @@ fpdf2==2.8.2
 pymdown-extensions==10.11.2
 docx2txt==0.8
 python-pptx==1.0.0
-unstructured==0.15.9
+unstructured==0.16.17
 nltk==3.9.1
 Markdown==3.7
 pypandoc==1.13

+ 1 - 1
pyproject.toml

@@ -66,7 +66,7 @@ dependencies = [
     "pymdown-extensions==10.11.2",
     "docx2txt==0.8",
     "python-pptx==1.0.0",
-    "unstructured==0.15.9",
+    "unstructured==0.16.17",
     "nltk==3.9.1",
     "Markdown==3.7",
     "pypandoc==1.13",