Skip to main content

Agent Observability Python Provider Helper: Anthropic

agento11y-anthropic provides strict Anthropic Messages wrappers and mappers for agento11y.

Embeddings support

This helper currently supports Anthropic Messages APIs only. Native Anthropic embeddings endpoints are not available in the official SDK/API surface used in this repository.

Installation

pip install agento11y agento11y-anthropic anthropic

Wrapper Mode (Sync)

from anthropic.types.message_create_params import MessageCreateParams
from agento11y import Client, ClientConfig
from agento11y_anthropic import AnthropicOptions, messages

client = Client(ClientConfig())

request: MessageCreateParams = {
    "model": "claude-sonnet-4-5",
    "max_tokens": 256,
    "messages": [{"role": "user", "content": "Hello"}],
}

def provider_call(req: MessageCreateParams):
    return anthropic_client.messages.create(**req)

response = messages.create(
    client,
    request,
    provider_call,
    AnthropicOptions(conversation_id="conv-1", agent_name="assistant", agent_version="1.0.0"),
)

Wrapper Mode (Stream)

from agento11y_anthropic import AnthropicStreamSummary, messages

summary = messages.stream(
    client,
    request,
    lambda req: AnthropicStreamSummary(
        output_text="streamed text",
        events=[{"type": "content_block_delta", "delta": {"type": "text_delta", "text": "streamed text"}}],
    ),
)

Mapper Mode

generation = messages.from_request_response(request, response)
stream_generation = messages.from_stream(request, summary)

Raw Provider Artifacts (Opt-In)

options = AnthropicOptions(raw_artifacts=True)

Raw artifacts are default OFF and should only be enabled for diagnostics.

Provider metadata mapping

In addition to normalized usage fields, Anthropic server-tool counters are mapped into agento11y metadata when present:

  • agento11y.gen_ai.usage.server_tool_use.web_search_requests
  • agento11y.gen_ai.usage.server_tool_use.web_fetch_requests
  • agento11y.gen_ai.usage.server_tool_use.total_requests

Metadata

Release files for agento11y-anthropic 0.17.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agento11y-anthropic 0.17.0
File Size Uploaded
agento11y_anthropic-0.17.0.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agento11y-anthropic 0.17.0
File Interpreter ABI Platform
agento11y_anthropic-0.17.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / agento11y_anthropic-0.17.0.tar.gz

Download URL agento11y_anthropic-0.17.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0d9c6dfee07d570f5e6d8ee346c92f9919bd299f35fcde738996d2dc88f9a90a
BLAKE2b-256 checksum
How to use checksums
a35f786d469cba679083a7e4fd303b9d543c2a85a81a796b785faafd221dfd83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / agento11y_anthropic-0.17.0-py3-none-any.whl

Download URL agento11y_anthropic-0.17.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1faba819ddb2b6cfa3dbe5d948b670d0d27d575869cad7e160c00f313d392ea2
BLAKE2b-256 checksum
How to use checksums
88f73c69e9b42de0654874ed93de8a172049e7c601d664d62c97aaac825932c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

0.18.0

2 release files

This release

0.17.0 This release

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.12.0

2 release files

0.10.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page