OpenAiClient.ts overview
Since v1.0.0
Exports Grouped by Category
Constructors
make
Signature
declare const make: (options: {
readonly apiKey?: Redacted.Redacted | undefined
readonly apiUrl?: string | undefined
readonly organizationId?: Redacted.Redacted | undefined
readonly projectId?: Redacted.Redacted | undefined
readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined
}) => Effect.Effect<OpenAiClient.Service, never, HttpClient.HttpClient>
Since v1.0.0
Context
OpenAiClient (class)
Signature
declare class OpenAiClient
Since v1.0.0
Layers
layer
Signature
declare const layer: (options: {
readonly apiKey?: Redacted.Redacted | undefined
readonly apiUrl?: string | undefined
readonly organizationId?: Redacted.Redacted | undefined
readonly projectId?: Redacted.Redacted | undefined
readonly transformClient?: (client: HttpClient.HttpClient) => HttpClient.HttpClient
}) => Layer.Layer<OpenAiClient, never, HttpClient.HttpClient>
Since v1.0.0
layerConfig
Signature
declare const layerConfig: (
options: Config.Config.Wrap<{
readonly apiKey?: Redacted.Redacted | undefined
readonly apiUrl?: string | undefined
readonly organizationId?: Redacted.Redacted | undefined
readonly projectId?: Redacted.Redacted | undefined
readonly transformClient?: (client: HttpClient.HttpClient) => HttpClient.HttpClient
}>
) => Layer.Layer<OpenAiClient, ConfigError, HttpClient.HttpClient>
Since v1.0.0
Models
StreamCompletionRequest (type alias)
Signature
type StreamCompletionRequest = Omit<typeof Generated.CreateChatCompletionRequest.Encoded, "stream">
Since v1.0.0
utils
OpenAiClient (namespace)
Since v1.0.0
Service (interface)
Signature
export interface Service {
readonly client: Generated.Client
readonly streamRequest: <A>(
request: HttpClientRequest.HttpClientRequest
) => Stream.Stream<A, HttpClientError.HttpClientError>
readonly stream: (
request: StreamCompletionRequest
) => Stream.Stream<AiResponse.AiResponse, HttpClientError.HttpClientError>
}
Since v1.0.0