agentx-python 0.8.17__py3-none-any.whl → 0.8.18__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
agentx/monitor/client.py CHANGED
@@ -187,10 +187,17 @@ class MonitorClient:
187
187
  return self._base_url[: -len(suffix)]
188
188
  return self._base_url
189
189
 
190
- def _request(self, method: str, path: str, timeout: int = 30, base: Optional[str] = None, **kwargs) -> Any:
190
+ def _request(
191
+ self, method: str, path: str, timeout: int = 30, base: Optional[str] = None, retry: bool = True, **kwargs
192
+ ) -> Any:
193
+ # retry=False for non-idempotent judge-spending POSTs (sweep, coherence, portability,
194
+ # tuning): a client-side timeout must not fire the same LLM-billing work a second time
195
+ # while the first invocation is still running server-side. Same precedent as
196
+ # EvaluationsClient._request / analyze_run.
191
197
  url = f"{base or self._base_url}{path}"
192
198
  last_exc: Optional[Exception] = None
193
- for attempt, wait in enumerate([0.0] + _RETRY_BACKOFF):
199
+ schedule = [0.0] + _RETRY_BACKOFF if retry else [0.0]
200
+ for attempt, wait in enumerate(schedule):
194
201
  if wait:
195
202
  time.sleep(wait)
196
203
  try:
@@ -204,7 +211,7 @@ class MonitorClient:
204
211
  raise AgentXAuthError("Invalid or missing API key")
205
212
  if resp.status_code == 422:
206
213
  raise AgentXValidationError(resp.text)
207
- if resp.status_code in _RETRYABLE_STATUS and attempt < _MAX_RETRIES - 1:
214
+ if retry and resp.status_code in _RETRYABLE_STATUS and attempt < _MAX_RETRIES - 1:
208
215
  logger.debug(
209
216
  "Retryable status %d (attempt %d)", resp.status_code, attempt + 1
210
217
  )
@@ -421,7 +428,7 @@ class MonitorClient:
421
428
  button. Raises AgentXMonitorError if the engine has no judge key configured."""
422
429
  data = self._request(
423
430
  "POST", f"/agent-monitoring/sessions/{session_id}/coherence-check",
424
- base=self._api_root(), timeout=180,
431
+ base=self._api_root(), timeout=180, retry=False,
425
432
  )
426
433
  return data.get("score", data) if isinstance(data, dict) else data
427
434
 
@@ -444,7 +451,7 @@ class MonitorClient:
444
451
  engines run this automatically every minute; the manual trigger exists for demos,
445
452
  tests, and backfills. Returns ``{"judged": n}``."""
446
453
  return self._request(
447
- "POST", "/agent-monitoring/session-sweep/run", base=self._api_root(), timeout=300
454
+ "POST", "/agent-monitoring/session-sweep/run", base=self._api_root(), timeout=300, retry=False
448
455
  )
449
456
 
450
457
  # ------------------------------------------------------------------
@@ -457,7 +464,7 @@ class MonitorClient:
457
464
  plus judging, so expect tens of seconds."""
458
465
  return self._request(
459
466
  "POST", f"/agent-monitoring/traces/{trace_id}/portability",
460
- base=self._api_root(), json={"modelIds": model_ids}, timeout=300,
467
+ base=self._api_root(), json={"modelIds": model_ids}, timeout=300, retry=False,
461
468
  )
462
469
 
463
470
  # ------------------------------------------------------------------
@@ -114,6 +114,10 @@ class MonitorPatternClient:
114
114
  agent_ids=agent_ids,
115
115
  )
116
116
 
117
+ def delete(self, pattern_id: str) -> None:
118
+ """Delete a pattern. Its historical signals remain as history."""
119
+ self._client._request("DELETE", f"/agent-monitoring/patterns/{pattern_id}", base=self._client._api_root())
120
+
117
121
  def get(self, pattern_id: str) -> MonitorPattern:
118
122
  return self._client.get_pattern(pattern_id)
119
123
 
@@ -67,8 +67,8 @@ class ScorerGroupsClient:
67
67
  """``members``: [{"kind": "judge"|"pattern"|"custom", "refId": ..., "weight": 1, "gate": False}].
68
68
  ``online``: {"enabled": True, "sampleRate": 0.1, "alertThreshold": 5, "severity": "medium"}.
69
69
  Add ``"scope": "session", "idleSeconds": 120`` to score whole multi-turn sessions once
70
- idle, instead of each sampled trace.
71
- or None for offline-only."""
70
+ idle, instead of each sampled trace. Pass ``online=None`` (the default) for a group
71
+ that only grades offline dataset runs."""
72
72
  payload: Dict[str, Any] = {"name": name, "members": members}
