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
Name | Type |
---|---|
text | string |
Returns
Promise
<number
[]>
Defined in
ai-jsx/src/batteries/docs.tsx:318
embedBatch
▸ embedBatch(chunks
): Promise
<number
[][]>
Parameters
Name | Type |
---|---|
chunks | string [] |
Returns
Promise
<number
[][]>