GitHub

API reference for config.

Per-request changes to the OpenRouter client's HTTP client (Effect's OpenRouterConfig)::

program.pipe(config.with_client_transform(lambda client: client.retry_transient(times=2)))

The transform applies to the generated client's operations and to decisions requests, not to streamed chat completions; it replaces any transform set around it (compose them by hand to apply both).

Re-exports

Values

AttributeTypeDescription
Servicetype[ClientConfig]

Classes

Functions

get_or_none

get_or_none() -> Effect[Service | None]

The provided OpenRouterConfig, else None.

Returns Effect[Service | None]

def get_or_none() -> Effect[Service | None]:
    """The provided ``OpenRouterConfig``, else ``None``."""
    return P.client_config(OpenRouterConfig)

with_client_transform

with_client_transform(transform) -> P.WithClientTransform

Run an effect with its requests sent through transform(client). Use with .pipe.

ParameterTypeDescription
transformClientTransform

Returns P.WithClientTransform

def with_client_transform(transform: ClientTransform) -> P.WithClientTransform:
    """Run an effect with its requests sent through ``transform(client)``.
    Use with ``.pipe``."""
    return P.WithClientTransform(OpenRouterConfig, transform)