Anthropic helper wrappers for the Grafana Agent Observability Python SDK
Project description
Sigil Python Provider Helper: Anthropic
agento11y-anthropic provides strict Anthropic Messages wrappers and mappers for Sigil.
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 Sigil metadata when present:
agento11y.gen_ai.usage.server_tool_use.web_search_requestsagento11y.gen_ai.usage.server_tool_use.web_fetch_requestsagento11y.gen_ai.usage.server_tool_use.total_requests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agento11y_anthropic-0.10.0.tar.gz.
File metadata
- Download URL: agento11y_anthropic-0.10.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc0de780a71364d5ef050525f99556500bb801d70e01c3e9c12a81bf1b372249
|
|
| MD5 |
c6656798c91331622f812ca92e1b1549
|
|
| BLAKE2b-256 |
90462dbb045f6d88ec4a656fe50c08ba90ee43bbc6eeaee226ed94934ed81fc6
|
Provenance
The following attestation bundles were made for agento11y_anthropic-0.10.0.tar.gz:
Publisher:
python-sdks-publish.yml on grafana/agento11y
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agento11y_anthropic-0.10.0.tar.gz -
Subject digest:
cc0de780a71364d5ef050525f99556500bb801d70e01c3e9c12a81bf1b372249 - Sigstore transparency entry: 2212035173
- Sigstore integration time:
-
Permalink:
grafana/agento11y@a4e0bb2da205e2db40e7668df4e343263872cb3a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/grafana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-sdks-publish.yml@a4e0bb2da205e2db40e7668df4e343263872cb3a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file agento11y_anthropic-0.10.0-py3-none-any.whl.
File metadata
- Download URL: agento11y_anthropic-0.10.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6627e66c4ca9bfd40447630250172ef62ea18ea36c7f0ede7a7bd6ee917d3871
|
|
| MD5 |
645b480f4b9d4144338208119fe765e5
|
|
| BLAKE2b-256 |
0c66b3cc9cccb7341beffde621f0b997078533f5e564d54e0f5c86d74a7b88f6
|
Provenance
The following attestation bundles were made for agento11y_anthropic-0.10.0-py3-none-any.whl:
Publisher:
python-sdks-publish.yml on grafana/agento11y
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agento11y_anthropic-0.10.0-py3-none-any.whl -
Subject digest:
6627e66c4ca9bfd40447630250172ef62ea18ea36c7f0ede7a7bd6ee917d3871 - Sigstore transparency entry: 2212035217
- Sigstore integration time:
-
Permalink:
grafana/agento11y@a4e0bb2da205e2db40e7668df4e343263872cb3a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/grafana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-sdks-publish.yml@a4e0bb2da205e2db40e7668df4e343263872cb3a -
Trigger Event:
workflow_dispatch
-
Statement type: