VectorStoreRetriever<V extends VectorStore> class

A retriever that uses a vector store to retrieve documents.

Inheritance

Constructors

VectorStoreRetriever({required V vectorStore, VectorStoreRetrieverOptions defaultOptions = const VectorStoreRetrieverOptions()})
A retriever that uses a vector store to retrieve documents.
const

Properties

defaultOptions VectorStoreRetrieverOptions
The default options to use when invoking the Runnable.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vectorStore → V
The vector store to retrieve documents from.
final

Methods

batch(List<String> inputs, {List<VectorStoreRetrieverOptions>? options}) Future<List<List<Document>>>
Batches the invocation of the Runnable on the given inputs.
inherited
bind(VectorStoreRetrieverOptions options) RunnableBinding<String, VectorStoreRetrieverOptions, 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) VectorStoreRetrieverOptions?
Returns the given options if they are compatible with the Runnable, otherwise returns null.
inherited
getRelevantDocuments(String query, {VectorStoreRetrieverOptions? options}) Future<List<Document>>
Get the most relevant documents for a given query.
override
invoke(String input, {VectorStoreRetrieverOptions? 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<Document>, NewCallOptions, NewRunOutput> next) RunnableSequence<String, NewRunOutput>
Pipes the output of this Runnable into another Runnable using a RunnableSequence.
inherited
stream(String input, {VectorStoreRetrieverOptions? options}) Stream<List<Document>>
Streams the output of invoking the Runnable on the given input.
inherited
streamFromInputStream(Stream<String> inputStream, {VectorStoreRetrieverOptions? 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<String, RunnableOptions, List<Document>>> fallbacks) RunnableWithFallback<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