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#
| Attribute | Type | Description |
|---|---|---|
Service | type[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.WithClientTransformRun an effect with its requests sent through transform(client).
Use with .pipe.
| Parameter | Type | Description |
|---|---|---|
transform | ClientTransform |
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)