AiSdkEmbedder
Embedder implementation backed by the Vercel AI SDK.
Supports any provider registered with the AI SDK:
- openai.embedding(‘text-embedding-3-small’)
- google.embedding(‘gemini-embedding-001’)
- cohere.embedding(‘embed-english-v3.0’)
- mistral.embedding(‘mistral-embed’)
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AiSdkEmbedder(options): AiSdkEmbedder;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”AiSdkEmbedder
Accessors
Section titled “Accessors”dimension
Section titled “dimension”Get Signature
Section titled “Get Signature”get dimension(): number | undefined;The dimensionality of the embedding vectors produced by this embedder. May be undefined if the dimension is not known until the first embed() call.
Returns
Section titled “Returns”number | undefined
The dimensionality of the embedding vectors produced by this embedder. May be undefined if the dimension is not known until the first embed() call.
Implementation of
Section titled “Implementation of”Get Signature
Section titled “Get Signature”get id(): string;Stable model identity (provider/modelId) for the ingest-manifest embedder lock.
Returns
Section titled “Returns”string
Stable identity of the underlying embedding model, e.g.
"openai.embedding/text-embedding-3-small". Used by the ingest
manifest to lock an index to the model that built it — two different
models of the same dimension produce incompatible vector spaces, so a
silent swap degrades every query without erroring.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”embed()
Section titled “embed()”embed(text): Promise<readonly number[]>;Embed a single text string into a dense vector.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<readonly number[]>
Implementation of
Section titled “Implementation of”embedMany()
Section titled “embedMany()”embedMany(texts): Promise<readonly readonly number[][]>;Embed multiple text strings into dense vectors. Implementations SHOULD batch the underlying API calls where the provider supports it, rather than calling embed() in a loop.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<readonly readonly number[][]>