Skip to content

EmbedOptions

Defined in: embed.ts:14

T extends Record<string, unknown>

field: keyof T | keyof T[] | ((record) => string)

Defined in: embed.ts:24

Source text to embed, derived from the just-written record (ctx.result): a single field name, a list of field names (joined with "\n"), or a function for full control (e.g. combining fields with custom formatting, or pulling in related data).


optional onError?: (error, record, ctx) => void

Defined in: embed.ts:31

Called when extracting the text, calling the provider, or upserting the vector throws. The primary write is never rolled back or blocked regardless — see the “Cross-adapter write consistency” pattern in the root README. Defaults to logging via app.get<Logger>("logger") when configured, otherwise silent.

unknown

T

HookContext<T>

void


provider: EmbeddingProvider

Defined in: embed.ts:18

The embedding provider called with the extracted source text.


vectors: VectorRepository<T>

Defined in: embed.ts:16

The vector adapter to upsert the computed embedding into.