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,Β ...])

alazy_load()

A lazy loader for Documents.

aload()

Load data into Document objects.

lazy_load()

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]

async aload() β†’ list[Document]#

Load data into Document objects.

Return type:

list[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]