Are you an LLM? You can read better optimized documentation at /api/@nhtio/adk/batteries/embeddings/openai/helpers/functions/applyEmbeddingPrefix.md for this page in Markdown format
Function: applyEmbeddingPrefix()
ts
function applyEmbeddingPrefix(
texts: readonly string[],
kind: EmbeddingKind,
options: Pick<BaseEmbeddingsAdapterOptions, "queryPrefix" | "documentPrefix">,
): string[];Defined in: batteries/embeddings/openai/helpers.ts:27
Applies the configured query/document instruction prefix to a batch of inputs.
Parameters
| Parameter | Type | Description |
|---|---|---|
texts | readonly string[] | The raw inputs to embed. |
kind | EmbeddingKind | Whether these are queries or documents. |
options | Pick<BaseEmbeddingsAdapterOptions, "queryPrefix" | "documentPrefix"> | Carries queryPrefix / documentPrefix. |
Returns
string[]
A new array with prefixes applied (never mutates the input).
Remarks
kind: 'query' → prepend queryPrefix (if set); kind: 'document' → prepend documentPrefix (if set). When the relevant prefix is unset, inputs pass through verbatim. This is the single source of truth for prefix handling shared by both batteries.