Metadata-Version: 2.4
Name: sthg-agent-observatory-sdk
Version: 0.1.0
Summary: AI Agent observability SDK and XAgent adapter
License: Apache-2.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# sthg-agent-observatory-sdk

Python SDK for the AI Agent observability platform. It provides a lightweight XAgent adapter that keeps the original local trace writer behavior and asynchronously reports normalized events to the observability backend.

## Install

```bash
pip install sthg-agent-observatory-sdk
```

## XAgent Usage

```python
import os

os.environ.setdefault("OBSERVABILITY_ENABLED", "true")
os.environ.setdefault("OBSERVABILITY_ENDPOINT", "http://127.0.0.1:8011")
os.environ.setdefault("OBSERVABILITY_API_KEY", "<app-api-key>")
os.environ.setdefault("OBSERVABILITY_PROJECT_KEY", "<project-key>")
os.environ.setdefault("OBSERVABILITY_APP_KEY", "<app-key>")
os.environ.setdefault("OBSERVABILITY_ENVIRONMENT", "dev")

from sthg_agent_observatory_sdk.xagent import install_xagent_observability

install_xagent_observability()
```

## Environment Variables

| Name | Default | Description |
| --- | --- | --- |
| `OBSERVABILITY_ENABLED` | `false` | Enables collection and reporting. |
| `OBSERVABILITY_ENDPOINT` | `http://127.0.0.1:8011` | Observability backend endpoint. |
| `OBSERVABILITY_API_KEY` | empty | App-level API key generated by the platform. |
| `OBSERVABILITY_PROJECT_KEY` | `worldmonitor` | Project key configured in the platform. |
| `OBSERVABILITY_APP_KEY` | `worldmonitor-xagent` | App key configured in the platform. |
| `OBSERVABILITY_ENVIRONMENT` | `dev` | App environment. |
| `OBSERVABILITY_BATCH_SIZE` | `200` | Flush after this many events. |
| `OBSERVABILITY_FLUSH_INTERVAL_SECONDS` | `3` | Flush interval when batch size is not reached. |

## License

Apache-2.0
