mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-06 13:33:37 +00:00
community: add init for unstructured file loader (#29101)
## Description Add `__init__` for unstructured loader of epub/image/markdown/pdf/ppt/word to restrict the input type to `str` or `Path`. In the [signature](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.markdown.UnstructuredMarkdownLoader.html) these unstructured loaders receive `file_path: str | List[str] | Path | List[Path]`, but actually they only receive `str` or `Path`. ## Issue None ## Dependencies No changes.
This commit is contained in:
@@ -42,6 +42,7 @@ class UnstructuredExcelLoader(UnstructuredFileLoader):
|
||||
for more info. Optional. Defaults to "single".
|
||||
**unstructured_kwargs: Keyword arguments to pass to unstructured.
|
||||
"""
|
||||
file_path = str(file_path)
|
||||
validate_unstructured_version(min_unstructured_version="0.6.7")
|
||||
super().__init__(file_path=file_path, mode=mode, **unstructured_kwargs)
|
||||
|
||||
|
Reference in New Issue
Block a user