Metadata-Version: 2.4
Name: senzu-sdk
Version: 0.5.2
Summary: Python SDK for the Senzu AI observability platform
Project-URL: Homepage, https://senzu.ai
Project-URL: Repository, https://github.com/senzu-ai/senzu
Author: Senzu AI
License: MIT
Keywords: agents,ai,llm,observability,telemetry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Requires-Dist: httpx>=0.25.0
Requires-Dist: typing-extensions>=4.0; python_version < '3.11'
Provides-Extra: all
Requires-Dist: anthropic>=0.20.0; extra == 'all'
Requires-Dist: langchain>=0.1.0; extra == 'all'
Requires-Dist: openai>=1.0.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.20.0; extra == 'anthropic'
Provides-Extra: dev
Requires-Dist: anyio[trio]; extra == 'dev'
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: langchain
Requires-Dist: langchain>=0.1.0; extra == 'langchain'
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == 'openai'
Description-Content-Type: text/markdown

# senzu-sdk

Python SDK for the [Senzu](https://senzu.ai) AI observability platform.

## Installation

```bash
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

```python
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:

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

## License

MIT
