Skip to main content Link Search Menu Expand Document (external link)

Embeddings.ts overview

Since v1.0.0


Exports Grouped by Category


constructors

make

Signature

declare const make: (options: {
  readonly embedMany: (input: ReadonlyArray<string>) => Effect.Effect<Array<Embeddings.Result>, AiError>
  readonly maxBatchSize?: number
  readonly cache?: { readonly capacity: number; readonly timeToLive: Duration.DurationInput }
}) => any

Source

Since v1.0.0

makeDataLoader

Creates an Embeddings service which will aggregate all embed requests received during the specified window (up to a maximum of maxBatchSize requests, if specified) and execute them as a single batch.

Signature

declare const makeDataLoader: (options: {
  readonly embedMany: (input: ReadonlyArray<string>) => Effect.Effect<Array<Embeddings.Result>, AiError>
  readonly window: Duration.DurationInput
  readonly maxBatchSize?: number
}) => any

Source

Since v1.0.0

models

Embeddings (namespace)

Source

Since v1.0.0

Service (interface)

Signature

export interface Service {
  readonly embed: (input: string) => Effect.Effect<Array<number>, AiError>
}

Source

Since v1.0.0

Result (interface)

Signature

export interface Result {
  readonly index: number
  readonly embeddings: Array<number>
}

Source

Since v1.0.0

tags

Embeddings (class)

Signature

declare class Embeddings

Source

Since v1.0.0