Skip to main content

Python SDK for the Senzu AI observability platform

Project description

senzu-sdk

Python SDK for the Senzu AI observability platform.

Installation

pip install senzu-sdk                    # core
pip install "senzu-sdk[anthropic]"       # + Anthropic auto-tracking
pip install "senzu-sdk[openai]"          # + OpenAI auto-tracking
pip install "senzu-sdk[langchain]"       # + LangChain callback handler
pip install "senzu-sdk[all]"             # everything

Quick start

import senzu

client = senzu.SenzuClient({
    "api_key": "your-api-key",
    "agent_id": "your-agent-id",
    "org_id": "your-org-id",
})

# High-level API with automatic context propagation
async def handle_request():
    async with client.run({"session_id": "abc"}) as run:
        step = run.start_step({"name": "fetch", "step_type": "tool"})
        result = await step.track_tool({"tool_name": "search", "fn": search})
        await step.end()

# Anthropic auto-tracking
from anthropic import AsyncAnthropic
from senzu.integrations.anthropic import WrapAnthropicOptions, wrap_anthropic

anthropic = wrap_anthropic(
    AsyncAnthropic(),
    WrapAnthropicOptions(client=client),
)

async def chat():
    async with client.run({}) as run:
        # messages.create() is tracked automatically
        return await anthropic.messages.create(
            model="claude-sonnet-4-6",
            max_tokens=1024,
            messages=[{"role": "user", "content": "Hello"}],
        )

Environment variables

Variable Description
SENZU_API_KEY API key
SENZU_BASE_URL API base URL (default: http://localhost:3001)
SENZU_AGENT_ID Agent ID
SENZU_ORG_ID Organisation ID

Use from_env=True to load from environment:

client = senzu.SenzuClient({"from_env": True})

License

MIT

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

senzu_sdk-0.5.2.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

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

senzu_sdk-0.5.2-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file senzu_sdk-0.5.2.tar.gz.

File metadata

  • Download URL: senzu_sdk-0.5.2.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.21

File hashes

Hashes for senzu_sdk-0.5.2.tar.gz
Algorithm Hash digest
SHA256 edf28f502ad48c08e5a9d2c9de092fd0486c694f9f42c5ec14bc6b7991751219
MD5 2dda0cfb4dce69af0a17248f2706a963
BLAKE2b-256 9dec0e977c80ded0002e1fbcea6a70c7a385996d710659b6ddd2e653b5dfb80f

See more details on using hashes here.

File details

Details for the file senzu_sdk-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: senzu_sdk-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.21

File hashes

Hashes for senzu_sdk-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 edfd3c6f8497de6c4831c4be380d6d0242b7a70dde07bfe0f6d8ae00695727db
MD5 0c1db14dfa0a4e2b362a42b639abfd9e
BLAKE2b-256 84c9054f3cccea370d99a01ef41f5132379492a148ca859c9c883f32ef6b0688

See more details on using hashes here.

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