73
73
  if description is not None:
74
74
  payload["description"] = description
@@ -22,8 +22,9 @@ class MonitorSessionClient:
22
22
 
23
23
  def scores(self, session_id: str) -> List[dict]:
24
24
  """Session-level verdicts, newest first. ``kind`` says who scored: a session-scoped
25
- online evaluator (``online-eval:<id>``) or a session-scoped scorer group
26
- (``scorer-group:<id>``)."""
25
+ online evaluator (``online-eval:<id>``), a session-scoped scorer group
26
+ (``scorer-group:<id>``), or legacy ``"coherence"`` rows written before the Session
27
+ Baseline Judge existed - branch defensively on unknown kinds."""
27
28
  return self._client.list_session_scores(session_id)
28
29
 
29
30
  def run_sweep(self) -> dict:
agentx/version.py CHANGED
@@ -1,7 +1,7 @@
1
- VERSION = "0.8.17"
1
+ VERSION = "0.8.18"
2
2
 
3
3
  # The AgentX-trace-eval release this SDK version is tested against - what `agentx-trace-eval`
4
4
  # installs and converges to (see agentx/cli.py). Bump together with VERSION when releasing, so
5
5
  # every published SDK names a known-good engine+dashboard pair. Users can override with
6
6
  # AGENTX_TRACE_EVAL_VERSION=<tag|latest>.
7
- ENGINE_VERSION = "v0.3.16"
7
+ ENGINE_VERSION = "v0.3.18"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentx-python
3
- Version: 0.8.17
3
+ Version: 0.8.18
4
4
  Summary: Official Python SDK for AgentX (https://www.agentx.so/)
5
5
  Home-page: https://github.com/AgentX-ai/AgentX-python
6
6
  Author: Robin Wang and AgentX Team
@@ -10,7 +10,7 @@ agentx/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  agentx/testing.py,sha256=0shZEid_vhJgBegpO_loUq6APYDxQrUgD3jvcRdIDV8,7372
11
11
  agentx/traces.py,sha256=sz9gxutlDKNgf0fdCkyzKsGwK5eMAJuIEl3NIwGrsuo,2287
12
12
  agentx/util.py,sha256=lt2Kpg4Fj8whrSuAhLEahcPEIYRVpK9RCC5y9ShdTJs,703
13
- agentx/version.py,sha256=hFFp4l3xfBrH_LqiA3KPfmmzw-XVqa7R3936Z3truX4,366
13
+ agentx/version.py,sha256=12ZEc4OJ-zU1rtsHoDBC5wqnwX7BmZ9OmiL3F4NWnMQ,366
14
14
  agentx/evaluations/__init__.py,sha256=Erv7RGFlRxGTG4rVb2uHhCqLLEX_iAWKqkZKzK6CumE,262
15
15
  agentx/evaluations/_term.py,sha256=WFpiNzdgDBeJJ-Gg-6X7TwwxllobuE4OqFUTuDQvS3Y,2529
16
16
  agentx/evaluations/client.py,sha256=f5GqsiuqknE-ENUYocBcXgV6OGMKdzmlsm76takJbwU,33112
@@ -43,18 +43,18 @@ agentx/integrations/openai.py,sha256=1KLs-hJaeW2emHPwNkmC3zcGksL3zd87uWbcLGRW704
43
43
  agentx/integrations/openai_agents.py,sha256=tCa3kPxqux5LnNNDQ6zA05OybQrjkc_LeE08YuNPJEs,12742
44
44
  agentx/monitor/__init__.py,sha256=MLiASSvQnCy2jqVNRTgPWFhUSf8lGYRQeEgEVVhE5Tg,574
45
45
  agentx/monitor/agents.py,sha256=8Xk4jWmNTvdtjFixHiLmw4jj96uqIXWIT6KW8zXoWrc,1006
46
- agentx/monitor/client.py,sha256=V-9rPuzTFR4W-iJS73Blippx0tGdSrOQTcFt1oz29jE,23551
46
+ agentx/monitor/client.py,sha256=lQdTUsXcxZwUOhdxZ5X_GdlIGoAaZa55mwn2u9DmSaw,24008
47
47
  agentx/monitor/improvement_groups.py,sha256=-6-FcJnyiTLqeh9z8D9wyFD1QFqEsdDdDZdDJhC6QXw,3712
48
48
  agentx/monitor/judge_scorers.py,sha256=HKCPW_9QJeyGEGwWxr_clep9vn27bwJTKnjN5lYbuSk,15972
49
49
  agentx/monitor/models.py,sha256=yTC3WTdTziHMkdeAXlTro-4YiSbBUHMgf9kNZHGfPDA,8470
50
50
  agentx/monitor/online_evaluators.py,sha256=YWnsBmlIbYvj4LCaX4guwx4HS5y3oEzCQfo6ae9VH_w,8693
51
- agentx/monitor/patterns.py,sha256=ruBqLoA2T2KQuqRbbn1kWkIEkiOal3SvyPl9opGyhzI,4185
51
+ agentx/monitor/patterns.py,sha256=NFHmHJqbq_KC3hNjh9lgv5aB8rsyUovGdd9YGwsQKfE,4422
52
52
  agentx/monitor/profile.py,sha256=uGk-4bXT2vmnEQiY5u6rWhAfzZchHBXL74VD3piVHvU,3102
53
53
  agentx/monitor/review_queue.py,sha256=Tr3GDMJLJzyFKEEeB8HPmZBsNzzYVJYElDlfBC4qd68,3766
54
54
  agentx/monitor/rules.py,sha256=oLQ5RPgMPUKJFTSZzcBEMLzDlICElUNJTyIqxZMAGmQ,3040
55
- agentx/monitor/scorer_groups.py,sha256=gRFq88B-YkdxftrWwuDLZixrpP0cXzL3ekoZ-lEYFPs,3674
55
+ agentx/monitor/scorer_groups.py,sha256=qff9eheOU7jMM8wVKU7gRrOlafPiQv16ieywBLAXFH0,3734
56
56
  agentx/monitor/scorers.py,sha256=huIZBszrfLKI8I7VV6NFpW6piRsj9HI03rXUwWs2tgs,7336
57
- agentx/monitor/sessions.py,sha256=2wTCsSE-Me0ZN_H5DJ58EJ05MQ-LL2m5XKSGIjVmgkM,1444
57
+ agentx/monitor/sessions.py,sha256=EnhyMMe2muwLyuKn99mLw-Ff1tHTMsgM7H_SXob1ltY,1570
58
58
  agentx/monitor/signals.py,sha256=Ld11lW2lbg8NHBUHdgoY6iwCvJDK-eg4ge4qQ9y7nGY,1432
59
59
  agentx/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
60
  agentx/resources/agent.py,sha256=ZKpxDYzJbKgOX4-W86U__b4gko7XlbwB4q6L8Az9uo0,2011
@@ -66,9 +66,9 @@ agentx/tracing/eval_scope.py,sha256=ElMbPxpqpQBVuaUnHNlw9RIQu71oyOpd0yR55bDH8eI,
66
66
  agentx/tracing/framework_detect.py,sha256=uV4O7Th-4_2UkdooAyaWCOIA0jwLJbblFQ_ucFDjeJM,2638
67
67
  agentx/tracing/ingest_client.py,sha256=spnm6bV3NXGuj2w7HwdKiJdKDJWRUFmSP3jl3rcGqkQ,18202
68
68
  agentx/tracing/tracer.py,sha256=TxY6zG6hbM81jpfrqP4imaEvoyy_hnJVUSTnoAVHMG0,56240
69
- agentx_python-0.8.17.dist-info/licenses/LICENSE,sha256=gZVsM-nLsE8vlaY6NXXsVoo6IlCClxkToAWmhgT3y_s,10762
70
- agentx_python-0.8.17.dist-info/METADATA,sha256=aqprIQoSBpSb7hcJPKt5C6pAz9R4aaHOx4dK3bWjXj8,22117
71
- agentx_python-0.8.17.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
72
- agentx_python-0.8.17.dist-info/entry_points.txt,sha256=rQqF1JTY3T1yfviBU1r8PU-5mBdfOk6P4bZ1L4BskIM,172
73
- agentx_python-0.8.17.dist-info/top_level.txt,sha256=s-q-HB9Gb_QdrZNacSeQyF_c25gQooMy7DlxzgLOHPk,7
74
- agentx_python-0.8.17.dist-info/RECORD,,
69
+ agentx_python-0.8.18.dist-info/licenses/LICENSE,sha256=gZVsM-nLsE8vlaY6NXXsVoo6IlCClxkToAWmhgT3y_s,10762
70
+ agentx_python-0.8.18.dist-info/METADATA,sha256=P0yCj9IwWgJrN6c_YcDBWj5YZeJCFaBkz_CNv1mJ2p4,22117
71
+ agentx_python-0.8.18.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
72
+ agentx_python-0.8.18.dist-info/entry_points.txt,sha256=rQqF1JTY3T1yfviBU1r8PU-5mBdfOk6P4bZ1L4BskIM,172
73
+ agentx_python-0.8.18.dist-info/top_level.txt,sha256=s-q-HB9Gb_QdrZNacSeQyF_c25gQooMy7DlxzgLOHPk,7
74
+ agentx_python-0.8.18.dist-info/RECORD,,