Class: VectorIndexRetriever
VectorIndexRetriever retrieves nodes from a VectorIndex.
Implements
Constructors
constructor
• new VectorIndexRetriever(«destructured»
): VectorIndexRetriever
Parameters
Name | Type |
---|---|
«destructured» | Object |
› imageSimilarityTopK? | number |
› index | VectorStoreIndex |
› similarityTopK? | number |
Returns
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:26
Properties
imageSimilarityTopK
• imageSimilarityTopK: number
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:23
index
• index: VectorStoreIndex
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:21
serviceContext
• Private
serviceContext: ServiceContext
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:24
similarityTopK
• similarityTopK: number
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:22
Methods
buildNodeListFromQueryResult
▸ buildNodeListFromQueryResult(result
): NodeWithScore
<Metadata
>[]
Parameters
Name | Type |
---|---|
result | VectorStoreQueryResult |
Returns
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:120
buildVectorStoreQuery
▸ buildVectorStoreQuery(embedModel
, query
, similarityTopK
, preFilters?
): Promise
<VectorStoreQuery
>
Parameters
Name | Type |
---|---|
embedModel | BaseEmbedding |
query | string |
similarityTopK | number |
preFilters? | MetadataFilters |
Returns
Promise
<VectorStoreQuery
>
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:104
getServiceContext
▸ getServiceContext(): ServiceContext
Returns
Implementation of
BaseRetriever.getServiceContext
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:144
retrieve
▸ retrieve(query
, parentEvent?
, preFilters?
): Promise
<NodeWithScore
<Metadata
>[]>
Parameters
Name | Type |
---|---|
query | string |
parentEvent? | Event |
preFilters? | MetadataFilters |
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Implementation of
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:41
sendEvent
▸ sendEvent(query
, nodesWithScores
, parentEvent
): void
Parameters
Name | Type |
---|---|
query | string |
nodesWithScores | NodeWithScore <Metadata >[] |
parentEvent | undefined | Event |
Returns
void
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:87
textRetrieve
▸ textRetrieve(query
, preFilters?
): Promise
<NodeWithScore
<Metadata
>[]>
Parameters
Name | Type |
---|---|
query | string |
preFilters? | MetadataFilters |
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:54
textToImageRetrieve
▸ textToImageRetrieve(query
, preFilters?
): Promise
<NodeWithScore
<Metadata
>[]>
Parameters
Name | Type |
---|---|
query | string |
preFilters? | MetadataFilters |
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:69