Ana içeriğe geç

Class: VectorIndexRetriever

VectorIndexRetriever retrieves nodes from a VectorIndex.

Implements

Constructors

constructor

new VectorIndexRetriever(«destructured»)

Parameters

NameType
«destructured»Object
› imageSimilarityTopK?number
› indexVectorStoreIndex
› similarityTopK?number

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:25

Properties

imageSimilarityTopK

imageSimilarityTopK: number

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:22


index

index: VectorStoreIndex

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:20


serviceContext

Private serviceContext: ServiceContext

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:23


similarityTopK

similarityTopK: number

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:21

Methods

buildNodeListFromQueryResult

Protected buildNodeListFromQueryResult(result): NodeWithScore<Metadata>[]

Parameters

NameType
resultVectorStoreQueryResult

Returns

NodeWithScore<Metadata>[]

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:111


buildVectorStoreQuery

Protected buildVectorStoreQuery(embedModel, query, similarityTopK): Promise<VectorStoreQuery>

Parameters

NameType
embedModelBaseEmbedding
querystring
similarityTopKnumber

Returns

Promise<VectorStoreQuery>

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:97


getServiceContext

getServiceContext(): ServiceContext

Returns

ServiceContext

Implementation of

BaseRetriever.getServiceContext

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:135


retrieve

retrieve(query, parentEvent?, preFilters?): Promise<NodeWithScore<Metadata>[]>

Parameters

NameType
querystring
parentEvent?Event
preFilters?unknown

Returns

Promise<NodeWithScore<Metadata>[]>

Implementation of

BaseRetriever.retrieve

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:40


sendEvent

Protected sendEvent(query, nodesWithScores, parentEvent): void

Parameters

NameType
querystring
nodesWithScoresNodeWithScore<Metadata>[]
parentEventundefined | Event

Returns

void

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:80


textRetrieve

Protected textRetrieve(query, preFilters?): Promise<NodeWithScore<Metadata>[]>

Parameters

NameType
querystring
preFilters?unknown

Returns

Promise<NodeWithScore<Metadata>[]>

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:53


textToImageRetrieve

Private textToImageRetrieve(query, preFilters?): Promise<NodeWithScore<Metadata>[]>

Parameters

NameType
querystring
preFilters?unknown

Returns

Promise<NodeWithScore<Metadata>[]>

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:66