EmbeddingProvider
@forge/monorepo / backend/src / EmbeddingProvider
Interface: EmbeddingProvider
Defined in: backend/src/knowledge/index.ts:49
Turns text into vectors.
A port, because the provider differs and because a test needs a deterministic one. model is on the provider
rather than passed per call: a provider that could be asked for a different model per call would let two
chunks of one document be embedded differently, and nothing downstream could tell.
Properties
model
readonlymodel:EmbeddingModelRef
Defined in: backend/src/knowledge/index.ts:50
Methods
embed()
embed(
texts):Promise<readonly readonlynumber[][]>
Defined in: backend/src/knowledge/index.ts:52
One vector per input, in order. A provider returning a different count is a bug worth catching loudly.
Parameters
texts
readonly string[]
Returns
Promise<readonly readonly number[][]>