Skip to main content

Anthropic helper wrappers for Sigil Python SDK

Project description

Sigil Python Provider Helper: Anthropic

sigil-sdk-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 sigil-sdk sigil-sdk-anthropic anthropic

Wrapper Mode (Sync)

from anthropic.types.message_create_params import MessageCreateParams
from sigil_sdk import Client, ClientConfig
from sigil_sdk_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 sigil_sdk_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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sigil_sdk_anthropic-0.1.4.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sigil_sdk_anthropic-0.1.4-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file sigil_sdk_anthropic-0.1.4.tar.gz.

File metadata

  • Download URL: sigil_sdk_anthropic-0.1.4.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

Hashes for sigil_sdk_anthropic-0.1.4.tar.gz
Algorithm Hash digest
SHA256 27baca7dd3cd4a4c5d70f8d5189143dc01c1eea46bda1b57c9483fd3c5727eba
MD5 89c5097697d7ebb53f25f45e13a9a685
BLAKE2b-256 6ac4c3bb8be5b654babc58a0f4c9c4f16c79acb7bee507f738c8d24af2c6b785

See more details on using hashes here.

Provenance

The following attestation bundles were made for sigil_sdk_anthropic-0.1.4.tar.gz:

Publisher: python-sdks-publish.yml on grafana/sigil-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sigil_sdk_anthropic-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for sigil_sdk_anthropic-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ef1d4d498bcf4d33db578b9ce35c96f8506c5d34f105dc88501e8a9de7a8f3c8
MD5 877702f6185f8262d938d56bd5566fc7
BLAKE2b-256 56abc9a282d0728af72d813a9ca25a1af3f4e5a2c638bc3de176ea17582b49bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for sigil_sdk_anthropic-0.1.4-py3-none-any.whl:

Publisher: python-sdks-publish.yml on grafana/sigil-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page