FakeRetriever class
A retriever that returns a fixed list of documents. This class is meant for testing purposes only.
- Inheritance
-
- Object
- Runnable<
String, RetrieverOptions, List< Document> > - Retriever<
RetrieverOptions> - FakeRetriever
Constructors
-
FakeRetriever(List<
Document> docs) -
A retriever that returns a fixed list of documents.
This class is meant for testing purposes only.
const
Properties
- defaultOptions → RetrieverOptions
-
The default options to use when invoking the Runnable.
finalinherited
-
docs
→ List<
Document> -
The documents to return.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
batch(
List< String> inputs, {List<RetrieverOptions> ? options}) → Future<List< List< >Document> > -
Batches the invocation of the Runnable on the given
inputs
.inherited -
bind(
RetrieverOptions options) → RunnableBinding< String, RetrieverOptions, List< Document> > -
Binds the Runnable to the given
options
.inherited -
close(
) → void -
Cleans up any resources associated with it the Runnable.
inherited
-
getCompatibleOptions(
RunnableOptions? options) → RetrieverOptions? -
Returns the given
options
if they are compatible with the Runnable, otherwise returnsnull
.inherited -
getRelevantDocuments(
String query, {RetrieverOptions? options}) → Future< List< Document> > -
Get the most relevant documents for a given query.
override
-
invoke(
String input, {RetrieverOptions? options}) → Future< List< Document> > -
Get the most relevant documents for a given query.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pipe<
NewRunOutput extends Object?, NewCallOptions extends RunnableOptions> (Runnable< List< next) → RunnableSequence<Document> , NewCallOptions, NewRunOutput>String, NewRunOutput> -
Pipes the output of this Runnable into another Runnable using a
RunnableSequence.
inherited
-
stream(
String input, {RetrieverOptions? options}) → Stream< List< Document> > -
Streams the output of invoking the Runnable on the given
input
.inherited -
streamFromInputStream(
Stream< String> inputStream, {RetrieverOptions? options}) → Stream<List< Document> > -
Streams the most relevant documents for the query resulting from
reducing the input stream.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withFallbacks(
List< Runnable< fallbacks) → RunnableWithFallback<String, RunnableOptions, List< >Document> >String, List< Document> > -
Adds fallback runnables to be invoked if the primary runnable fails.
inherited
-
withRetry(
{int maxRetries = 3, FutureOr< bool> retryIf(Object e)?, List<Duration?> ? delayDurations, bool addJitter = false}) → RunnableRetry<String, List< Document> > -
Adds retry logic to an existing runnable.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited