EmbedOptions
Defined in: embed.ts:14
Type Parameters
Section titled “Type Parameters”T extends Record<string, unknown>
Properties
Section titled “Properties”field: keyof
T| keyofT[] | ((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).
onError?
Section titled “onError?”
optionalonError?: (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.
Parameters
Section titled “Parameters”unknown
record
Section titled “record”T
HookContext<T>
Returns
Section titled “Returns”void
provider
Section titled “provider”provider:
EmbeddingProvider
Defined in: embed.ts:18
The embedding provider called with the extracted source text.
vectors
Section titled “vectors”vectors:
VectorRepository<T>
Defined in: embed.ts:16
The vector adapter to upsert the computed embedding into.