SemanticRetrieverComponents class

Components used to initialize the SemanticRetriever.

Signature:

export declare class SemanticRetrieverComponents 

Methods

Method Modifiers Description
addProvider(provider) Adds an embedding provider to the SemanticRetriever.
providers() Returns the registered embedding providers for the SemanticRetriever. A list of registered embedding providers.
setTextChunker(textChunker) Sets the text chunker for the SemanticRetriever.
setVectorStore(vectorStore) Sets the vector store for the SemanticRetriever.
textChunker() Returns the text chunker for the SemanticRetriever. The text chunker for the SemanticRetriever.
vectorStore() Returns the vector store for the SemanticRetriever. The vector store for the SemanticRetriever.

SemanticRetrieverComponents.addProvider()

Adds an embedding provider to the SemanticRetriever.

Signature:

addProvider(provider: EmbeddingProvider): this;

Parameters

Parameter Type Description
provider EmbeddingProvider The embedding provider to add. The SemanticRetrieverComponents instance for chaining.

Returns:

this

SemanticRetrieverComponents.providers()

Returns the registered embedding providers for the SemanticRetriever.

A list of registered embedding providers.

Signature:

providers(): readonly EmbeddingProvider[];

Returns:

readonly EmbeddingProvider[]

SemanticRetrieverComponents.setTextChunker()

Sets the text chunker for the SemanticRetriever.

Signature:

setTextChunker(textChunker: TextChunker): this;

Parameters

Parameter Type Description
textChunker TextChunker The text chunker to set. The SemanticRetrieverComponents instance for chaining.

Returns:

this

SemanticRetrieverComponents.setVectorStore()

Sets the vector store for the SemanticRetriever.

Signature:

setVectorStore(vectorStore: VectorStore): this;

Parameters

Parameter Type Description
vectorStore VectorStore The vector store to set. The SemanticRetrieverComponents instance for chaining.

Returns:

this

SemanticRetrieverComponents.textChunker()

Returns the text chunker for the SemanticRetriever.

The text chunker for the SemanticRetriever.

Signature:

textChunker(): TextChunker | undefined;

Returns:

TextChunker | undefined

SemanticRetrieverComponents.vectorStore()

Returns the vector store for the SemanticRetriever.

The vector store for the SemanticRetriever.

Signature:

vectorStore(): VectorStore | undefined;

Returns:

VectorStore | undefined