Python SDK for Show Holdings AgentOps monitoring
Project description
showholdings-agentmon
showholdings-agentmon 是 Show Holdings AgentOps 的 Python SDK。
它讓你可以在自己的 Python 程式中,用最小改動接入 run-level monitoring。
安裝
pip install showholdings-agentmon
最小使用範例
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 失敗不會中斷你的主要業務流程
本地開發
pip install -e .[dev]
pytest
python -m build
發布概要
本專案已提供 GitHub Actions:
ci.yml:在 push / pull_request 執行測試publish.yml:以 PyPI Trusted Publishing 為目標的正式發布流程
你可先用 TestPyPI 驗證流程,再切換到正式 PyPI 發布。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file showholdings_agentmon-0.1.0.tar.gz.
File metadata
- Download URL: showholdings_agentmon-0.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8adf15695de2ccdf10cff9095d4e137321015a5f210e6b73c6d9b728dc243d6
|
|
| MD5 |
9f111002f6ee6d605616bddf5d496f48
|
|
| BLAKE2b-256 |
2b9ee827dd01de0ef80866701d45320fae12fec797f95468396ced5569075846
|
File details
Details for the file showholdings_agentmon-0.1.0-py3-none-any.whl.
File metadata
- Download URL: showholdings_agentmon-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c2c52f25526f3657fb202adb3b18e96ed083131cb7607f1eede33ab4bbd858a
|
|
| MD5 |
4bdd0bc91eb95353c8fa0f167cfb74fa
|
|
| BLAKE2b-256 |
f14ff569aac6ae632c89b382a3b633923de0a5719fec424bd09063a3e31e6689
|