Metadata-Version: 2.4
Name: whyops
Version: 0.1.1
Summary: WhyOps SDK — AI agent observability
Project-URL: Homepage, https://whyops.com
Project-URL: Repository, https://github.com/whyops-org/whyops-op
Project-URL: Issues, https://github.com/whyops-org/whyops-op/issues
License: MIT
Keywords: agents,ai,llm,observability,tracing,whyops
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
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27
Requires-Dist: typing-extensions>=4.0
Provides-Extra: dev
Requires-Dist: mypy>=1.8; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# `whyops`

Type-safe Python SDK for WhyOps AI agent observability.

## Install

```bash
pip install whyops
```

## Quick start

```python
from whyops import WhyOps

sdk = WhyOps(
    api_key="YOUR_WHYOPS_API_KEY",
    agent_name="support-agent",
    agent_metadata={
        "systemPrompt": "You are a helpful support agent.",
        "tools": [],
    },
)

trace = sdk.trace("session-123")

trace.user_message_sync([
    {"role": "user", "content": "Reset my password."}
])

trace.llm_response_sync(
    "openai/gpt-4o-mini",
    "openai",
    "I can help with that.",
    usage={"promptTokens": 42, "completionTokens": 16, "totalTokens": 58},
    latency_ms=420,
    finish_reason="stop",
)
```

## Proxy mode

```python
from openai import OpenAI
from whyops import WhyOps

sdk = WhyOps(
    api_key="YOUR_WHYOPS_API_KEY",
    agent_name="support-agent",
    agent_metadata={"systemPrompt": "You are a helpful support agent.", "tools": []},
)

client = sdk.openai(OpenAI(api_key="YOUR_OPENAI_API_KEY"))
```

If `proxy_base_url` or `analyse_base_url` are omitted, the SDK uses WhyOps hosted defaults.

## Build and publish

```bash
python3 -m build
python3 -m twine upload dist/*
```
