Abstract¶
flowtask.components.LangchainLoader.loaders.abstract
¶
AbstractLoader
¶
AbstractLoader(tokenizer=None, text_splitter=None, summarizer=None, markdown_splitter=None, source_type='file', doctype='document', device=None, cuda_number=0, llm=None, **kwargs)
Bases: ABC
Abstract class for Document loaders.
load
async
¶
Load data from a source and return it as a Langchain Document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Union[str, PurePath, List[PurePath]]
|
The source of the data. |
required |
Returns:
| Type | Description |
|---|---|
List[Document]
|
List[Document]: A list of Langchain Documents. |
resolve_paths
¶
Resolve the input path into a list of file paths. Handles lists, directories, glob patterns, and single file paths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Union[str, PurePath, List[PurePath]]
|
Input path(s). |
required |
Returns:
| Type | Description |
|---|---|
List[Path]
|
List[Path]: A list of resolved file paths. |