agentx-python 0.6.29__tar.gz → 0.6.30__tar.gz
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_python-0.6.29 → agentx_python-0.6.30}/PKG-INFO +1 -1
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/moveworks.py +56 -8
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/tracing/ingest_client.py +22 -0
- agentx_python-0.6.30/agentx/version.py +1 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx_python.egg-info/PKG-INFO +1 -1
- agentx_python-0.6.29/agentx/version.py +0 -1
- {agentx_python-0.6.29 → agentx_python-0.6.30}/LICENSE +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/README.md +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/__init__.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/agentx.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/cli.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/__init__.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/_term.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/adapters/__init__.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/adapters/http_endpoint.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/adapters/precomputed.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/adapters/raw.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/client.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/datasets.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/evaluation_settings.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/models.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/prompts.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/redaction.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/reporting.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/results.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/runner.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/tool_schemas.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/evaluations/tracing.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/exceptions.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/feedback.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/__init__.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/_traced_call.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/anthropic.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/autogen.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/crewai.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/databricks.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/google_adk.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/google_genai.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/langchain.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/litellm.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/llamaindex.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/openai.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/integrations/openai_agents.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/monitor/__init__.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/monitor/agents.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/monitor/client.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/monitor/models.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/monitor/online_evaluators.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/monitor/patterns.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/monitor/profile.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/monitor/sessions.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/monitor/signals.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/outcomes.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/py.typed +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/resources/__init__.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/resources/agent.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/resources/conversation.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/resources/workforce.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/tracing/__init__.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/tracing/ci_types.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/tracing/tracer.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx/util.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx_python.egg-info/SOURCES.txt +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx_python.egg-info/dependency_links.txt +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx_python.egg-info/entry_points.txt +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx_python.egg-info/not-zip-safe +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx_python.egg-info/requires.txt +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/agentx_python.egg-info/top_level.txt +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/setup.cfg +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/setup.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/tests/test_integration.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/tests/test_integrations.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/tests/test_selfhost_analysis_fallback.py +0 -0
- {agentx_python-0.6.29 → agentx_python-0.6.30}/tests/test_span_tree.py +0 -0
|
@@ -173,6 +173,17 @@ class MoveworksSyncReport:
|
|
|
173
173
|
self.sessions_judged = 0
|
|
174
174
|
self.sessions_judge_skipped = 0
|
|
175
175
|
self.sessions_judge_failed = 0
|
|
176
|
+
# --evaluate-against: per-trace offline grading of the imported interactions.
|
|
177
|
+
self.traces_evaluated = 0
|
|
178
|
+
self.trace_eval_skipped_deduped = 0
|
|
179
|
+
self.trace_eval_failed = 0
|
|
180
|
+
self.trace_eval_ratings: List[float] = []
|
|
181
|
+
|
|
182
|
+
@property
|
|
183
|
+
def trace_eval_average(self) -> Optional[float]:
|
|
184
|
+
if not self.trace_eval_ratings:
|
|
185
|
+
return None
|
|
186
|
+
return sum(self.trace_eval_ratings) / len(self.trace_eval_ratings)
|
|
176
187
|
|
|
177
188
|
def __repr__(self) -> str: # also what the CLI prints
|
|
178
189
|
base = (
|
|
@@ -180,6 +191,14 @@ class MoveworksSyncReport:
|
|
|
180
191
|
f"ingested={self.ingested}, failed={self.failed}, "
|
|
181
192
|
f"plugin_calls_attached={self.plugin_calls_attached}, skipped_no_time={self.skipped_no_time}"
|
|
182
193
|
)
|
|
194
|
+
if self.traces_evaluated or self.trace_eval_failed or self.trace_eval_skipped_deduped:
|
|
195
|
+
avg = self.trace_eval_average
|
|
196
|
+
base += (
|
|
197
|
+
f", traces_evaluated={self.traces_evaluated}"
|
|
198
|
+
+ (f" (avg {avg:.1f}/10)" if avg is not None else "")
|
|
199
|
+
+ f", eval_skipped_deduped={self.trace_eval_skipped_deduped}"
|
|
200
|
+
+ f", eval_failed={self.trace_eval_failed}"
|
|
201
|
+
)
|
|
183
202
|
if self.sessions_judged or self.sessions_judge_skipped or self.sessions_judge_failed:
|
|
184
203
|
base += (
|
|
185
204
|
f", sessions_judged={self.sessions_judged}, "
|
|
@@ -369,6 +388,7 @@ class MoveworksImporter:
|
|
|
369
388
|
*,
|
|
370
389
|
monitor: bool = False,
|
|
371
390
|
judge_sessions: bool = False,
|
|
391
|
+
evaluate_against: Optional[str] = None,
|
|
372
392
|
dry_run: bool = False,
|
|
373
393
|
on_payload: Optional[Any] = None,
|
|
374
394
|
) -> MoveworksSyncReport:
|
|
@@ -376,12 +396,19 @@ class MoveworksImporter:
|
|
|
376
396
|
Import every interaction in ``[since, until)``. Safe to re-run over the same window - the
|
|
377
397
|
engine deduplicates on the deterministic ``span_id`` (and skips re-judging deduped spans).
|
|
378
398
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
399
|
+
Pattern/built-in checks and trace-scoped online evaluators run on every imported trace
|
|
400
|
+
by default (the engine's normal ingest-time posture); ``monitor=True`` is kept for
|
|
401
|
+
explicitness/compat. ``judge_sessions=True`` additionally asks the engine to judge every
|
|
382
402
|
imported session with each enabled session-scoped evaluator after the sync; the request
|
|
383
403
|
carries ``ifStale=true`` so a session already scored (e.g. by the engine's own 24h sweep)
|
|
384
|
-
is never judged twice.
|
|
404
|
+
is never judged twice.
|
|
405
|
+
|
|
406
|
+
``evaluate_against=<dataset_or_config_id>`` is the offline-eval path for an agent that
|
|
407
|
+
can't be invoked from outside: each imported interaction's recorded input/output is
|
|
408
|
+
graded against that grading config's criteria (one judge call per NEW interaction -
|
|
409
|
+
spans the engine already had are skipped via its dedupe, so re-syncing a window never
|
|
410
|
+
re-bills). Ratings land as evaluation results linked to each trace, and the report
|
|
411
|
+
carries the average. Returns a summary report.
|
|
385
412
|
"""
|
|
386
413
|
report = MoveworksSyncReport()
|
|
387
414
|
conversations = self._conversation_index(since, until)
|
|
@@ -407,10 +434,23 @@ class MoveworksImporter:
|
|
|
407
434
|
on_payload(wire)
|
|
408
435
|
if dry_run:
|
|
409
436
|
continue
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
else:
|
|
437
|
+
detail = self._ingest.send_trace_sync_detailed(wire)
|
|
438
|
+
if detail is None:
|
|
413
439
|
report.failed += 1
|
|
440
|
+
continue
|
|
441
|
+
report.ingested += 1
|
|
442
|
+
if evaluate_against:
|
|
443
|
+
if detail.get("deduped"):
|
|
444
|
+
report.trace_eval_skipped_deduped += 1
|
|
445
|
+
continue
|
|
446
|
+
try:
|
|
447
|
+
verdict = self._ingest.evaluate_trace(detail["trace_id"], evaluate_against)
|
|
448
|
+
report.traces_evaluated += 1
|
|
449
|
+
if isinstance(verdict.get("rating"), (int, float)):
|
|
450
|
+
report.trace_eval_ratings.append(float(verdict["rating"]))
|
|
451
|
+
except Exception as exc:
|
|
452
|
+
report.trace_eval_failed += 1
|
|
453
|
+
print(f"evaluate_against failed for trace {detail.get('trace_id')}: {exc}", file=sys.stderr)
|
|
414
454
|
|
|
415
455
|
report.session_ids = session_ids
|
|
416
456
|
if judge_sessions and not dry_run:
|
|
@@ -479,7 +519,14 @@ def cli_main(argv: Optional[List[str]] = None) -> None:
|
|
|
479
519
|
sync.add_argument(
|
|
480
520
|
"--monitor",
|
|
481
521
|
action="store_true",
|
|
482
|
-
help="
|
|
522
|
+
help="Kept for compat - pattern/built-in checks and trace-scoped online evaluators already run "
|
|
523
|
+
"on every imported trace by default",
|
|
524
|
+
)
|
|
525
|
+
sync.add_argument(
|
|
526
|
+
"--evaluate-against",
|
|
527
|
+
metavar="DATASET_ID",
|
|
528
|
+
help="Offline eval during sync: grade each NEW imported interaction's recorded input/output "
|
|
529
|
+
"against this grading config (one judge call per interaction; re-synced spans are skipped)",
|
|
483
530
|
)
|
|
484
531
|
sync.add_argument(
|
|
485
532
|
"--judge-sessions",
|
|
@@ -522,6 +569,7 @@ def cli_main(argv: Optional[List[str]] = None) -> None:
|
|
|
522
569
|
until,
|
|
523
570
|
monitor=args.monitor,
|
|
524
571
|
judge_sessions=args.judge_sessions,
|
|
572
|
+
evaluate_against=args.evaluate_against,
|
|
525
573
|
dry_run=args.dry_run,
|
|
526
574
|
on_payload=on_payload,
|
|
527
575
|
)
|
|
@@ -122,6 +122,28 @@ class IngestClient:
|
|
|
122
122
|
except Exception:
|
|
123
123
|
return None
|
|
124
124
|
|
|
125
|
+
def send_trace_sync_detailed(self, payload: Dict[str, Any]) -> Optional[Dict[str, Any]]:
|
|
126
|
+
"""``send_trace_sync`` returning the full response body instead of just the id - the
|
|
127
|
+
engine includes ``deduped: true`` for a span it had already ingested, which importers
|
|
128
|
+
(agentx-moveworks) use to skip re-evaluating on window re-syncs. Never raises."""
|
|
129
|
+
if self._workspace_id:
|
|
130
|
+
payload = {**payload, "workspaceId": self._workspace_id}
|
|
131
|
+
try:
|
|
132
|
+
resp = self._session.post(self._endpoint, json=payload, timeout=10)
|
|
133
|
+
except requests.RequestException as exc:
|
|
134
|
+
self._warn_delivery(f"{exc.__class__.__name__}: {exc}")
|
|
135
|
+
logger.debug("agentx ingest sync send error: %s", exc)
|
|
136
|
+
return None
|
|
137
|
+
if not resp.ok:
|
|
138
|
+
self._warn_delivery(f"HTTP {resp.status_code}", status=resp.status_code)
|
|
139
|
+
logger.debug("agentx ingest sync HTTP %d: %s", resp.status_code, resp.text[:200])
|
|
140
|
+
return None
|
|
141
|
+
try:
|
|
142
|
+
body = resp.json()
|
|
143
|
+
return body if isinstance(body, dict) and body.get("trace_id") else None
|
|
144
|
+
except Exception:
|
|
145
|
+
return None
|
|
146
|
+
|
|
125
147
|
def evaluate_trace(
|
|
126
148
|
self,
|
|
127
149
|
trace_id: str,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "0.6.30"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = "0.6.29"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|