mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
chore: add missing @override decorator to api/core/rag/extractor (#37013)
Co-authored-by: mac <mac@1234.local>
This commit is contained in:
1 parent
bb3c9929f9
commit
e14cb209a4
21 files changed
+48
-4
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import logging
|
||||
import os
|
||||
from typing import override
|
||||
|
||||
from configs import dify_config
|
||||
from core.rag.extractor.extractor_base import BaseExtractor
|
||||
@@ -17,6 +18,7 @@ class UnstructuredWordExtractor(BaseExtractor):
|
||||
self._api_url = api_url
|
||||
self._api_key = api_key
|
||||
|
||||
@override
|
||||
def extract(self) -> list[Document]:
|
||||
from unstructured.__version__ import __version__ as __unstructured_version__
|
||||
from unstructured.file_utils.filetype import (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import base64
|
||||
import contextlib
|
||||
import logging
|
||||
from typing import override
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
@@ -23,6 +24,7 @@ class UnstructuredEmailExtractor(BaseExtractor):
|
||||
self._api_url = api_url
|
||||
self._api_key = api_key
|
||||
|
||||
@override
|
||||
def extract(self) -> list[Document]:
|
||||
if self._api_url:
|
||||
from unstructured.partition.api import partition_via_api
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from typing import override
|
||||
|
||||
import pypandoc # type: ignore
|
||||
|
||||
@@ -28,6 +29,7 @@ class UnstructuredEpubExtractor(BaseExtractor):
|
||||
self._api_url = api_url
|
||||
self._api_key = api_key
|
||||
|
||||
@override
|
||||
def extract(self) -> list[Document]:
|
||||
if self._api_url:
|
||||
from unstructured.partition.api import partition_via_api
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from typing import override
|
||||
|
||||
from configs import dify_config
|
||||
from core.rag.extractor.extractor_base import BaseExtractor
|
||||
@@ -22,6 +23,7 @@ class UnstructuredMarkdownExtractor(BaseExtractor):
|
||||
self._api_url = api_url
|
||||
self._api_key = api_key
|
||||
|
||||
@override
|
||||
def extract(self) -> list[Document]:
|
||||
if self._api_url:
|
||||
from unstructured.partition.api import partition_via_api
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from typing import override
|
||||
|
||||
from configs import dify_config
|
||||
from core.rag.extractor.extractor_base import BaseExtractor
|
||||
@@ -21,6 +22,7 @@ class UnstructuredMsgExtractor(BaseExtractor):
|
||||
self._api_url = api_url
|
||||
self._api_key = api_key
|
||||
|
||||
@override
|
||||
def extract(self) -> list[Document]:
|
||||
if self._api_url:
|
||||
from unstructured.partition.api import partition_via_api
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from typing import override
|
||||
|
||||
from core.rag.extractor.extractor_base import BaseExtractor
|
||||
from core.rag.models.document import Document
|
||||
@@ -20,6 +21,7 @@ class UnstructuredPPTExtractor(BaseExtractor):
|
||||
self._api_url = api_url
|
||||
self._api_key = api_key
|
||||
|
||||
@override
|
||||
def extract(self) -> list[Document]:
|
||||
if self._api_url:
|
||||
from unstructured.partition.api import partition_via_api
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from typing import override
|
||||
|
||||
from core.rag.extractor.extractor_base import BaseExtractor
|
||||
from core.rag.models.document import Document
|
||||
@@ -20,6 +21,7 @@ class UnstructuredPPTXExtractor(BaseExtractor):
|
||||
self._api_url = api_url
|
||||
self._api_key = api_key
|
||||
|
||||
@override
|
||||
def extract(self) -> list[Document]:
|
||||
if self._api_url:
|
||||
from unstructured.partition.api import partition_via_api
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from typing import override
|
||||
|
||||
from configs import dify_config
|
||||
from core.rag.extractor.extractor_base import BaseExtractor
|
||||
@@ -21,6 +22,7 @@ class UnstructuredXmlExtractor(BaseExtractor):
|
||||
self._api_url = api_url
|
||||
self._api_key = api_key
|
||||
|
||||
@override
|
||||
def extract(self) -> list[Document]:
|
||||
if self._api_url:
|
||||
from unstructured.partition.api import partition_via_api
|
||||
|
||||
Reference in new issue
Block a user