Creates a VectorStoreRetriever instance with flexible configuration options.
asRetriever(
kOrFields: number | Partial<VectorStoreRetrieverInput<CloudflareVectorizeStore>>,
filter: VectorizeVectorMetadataFilter,
callbacks: Callbacks,
tags: string[],
metadata: Record<string, unknown>,
verbose: boolean
): VectorStoreRetriever<CloudflareVectorizeStore>| Name | Type | Description |
|---|---|---|
kOrFields | number | Partial<VectorStoreRetrieverInput<CloudflareVectorizeStore>> | If a number is provided, it sets the
|
filter | VectorizeVectorMetadataFilter | 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);