mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-01 00:49:25 +00:00
community[patch]: refactor the type hint of file_path
in UnstructuredAPIFileLoader
class (#18839)
* **Description**: add `None` type for `file_path` along with `str` and `List[str]` types. * `file_path`/`filename` arguments in `get_elements_from_api()` and `partition()` can be `None`, however, there's no `None` type hint for `file_path` in `UnstructuredAPIFileLoader` and `UnstructuredFileLoader` currently. * calling the function with `file_path=None` is no problem, but my IDE annoys me lol. * **Issue**: N/A * **Dependencies**: N/A Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
This commit is contained in:
parent
cf96060ab7
commit
9b70131aed
@ -156,7 +156,7 @@ class UnstructuredFileLoader(UnstructuredBaseLoader):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
file_path: Union[str, List[str], Path, List[Path]],
|
||||
file_path: Union[str, List[str], Path, List[Path], None],
|
||||
mode: str = "single",
|
||||
**unstructured_kwargs: Any,
|
||||
):
|
||||
@ -255,7 +255,7 @@ class UnstructuredAPIFileLoader(UnstructuredFileLoader):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
file_path: Union[str, List[str]] = "",
|
||||
file_path: Union[str, List[str], None] = "",
|
||||
mode: str = "single",
|
||||
url: str = "https://api.unstructured.io/general/v0/general",
|
||||
api_key: str = "",
|
||||
|
Loading…
Reference in New Issue
Block a user