Skip to main content Link Search Menu Expand Document (external link)

OpenRouterLanguageModel.ts overview

Since v1.0.0


Exports Grouped by Category


Ai Models

model

Signature

declare const model: (
  model: string,
  config?: Omit<Config.Service, "model">
) => AiModel.Model<"openrouter", LanguageModel.LanguageModel, OpenRouterClient>

Source

Since v1.0.0

Configuration

withConfigOverride

Signature

declare const withConfigOverride: {
  (config: 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>, config: Config.Service): Effect.Effect<A, E, R>
}

Source

Since v1.0.0

Constructors

make

Signature

declare const make: (options: {
  readonly model: string
  readonly config?: Omit<Config.Service, "model">
}) => Effect.Effect<LanguageModel.Service, never, OpenRouterClient>

Source

Since v1.0.0

Context

Config (class)

Signature

declare class Config

Source

Since v1.0.0

Layers

layer

Signature

declare const layer: (options: {
  readonly model: string
  readonly config?: Omit<Config.Service, "model">
}) => Layer.Layer<LanguageModel.LanguageModel, never, OpenRouterClient>

Source

Since v1.0.0

Provider Metadata

OpenRouterReasoningInfo (type alias)

Signature

type OpenRouterReasoningInfo =
  | {
      readonly type: "reasoning"
      readonly signature: string | undefined
    }
  | {
      readonly type: "encrypted_reasoning"
      readonly format: typeof Generated.ReasoningDetailSummaryFormat.Type
      readonly redactedData: string
    }

Source

Since v1.0.0

utils

Config (namespace)

Source

Since v1.0.0

Service (interface)

Signature

export interface Service
  extends Simplify<
    Partial<
      Omit<
        typeof Generated.ChatCompletionCreateParams.Encoded,
        "messages" | "response_format" | "tools" | "tool_choice" | "stream"
      >
    >
  > {}

Source

Since v1.0.0