Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
chore: add missing @override decorator to api/core/rag/extractor (#37013)
Siyu/Audrey Xiaoe14cb209a4ce
diff --git a/api/core/rag/extractor/blob/blob.py b/api/core/rag/extractor/blob/blob.pyindex 4537c1b5373..86d71cbafe3 100644--- a/api/core/rag/extractor/blob/blob.py+++ b/api/core/rag/extractor/blob/blob.py@@ -12,7 +12,7 @@ import mimetypesfrom collections.abc import Generator, Mappingfrom io import BufferedReader, BytesIOfrom pathlib import Path, PurePath-from typing import Any+from typing import Any, overridefrom pydantic import BaseModel, ConfigDict, model_validator@@ -139,6 +139,7 @@ class Blob(BaseModel):"""return cls(data=data, mimetype=mime_type, encoding=encoding, path=path)+ @overridedef __repr__(self) -> str:"""Define the blob representation."""str_repr = f"Blob {id(self)}"diff --git a/api/core/rag/extractor/csv_extractor.py b/api/core/rag/extractor/csv_extractor.pyindex 19bc9cec846..778dbd40c68 100644--- a/api/core/rag/extractor/csv_extractor.py+++ b/api/core/rag/extractor/csv_extractor.py@@ -1,7 +1,7 @@"""Abstract interface for document loader implementations."""import csv-from typing import Any+from typing import Any, overrideimport pandas as pd@@ -33,6 +33,7 @@ class CSVExtractor(BaseExtractor):self.source_column = source_columnself.csv_args = csv_args or {}+ @overridedef extract(self) -> list[Document]:"""Load data into document objects."""docs = []diff --git a/api/core/rag/extractor/excel_extractor.py b/api/core/rag/extractor/excel_extractor.pyindex 875bfd1439e..6aa379e501b 100644--- a/api/core/rag/extractor/excel_extractor.py+++ b/api/core/rag/extractor/excel_extractor.py@@ -1,7 +1,7 @@"""Abstract interface for document loader implementations."""import os-from typing import TypedDict+from typing import TypedDict, overrideimport pandas as pdfrom openpyxl import load_workbook@@ -30,6 +30,7 @@ class ExcelExtractor(BaseExtractor):self._encoding = encodingself._autodetect_encoding = autodetect_encoding+ @overridedef extract(self) -> list[Document]:"""Load from Excel file in xls or xlsx format using Pandas and openpyxl."""documents = []diff --git a/api/core/rag/extractor/firecrawl/firecrawl_web_extractor.py b/api/core/rag/extractor/firecrawl/firecrawl_web_extractor.pyindex 38a2ffc4aad..740527a32d7 100644--- a/api/core/rag/extractor/firecrawl/firecrawl_web_extractor.py+++ b/api/core/rag/extractor/firecrawl/firecrawl_web_extractor.py@@ -1,3 +1,5 @@+from typing import override+from core.rag.extractor.extractor_base import BaseExtractorfrom core.rag.models.document import Documentfrom services.website_service import WebsiteService@@ -30,6 +32,7 @@ class FirecrawlWebExtractor(BaseExtractor):self.mode = modeself.only_main_content = only_main_content+ @overridedef extract(self) -> list[Document]:"""Extract content from the URL."""documents = []diff --git a/api/core/rag/extractor/html_extractor.py b/api/core/rag/extractor/html_extractor.pyindex 9ff1dfa1bd4..858bfb18f30 100644--- a/api/core/rag/extractor/html_extractor.py+++ b/api/core/rag/extractor/html_extractor.py@@ -1,5 +1,7 @@"""Abstract interface for document loader implementations."""+from typing import override+from bs4 import BeautifulSoupfrom core.rag.extractor.extractor_base import BaseExtractor@@ -19,6 +21,7 @@ class HtmlExtractor(BaseExtractor):"""Initialize with file path."""self._file_path = file_path+ @overridedef extract(self) -> list[Document]:return [Document(page_content=self._load_as_text())]diff --git a/api/core/rag/extractor/jina_reader_extractor.py b/api/core/rag/extractor/jina_reader_extractor.pyindex 67e9a3c60ab..b184e8fac65 100644--- a/api/core/rag/extractor/jina_reader_extractor.py+++ b/api/core/rag/extractor/jina_reader_extractor.py@@ -1,3 +1,5 @@+from typing import override+from core.rag.extractor.extractor_base import BaseExtractorfrom core.rag.models.document import Documentfrom services.website_service import WebsiteService@@ -23,6 +25,7 @@ class JinaReaderWebExtractor(BaseExtractor):self.mode = modeself.only_main_content = only_main_content+ @overridedef extract(self) -> list[Document]:"""Extract content from the URL."""documents = []diff --git a/api/core/rag/extractor/markdown_extractor.py b/api/core/rag/extractor/markdown_extractor.pyindex 79d6ae2dac3..662da9db27f 100644--- a/api/core/rag/extractor/markdown_extractor.py+++ b/api/core/rag/extractor/markdown_extractor.py@@ -2,6 +2,7 @@import refrom pathlib import Path+from typing import overridefrom core.rag.extractor.extractor_base import BaseExtractorfrom core.rag.extractor.helpers import detect_file_encodings@@ -31,6 +32,7 @@ class MarkdownExtractor(BaseExtractor):self._encoding = encodingself._autodetect_encoding = autodetect_encoding+ @overridedef extract(self) -> list[Document]:"""Load from file path."""tups = self.parse_tups(self._file_path)diff --git a/api/core/rag/extractor/notion_extractor.py b/api/core/rag/extractor/notion_extractor.pyindex aa361607110..568ccb1912a 100644--- a/api/core/rag/extractor/notion_extractor.py+++ b/api/core/rag/extractor/notion_extractor.py@@ -1,7 +1,7 @@import jsonimport loggingimport operator-from typing import Any, cast+from typing import Any, cast, overrideimport httpxfrom sqlalchemy import update@@ -67,6 +67,7 @@ class NotionExtractor(BaseExtractor):self._notion_access_token = integration_token+ @overridedef extract(self) -> list[Document]:self.update_last_edited_time(self._document_model)diff --git a/api/core/rag/extractor/pdf_extractor.py b/api/core/rag/extractor/pdf_extractor.pyindex 25f6fe3e2a4..a79854a7353 100644--- a/api/core/rag/extractor/pdf_extractor.py+++ b/api/core/rag/extractor/pdf_extractor.py@@ -5,6 +5,7 @@ import ioimport loggingimport uuidfrom collections.abc import Iterator+from typing import overrideimport pypdfium2import pypdfium2.raw as pdfium_c@@ -55,6 +56,7 @@ class PdfExtractor(BaseExtractor):self._user_id = user_idself._file_cache_key = file_cache_key+ @overridedef extract(self) -> list[Document]:plaintext_file_exists = Falseif self._file_cache_key:diff --git a/api/core/rag/extractor/text_extractor.py b/api/core/rag/extractor/text_extractor.pyindex 93f301ceff6..b6fcd29c9d9 100644--- a/api/core/rag/extractor/text_extractor.py+++ b/api/core/rag/extractor/text_extractor.py@@ -1,6 +1,7 @@"""Abstract interface for document loader implementations."""from pathlib import Path+from typing import overridefrom core.rag.extractor.extractor_base import BaseExtractorfrom core.rag.extractor.helpers import detect_file_encodings@@ -21,6 +22,7 @@ class TextExtractor(BaseExtractor):self._encoding = encodingself._autodetect_encoding = autodetect_encoding+ @overridedef extract(self) -> list[Document]:"""Load from file path."""text = ""diff --git a/api/core/rag/extractor/unstructured/unstructured_doc_extractor.py b/api/core/rag/extractor/unstructured/unstructured_doc_extractor.pyindex da370f70e77..dec0065e563 100644--- a/api/core/rag/extractor/unstructured/unstructured_doc_extractor.py+++ b/api/core/rag/extractor/unstructured/unstructured_doc_extractor.py@@ -1,5 +1,6 @@import loggingimport os+from typing import overridefrom configs import dify_configfrom core.rag.extractor.extractor_base import BaseExtractor@@ -17,6 +18,7 @@ class UnstructuredWordExtractor(BaseExtractor):self._api_url = api_urlself._api_key = api_key+ @overridedef extract(self) -> list[Document]:from unstructured.__version__ import __version__ as __unstructured_version__from unstructured.file_utils.filetype import (diff --git a/api/core/rag/extractor/unstructured/unstructured_eml_extractor.py b/api/core/rag/extractor/unstructured/unstructured_eml_extractor.pyindex d97d4c3a487..1b87298587e 100644--- a/api/core/rag/extractor/unstructured/unstructured_eml_extractor.py+++ b/api/core/rag/extractor/unstructured/unstructured_eml_extractor.py@@ -1,6 +1,7 @@import base64import contextlibimport logging+from typing import overridefrom bs4 import BeautifulSoup@@ -23,6 +24,7 @@ class UnstructuredEmailExtractor(BaseExtractor):self._api_url = api_urlself._api_key = api_key+ @overridedef extract(self) -> list[Document]:if self._api_url:from unstructured.partition.api import partition_via_apidiff --git a/api/core/rag/extractor/unstructured/unstructured_epub_extractor.py b/api/core/rag/extractor/unstructured/unstructured_epub_extractor.pyindex 3061d957ac3..74c2c366892 100644--- a/api/core/rag/extractor/unstructured/unstructured_epub_extractor.py+++ b/api/core/rag/extractor/unstructured/unstructured_epub_extractor.py@@ -1,4 +1,5 @@import logging+from typing import overrideimport pypandoc # type: ignore@@ -28,6 +29,7 @@ class UnstructuredEpubExtractor(BaseExtractor):self._api_url = api_urlself._api_key = api_key+ @overridedef extract(self) -> list[Document]:if self._api_url:from unstructured.partition.api import partition_via_apidiff --git a/api/core/rag/extractor/unstructured/unstructured_markdown_extractor.py b/api/core/rag/extractor/unstructured/unstructured_markdown_extractor.pyindex b6d8c471118..f71afbbae4b 100644--- a/api/core/rag/extractor/unstructured/unstructured_markdown_extractor.py+++ b/api/core/rag/extractor/unstructured/unstructured_markdown_extractor.py@@ -1,4 +1,5 @@import logging+from typing import overridefrom configs import dify_configfrom core.rag.extractor.extractor_base import BaseExtractor@@ -22,6 +23,7 @@ class UnstructuredMarkdownExtractor(BaseExtractor):self._api_url = api_urlself._api_key = api_key+ @overridedef extract(self) -> list[Document]:if self._api_url:from unstructured.partition.api import partition_via_apidiff --git a/api/core/rag/extractor/unstructured/unstructured_msg_extractor.py b/api/core/rag/extractor/unstructured/unstructured_msg_extractor.pyindex ae60fc79816..b73c383ef26 100644--- a/api/core/rag/extractor/unstructured/unstructured_msg_extractor.py+++ b/api/core/rag/extractor/unstructured/unstructured_msg_extractor.py@@ -1,4 +1,5 @@import logging+from typing import overridefrom configs import dify_configfrom core.rag.extractor.extractor_base import BaseExtractor@@ -21,6 +22,7 @@ class UnstructuredMsgExtractor(BaseExtractor):self._api_url = api_urlself._api_key = api_key+ @overridedef extract(self) -> list[Document]:if self._api_url:from unstructured.partition.api import partition_via_apidiff --git a/api/core/rag/extractor/unstructured/unstructured_ppt_extractor.py b/api/core/rag/extractor/unstructured/unstructured_ppt_extractor.pyindex c12a55ee4b0..bb4bf8f9ba8 100644--- a/api/core/rag/extractor/unstructured/unstructured_ppt_extractor.py+++ b/api/core/rag/extractor/unstructured/unstructured_ppt_extractor.py@@ -1,4 +1,5 @@import logging+from typing import overridefrom core.rag.extractor.extractor_base import BaseExtractorfrom core.rag.models.document import Document@@ -20,6 +21,7 @@ class UnstructuredPPTExtractor(BaseExtractor):self._api_url = api_urlself._api_key = api_key+ @overridedef extract(self) -> list[Document]:if self._api_url:from unstructured.partition.api import partition_via_apidiff --git a/api/core/rag/extractor/unstructured/unstructured_pptx_extractor.py b/api/core/rag/extractor/unstructured/unstructured_pptx_extractor.pyindex 99e3eec5012..9de2056e631 100644--- a/api/core/rag/extractor/unstructured/unstructured_pptx_extractor.py+++ b/api/core/rag/extractor/unstructured/unstructured_pptx_extractor.py@@ -1,4 +1,5 @@import logging+from typing import overridefrom core.rag.extractor.extractor_base import BaseExtractorfrom core.rag.models.document import Document@@ -20,6 +21,7 @@ class UnstructuredPPTXExtractor(BaseExtractor):self._api_url = api_urlself._api_key = api_key+ @overridedef extract(self) -> list[Document]:if self._api_url:from unstructured.partition.api import partition_via_apidiff --git a/api/core/rag/extractor/unstructured/unstructured_xml_extractor.py b/api/core/rag/extractor/unstructured/unstructured_xml_extractor.pyindex 2d4846d85e3..2f926628777 100644--- a/api/core/rag/extractor/unstructured/unstructured_xml_extractor.py+++ b/api/core/rag/extractor/unstructured/unstructured_xml_extractor.py@@ -1,4 +1,5 @@import logging+from typing import overridefrom configs import dify_configfrom core.rag.extractor.extractor_base import BaseExtractor@@ -21,6 +22,7 @@ class UnstructuredXmlExtractor(BaseExtractor):self._api_url = api_urlself._api_key = api_key+ @overridedef extract(self) -> list[Document]:if self._api_url:from unstructured.partition.api import partition_via_apidiff --git a/api/core/rag/extractor/watercrawl/exceptions.py b/api/core/rag/extractor/watercrawl/exceptions.pyindex e407a594e00..fc457697a22 100644--- a/api/core/rag/extractor/watercrawl/exceptions.py+++ b/api/core/rag/extractor/watercrawl/exceptions.py@@ -1,4 +1,5 @@import json+from typing import overrideclass WaterCrawlError(Exception):@@ -18,15 +19,18 @@ class WaterCrawlBadRequestError(WaterCrawlError):def flat_errors(self):return json.dumps(self.errors)+ @overridedef __str__(self):return f"WaterCrawlBadRequestError: {self.message} \n {self.flat_errors}"class WaterCrawlPermissionError(WaterCrawlBadRequestError):+ @overridedef __str__(self):return f"You are exceeding your WaterCrawl API limits. {self.message}"class WaterCrawlAuthenticationError(WaterCrawlBadRequestError):+ @overridedef __str__(self):return "WaterCrawl API key is invalid or expired. Please check your API key and try again."diff --git a/api/core/rag/extractor/watercrawl/extractor.py b/api/core/rag/extractor/watercrawl/extractor.pyindex 51a432d879a..fdfe75b6770 100644--- a/api/core/rag/extractor/watercrawl/extractor.py+++ b/api/core/rag/extractor/watercrawl/extractor.py@@ -1,3 +1,5 @@+from typing import override+from core.rag.extractor.extractor_base import BaseExtractorfrom core.rag.models.document import Documentfrom services.website_service import WebsiteService@@ -31,6 +33,7 @@ class WaterCrawlWebExtractor(BaseExtractor):self.mode = modeself.only_main_content = only_main_content+ @overridedef extract(self) -> list[Document]:"""Extract content from the URL."""documents = []diff --git a/api/core/rag/extractor/word_extractor.py b/api/core/rag/extractor/word_extractor.pyindex ee89ee3724a..db38990c146 100644--- a/api/core/rag/extractor/word_extractor.py+++ b/api/core/rag/extractor/word_extractor.py@@ -10,6 +10,7 @@ import osimport reimport tempfileimport uuid+from typing import overridefrom urllib.parse import urlparsefrom docx import Document as DocxDocument@@ -91,6 +92,7 @@ class WordExtractor(BaseExtractor):def __del__(self):self.close()+ @overridedef extract(self) -> list[Document]:"""Load given path as single page."""content = self.parse_docx(self.file_path)