From 9e3e24e304f8ff210494380b46f614a2984cafb3 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 1 Jun 2026 09:42:54 -0700 Subject: [PATCH] refac --- backend/open_webui/retrieval/loaders/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/open_webui/retrieval/loaders/main.py b/backend/open_webui/retrieval/loaders/main.py index b262e66317..436d9a0acd 100644 --- a/backend/open_webui/retrieval/loaders/main.py +++ b/backend/open_webui/retrieval/loaders/main.py @@ -455,6 +455,16 @@ class Loader: or file_ext == 'docx' ): loader = Docx2txtLoader(file_path) + elif file_ext == 'doc' or file_content_type == 'application/msword': + try: + from langchain_community.document_loaders import UnstructuredWordDocumentLoader + + loader = UnstructuredWordDocumentLoader(file_path) + except ImportError: + raise ValueError( + "Processing .doc files requires the 'unstructured' package. " + 'Install it with: pip install unstructured' + ) elif file_content_type in [ 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',