GitHub

anthropic

API reference for anthropic.

Anthropic's Messages API for pyfect.ai (Effect's @effect/ai-anthropic): the client, its per-call config, the language_model, the provider-defined tool constructors, the error metadata an AiError carries and the GenAI telemetry attributes. Requests go over the HttpClient service with Anthropic's JSON wire format; streams are read as Server-Sent Events::

from pyfect.ai.anthropic import client, language_model

program.pipe(fx.provide(language_model.model("claude-sonnet-5-5").layer)).pipe(
    fx.provide(client.layer_config(api_key=config.redacted("ANTHROPIC_API_KEY")))
)

Re-exports

Modules