Skip to content

OpenAiClientGenerated

5 exports Added in v4.0.0 Source

Constructors

make

Added in v4.0.0 Source

Creates a generated OpenAI client service with the given options.

Signature

declare const make: (...args: [options: Options]) => Effect;

Layers

layer

Added in v4.0.0 Source

Creates a layer for the generated OpenAI client with the given options.

Signature

declare function layer(options: Options): Layer<OpenAiClientGenerated, never, HttpClient>;

layerConfig

Added in v4.0.0 Source

Creates a layer for the generated OpenAI client, loading the requisite configuration via Effect's Config module.

Signature

declare function layerConfig(options?: {
  readonly apiKey?: Config<Redacted<string> | undefined>;
  readonly apiUrl?: Config<string>;
  readonly organizationId?: Config<Redacted<string> | undefined>;
  readonly projectId?: Config<Redacted<string> | undefined>;
  readonly transformClient?: (client: HttpClient) => HttpClient;
}): Layer<OpenAiClientGenerated, ConfigError, HttpClient>;

Options

Options type

Added in v4.0.0 Source

Options for configuring the generated OpenAI client.

Signature

type Options = {
  readonly apiKey?: Redacted.Redacted<string>;
  readonly apiUrl?: string;
  readonly organizationId?: Redacted.Redacted<string>;
  readonly projectId?: Redacted.Redacted<string>;
  readonly transformClient?: (client: HttpClient.HttpClient) => HttpClient.HttpClient;
};

Service

Service identifier for the generated OpenAI client.

Signature

declare class OpenAiClientGenerated extends Shape<
  "@effect/ai-openai/OpenAiClientGenerated",
  OpenAiClient,
  this
> {
  constructor(_: never);
}