effect-io-ai

Package: @effect/ai
Module: EmbeddingModel

EmbeddingModel.make

Creates an EmbeddingModel service with batching and caching capabilities.

This is the primary constructor for creating embedding services. It supports automatic batching of requests for efficiency and optional caching to reduce redundant API calls.

Signature

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

Source

Since v1.0.0