Creates a VectorStoreRetriever instance with flexible configuration options.
asRetriever(
kOrFields: number | Partial<VectorStoreRetrieverInput<FakeVectorStore>>,
filter: (doc: Document) => boolean, callbacks: Callbacks, tags: string[], metadata: Record<string,
unknown>, verbose: boolean
): VectorStoreRetriever<FakeVectorStore>| Name | Type | Description |
|---|---|---|
kOrFields | number | Partial<VectorStoreRetrieverInput<FakeVectorStore>> | If a number is provided, it sets the
|
filter | (doc: Document) => boolean | Optional filter criteria to limit the items retrieved based on the specified filter type. |
callbacks | Callbacks | Optional callbacks that may be triggered at specific stages of the retrieval process. |
tags | string[] | Tags to categorize or label the |
metadata | Record<string, unknown> | Additional metadata as key-value pairs to add contextual information for the retrieval process. |
verbose | boolean | If |
Basic usage with a `k` value:
const retriever = myVectorStore.asRetriever(5);