GitHub

API reference for config.

Per-request changes to the HTTP client of an Anthropic client (Effect's AnthropicConfig)::

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

Re-exports

Values

AttributeTypeDescription
Servicetype[ClientConfig]

Classes

Functions

get_or_none

get_or_none() -> Effect[Service | None]

The provided AnthropicConfig, else None.

Returns Effect[Service | None]

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

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(AnthropicConfig, transform)