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
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
Since v1.0.0
models
Embeddings (namespace)
Since v1.0.0
Service (interface)
Signature
export interface Service {
readonly embed: (input: string) => Effect.Effect<Array<number>, AiError>
}
Since v1.0.0
Result (interface)
Signature
export interface Result {
readonly index: number
readonly embeddings: Array<number>
}
Since v1.0.0
tags
Embeddings (class)
Signature
declare class Embeddings
Since v1.0.0