PebbloTextLoader#
- class langchain_community.document_loaders.pebblo.PebbloTextLoader(texts: Iterable[str], *, source: str | None = None, ids: List[str] | None = None, metadata: Dict[str, Any] | None = None, metadatas: List[Dict[str, Any]] | None = None)[source]#
Loader for text data.
Since PebbloSafeLoader is a wrapper around document loaders, this loader is used to load text data directly into Documents.
- Parameters:
texts (Iterable[str]) β Iterable of text data.
source (str | None) β Source of the text data. Optional. Defaults to None.
ids (List[str] | None) β List of unique identifiers for each text. Optional. Defaults to None.
metadata (Dict[str, Any] | None) β Metadata for all texts. Optional. Defaults to None.
metadatas (List[Dict[str, Any]] | None) β List of metadata for each text. Optional. Defaults to None.
Methods
__init__
(texts,Β *[,Β source,Β ids,Β metadata,Β ...])A lazy loader for Documents.
aload
()Load data into Document objects.
Lazy load text data into Documents.
load
()Load text data into Documents.
load_and_split
([text_splitter])Load Documents and split into chunks.
- __init__(texts: Iterable[str], *, source: str | None = None, ids: List[str] | None = None, metadata: Dict[str, Any] | None = None, metadatas: List[Dict[str, Any]] | None = None) None [source]#
- Parameters:
texts (Iterable[str]) β Iterable of text data.
source (str | None) β Source of the text data. Optional. Defaults to None.
ids (List[str] | None) β List of unique identifiers for each text. Optional. Defaults to None.
metadata (Dict[str, Any] | None) β Metadata for all texts. Optional. Defaults to None.
metadatas (List[Dict[str, Any]] | None) β List of metadata for each text. Optional. Defaults to None.
- Return type:
None
- async alazy_load() AsyncIterator[Document] #
A lazy loader for Documents.
- Return type:
AsyncIterator[Document]
- lazy_load() Iterator[Document] [source]#
Lazy load text data into Documents.
- Returns:
Iterator of Documents
- Return type:
Iterator[Document]
- load() List[Document] [source]#
Load text data into Documents.
- Returns:
List of Documents
- Return type:
List[Document]
- load_and_split(text_splitter: TextSplitter | None = None) list[Document] #
Load Documents and split into chunks. Chunks are returned as Documents.
Do not override this method. It should be considered to be deprecated!
- Parameters:
text_splitter (Optional[TextSplitter]) β TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.
- Returns:
List of Documents.
- Return type:
list[Document]