This commit is contained in:
Bagatur 2023-08-11 13:58:23 -07:00 committed by GitHub
parent edb585228d
commit e21152358a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
"""Loader that uses unstructured to load files.""" """Loader that uses unstructured to load files."""
import collections import collections
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import IO, Any, Callable, Dict, List, Sequence, Union from typing import IO, Any, Callable, Dict, List, Optional, Sequence, Union
from langchain.docstore.document import Document from langchain.docstore.document import Document
from langchain.document_loaders.base import BaseLoader from langchain.document_loaders.base import BaseLoader
@ -39,7 +39,7 @@ class UnstructuredBaseLoader(BaseLoader, ABC):
def __init__( def __init__(
self, self,
mode: str = "single", mode: str = "single",
post_processors: List[Callable] = [], post_processors: Optional[List[Callable]] = None,
**unstructured_kwargs: Any, **unstructured_kwargs: Any,
): ):
"""Initialize with file path.""" """Initialize with file path."""
@ -62,7 +62,7 @@ class UnstructuredBaseLoader(BaseLoader, ABC):
unstructured_kwargs.pop("strategy") unstructured_kwargs.pop("strategy")
self.unstructured_kwargs = unstructured_kwargs self.unstructured_kwargs = unstructured_kwargs
self.post_processors = post_processors self.post_processors = post_processors or []
@abstractmethod @abstractmethod
def _get_elements(self) -> List: def _get_elements(self) -> List: