Skip to main content

Interface: Embedding

batteries/docs.Embedding

A function that maps strings to vectors encoding their semantic meaning. Often this is based on the same function used to transform text for an LLM's transformers, though this isn't required. Alse see https://docs.ai-jsx.com/guides/brand-new#semantic-similarity-embeddings.

Implemented by

Methods

embed

embed(text): Promise<number[]>

Parameters

NameType
textstring

Returns

Promise<number[]>

Defined in

packages/ai-jsx/src/batteries/docs.tsx:318


embedBatch

embedBatch(chunks): Promise<number[][]>

Parameters

NameType
chunksstring[]

Returns

Promise<number[][]>

Defined in

packages/ai-jsx/src/batteries/docs.tsx:319