TextLoader

org.llm4s.rag.loader.TextLoader
See theTextLoader companion object
final case class TextLoader(documents: Seq[Document]) extends DocumentLoader

Load documents from raw text content.

Useful for:

  • Programmatically created content
  • Database records
  • API responses
  • Testing

Value parameters

documents

Documents to load

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def description: String

Human-readable description of this loader.

Human-readable description of this loader.

Used for logging and debugging.

Attributes

override def estimatedCount: Option[Int]

Estimated number of documents (if known).

Estimated number of documents (if known).

Used for progress reporting and resource allocation. Returns None if count is unknown or expensive to compute.

Attributes

Definition Classes
def load(): Iterator[LoadResult]

Load documents from this source.

Load documents from this source.

Returns an iterator of LoadResult for streaming large document sets. Each result is either a successfully loaded document or a loading error. This allows processing to continue even when some documents fail.

Attributes

Returns

Iterator of load results (successes and failures)

Add a document

Add a document

Attributes

def withDocument(id: String, content: String): TextLoader

Add a document from content and ID

Add a document from content and ID

Attributes

def withMetadata(metadata: Map[String, String]): TextLoader

Add metadata to all documents

Add metadata to all documents

Attributes

Inherited methods

Combine this loader with another.

Combine this loader with another.

Creates a composite loader that loads from both sources.

Attributes

Inherited from:
DocumentLoader
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product