Converts the vector store into a retriever, making it suitable for use in retrieval-based workflows and allowing additional configuration.
asRetriever(
kOrFields: number | Partial<VectorStoreRetrieverInput<VectorStoreInterface>>,
filter: string | object,
callbacks: Callbacks,
tags: string[],
metadata: Record<string, unknown>,
verbose: boolean
): VectorStoreRetriever<VectorStoreInterface>| Name | Type | Description |
|---|---|---|
kOrFields | number | Partial<VectorStoreRetrieverInput<VectorStoreInterface>> | Optional parameter for specifying either the number of documents to retrieve or partial retriever configurations. |
filter | string | object | Optional filter based on |
callbacks | Callbacks | Optional callbacks for tracking retrieval events or progress. |
tags | string[] | General-purpose tags to add contextual information to the retriever. |
metadata | Record<string, unknown> | General-purpose metadata providing additional context for retrieval. |
verbose | boolean | If |