Skip to content
1 min read · 89 words

Type Alias: EmbeddingKind ​

ts
type EmbeddingKind = "query" | "document";

Defined in: src/batteries/embeddings/openai/types.ts:26

Whether a piece of text is being embedded as a search query or as a corpus document.

Remarks ​

Asymmetric-embedding models (e.g. Snowflake Arctic Embed) expect a short instruction prefix on queries but not on documents. The battery prepends BaseEmbeddingsAdapterOptions.queryPrefix when kind === 'query' and BaseEmbeddingsAdapterOptions.documentPrefix when kind === 'document' — each only if the corresponding prefix option is set. Defaults to 'document', so the neutral (un-prefixed, unless a document prefix is configured) path is taken when a caller does not specify.