TextDocumentLoader class final

Loads documents that are already in hand as text.

The loader most applications need: you read the file, this makes it a document.

final loader = TextDocumentLoader(<TextSource>[
  TextSource(id: 'faq.txt', text: await File('faq.txt').readAsString()),
]);
Implemented types

Constructors

TextDocumentLoader(List<TextSource> sources)
Creates a loader over sources.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
A short name, used in events and traces.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sources List<TextSource>
The texts to load.
final

Methods

load({AgenticContext? context}) Future<List<RagDocument>>
Produces documents from whatever this loader was constructed with.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited