DocumentLoaders

org.llm4s.rag.loader.DocumentLoaders

Factory and combinators for DocumentLoaders.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def combine(loaders: Seq[DocumentLoader]): DocumentLoader

Combine multiple loaders into one.

Combine multiple loaders into one.

Documents are loaded in sequence from each loader.

Attributes

Create a loader that loads documents lazily.

Create a loader that loads documents lazily.

Attributes

def drop(loader: DocumentLoader, n: Int): DocumentLoader

Create a loader that skips the first n documents.

Create a loader that skips the first n documents.

Attributes

def filter(loader: DocumentLoader)(predicate: Document => Boolean): DocumentLoader

Create a loader that filters documents.

Create a loader that filters documents.

Attributes

Create a loader from a sequence of documents.

Create a loader from a sequence of documents.

Attributes

def fromIterator(iter: => Iterator[Document], desc: String): DocumentLoader

Create a loader from a function that produces documents.

Create a loader from a function that produces documents.

Attributes

Create a loader that applies a transformation to documents.

Create a loader that applies a transformation to documents.

Attributes

Create a loader that filters out per-document failures and skips.

Create a loader that filters out per-document failures and skips.

A LoadResult.ListingFailure is kept: it says the set of documents is unknown, not that one document failed, and RAG.sync relies on seeing it - without it a failed listing looks like an empty source, and sync would delete everything it indexed from there.

Per-document LoadResult.Failures are dropped, and with them what RAG.sync needs to keep a document whose read failed: syncing through this combinator deletes such a document as if it were gone from the source. Sync the unwrapped loader to keep it.

Attributes

def take(loader: DocumentLoader, n: Int): DocumentLoader

Create a loader that limits the number of documents.

Create a loader that limits the number of documents.

Attributes

Create a loader that adds hints to all documents.

Create a loader that adds hints to all documents.

Attributes

def withMetadata(loader: DocumentLoader, metadata: Map[String, String]): DocumentLoader

Create a loader that adds metadata to all documents.

Create a loader that adds metadata to all documents.

Attributes

Concrete fields

Create an empty loader.

Create an empty loader.

Attributes