Skip to content

OpenAiEmbeddingModel

8 exports Added in v1.0.0 Source

Configuration

Signature

declare const withConfigOverride: {
  (config: Service): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R>;
  <A, E, R>(self: Effect<A, E, R>, config: Service): Effect<A, E, R>;
};

Constructors

Signature

declare const makeDataLoader: (
  ...args: [
    options: {
      readonly config: DataLoader;
      readonly model: any;
    },
  ]
) => Effect<any, unknown, unknown>;

Context

Config

Added in v1.0.0 Source

Signature

declare class Config extends any {
  constructor();
  static readonly getOrUndefined: Effect<Service | undefined>;
}

Layers

layerBatched

Added in v1.0.0 Source

Signature

declare function layerBatched(options: {
  readonly config?: Batched;
  readonly model: any;
}): Layer<EmbeddingModel, never, OpenAiClient>;

Signature

declare function layerDataLoader(options: {
  readonly config: DataLoader;
  readonly model: any;
}): Layer<EmbeddingModel, never, OpenAiClient>;

Models

model

Added in v1.0.0 Source

Signature

declare function model(
  model: any,
  __namedParameters:
    | {
        [key: string]: any;
        [key: number]: any;
        readonly cache?: {
          readonly capacity: number;
          readonly timeToLive: DurationInput;
        };
        readonly maxBatchSize?: number;
        readonly mode: "batched";
      }
    | {
        [key: string]: any;
        [key: number]: any;
        readonly maxBatchSize?: number;
        readonly mode: "data-loader";
        readonly window: DurationInput;
      },
): Model<"openai", EmbeddingModel, OpenAiClient>;

Model type

Added in v1.0.0 Source

Signature

type Model = typeof Generated.CreateEmbeddingRequestModelEnum.Encoded;

Other

Config

Added in v1.0.0 Source