Class: VectorIndexRetriever
VectorIndexRetriever retrieves nodes from a VectorIndex.
Implements
Constructors
constructor
• new VectorIndexRetriever(«destructured»
)
Parameters
Name | Type |
---|---|
«destructured» | Object |
› imageSimilarityTopK? | number |
› index | VectorStoreIndex |
› 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
Name | Type |
---|---|
result | VectorStoreQueryResult |
Returns
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:111
buildVectorStoreQuery
▸ Protected
buildVectorStoreQuery(embedModel
, query
, similarityTopK
): Promise
<VectorStoreQuery
>
Parameters
Name | Type |
---|---|
embedModel | BaseEmbedding |
query | string |
similarityTopK | number |
Returns
Promise
<VectorStoreQuery
>
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:97
getServiceContext
▸ getServiceContext(): ServiceContext
Returns
Implementation of
BaseRetriever.getServiceContext
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:135
retrieve
▸ retrieve(query
, parentEvent?
, preFilters?
): Promise
<NodeWithScore
<Metadata
>[]>
Parameters
Name | Type |
---|---|
query | string |
parentEvent? | Event |
preFilters? | unknown |
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Implementation of
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:40
sendEvent
▸ Protected
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:80
textRetrieve
▸ Protected
textRetrieve(query
, preFilters?
): Promise
<NodeWithScore
<Metadata
>[]>
Parameters
Name | Type |
---|---|
query | string |
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
Name | Type |
---|---|
query | string |
preFilters? | unknown |
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:66