OpenAiLanguageModel.ts overview
Since v1.0.0
Exports Grouped by Category
Ai Models
model
Signature
declare const model: (
model: (string & {}) | Model,
config?: Omit<Config.Service, "model">
) => AiModel.Model<"openai", LanguageModel.LanguageModel, OpenAiClient>
Since v1.0.0
modelWithTokenizer
Signature
declare const modelWithTokenizer: (
model: (string & {}) | Model,
config?: Omit<Config.Service, "model">
) => AiModel.Model<"openai", LanguageModel.LanguageModel | Tokenizer.Tokenizer, OpenAiClient>
Since v1.0.0
Configuration
withConfigOverride
Signature
declare const withConfigOverride: {
(overrides: Config.Service): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
<A, E, R>(self: Effect.Effect<A, E, R>, overrides: Config.Service): Effect.Effect<A, E, R>
}
Since v1.0.0
Constructors
make
Signature
declare const make: (options: {
readonly model: (string & {}) | Model
readonly config?: Omit<Config.Service, "model">
}) => Effect.Effect<LanguageModel.Service, never, OpenAiClient>
Since v1.0.0
Context
Config (class)
Signature
declare class Config
Since v1.0.0
Layers
layer
Signature
declare const layer: (options: {
readonly model: (string & {}) | Model
readonly config?: Omit<Config.Service, "model">
}) => Layer.Layer<LanguageModel.LanguageModel, never, OpenAiClient>
Since v1.0.0
layerWithTokenizer
Signature
declare const layerWithTokenizer: (options: {
readonly model: (string & {}) | Model
readonly config?: Omit<Config.Service, "model">
}) => Layer.Layer<LanguageModel.LanguageModel | Tokenizer.Tokenizer, never, OpenAiClient>
Since v1.0.0
Models
Model (type alias)
Signature
type Model = typeof Generated.ChatModel.Encoded | typeof Generated.ModelIdsResponsesEnum.Encoded
Since v1.0.0
utils
Config (namespace)
Since v1.0.0
Service (interface)
Signature
export interface Service
extends Simplify<
Partial<Omit<typeof Generated.CreateResponse.Encoded, "input" | "tools" | "tool_choice" | "stream" | "text">>
> {
/**
* File ID prefixes used to identify file IDs in Responses API.
* When undefined, all file data is treated as base64 content.
*
* Examples:
* - OpenAI: ['file-'] for IDs like 'file-abc123'
* - Azure OpenAI: ['assistant-'] for IDs like 'assistant-abc123'
*/
readonly fileIdPrefixes?: ReadonlyArray<string>
/**
* Configuration options for a text response from the model.
*/
readonly text?: {
/**
* Constrains the verbosity of the model's response. Lower values will
* result in more concise responses, while higher values will result in
* more verbose responses.
*
* Defaults to `"medium"`.
*/
readonly verbosity?: "low" | "medium" | "high"
}
}
Since v1.0.0
ProviderMetadata (namespace)
Since v1.0.0
Service (interface)
Signature
export interface Service {
source: {} | {}
}
Since v1.0.0