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
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
senzu_sdk-0.5.2.tar.gz
(19.3 kB
view details)
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
senzu_sdk-0.5.2-py3-none-any.whl
(19.8 kB
view details)
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edf28f502ad48c08e5a9d2c9de092fd0486c694f9f42c5ec14bc6b7991751219
|
|
| MD5 |
2dda0cfb4dce69af0a17248f2706a963
|
|
| BLAKE2b-256 |
9dec0e977c80ded0002e1fbcea6a70c7a385996d710659b6ddd2e653b5dfb80f
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edfd3c6f8497de6c4831c4be380d6d0242b7a70dde07bfe0f6d8ae00695727db
|
|
| MD5 |
0c1db14dfa0a4e2b362a42b639abfd9e
|
|
| BLAKE2b-256 |
84c9054f3cccea370d99a01ef41f5132379492a148ca859c9c883f32ef6b0688
|