Metadata-Version: 2.4
Name: showholdings-agentmon
Version: 0.1.0
Summary: Python SDK for Show Holdings AgentOps monitoring
Author: Show Holdings
License-Expression: MIT
Project-URL: Homepage, https://agentops.showholdings.com
Project-URL: Repository, https://github.com/showholdings/showholdings-agentmon
Project-URL: Issues, https://github.com/showholdings/showholdings-agentmon/issues
Keywords: agentops,monitoring,ai-agent,sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: build>=1.2.1; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Dynamic: license-file

# showholdings-agentmon

`showholdings-agentmon` 是 Show Holdings AgentOps 的 Python SDK。

它讓你可以在自己的 Python 程式中，用最小改動接入 run-level monitoring。

## 安裝

```bash
pip install showholdings-agentmon
```

## 最小使用範例

```python
from showholdings_agentmon import Monitor

monitor = Monitor(
    api_key="YOUR_API_KEY",
    base_url="https://agentops.showholdings.com",
    project_name="my-agent",
)

with monitor.run(agent_name="general-agent", session_id="session-123"):
    result = run_my_agent()
```

## SDK 行為說明

- 進入 `with monitor.run(...)` 時，自動呼叫 `POST /api/sdk/runs/start`
- 離開 context 時，自動呼叫 `POST /api/sdk/runs/end`
- 成功結束會送出 `status=success`
- 區塊內拋出例外會送出 `status=failed`，並附帶：
  - `failure_reason_type`（例外類別名稱）
  - `error_count=1`
- SDK 對監控 API 採 best effort；監控 API 失敗不會中斷你的主要業務流程

## 本地開發

```bash
pip install -e .[dev]
pytest
python -m build
```

## 發布概要

本專案已提供 GitHub Actions：

- `ci.yml`：在 push / pull_request 執行測試
- `publish.yml`：以 PyPI Trusted Publishing 為目標的正式發布流程

你可先用 TestPyPI 驗證流程，再切換到正式 PyPI 發布。
