effect-io-ai

Package: @effect/ai-openrouter
Module: OpenRouterLanguageModel

OpenRouterLanguageModel.make

Creates an OpenRouter LanguageModel service from a model identifier and optional request defaults.

When to use

Use when you need to construct a LanguageModel.Service value backed by OpenRouterClient inside an Effect.

Details

The returned effect requires OpenRouterClient. Request defaults from the config option are merged with any Config service in the context, with context values taking precedence. The service supports both generateText and streamText.

Gotchas

Provider-defined tools are not supported by this provider integration; requests that include them fail with an InvalidUserInputError.

See

Signature

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

Source

Since v4.0.0