agentx-python 0.8.1__tar.gz → 0.8.3__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.
Files changed (84) hide show
  1. {agentx_python-0.8.1/agentx_python.egg-info → agentx_python-0.8.3}/PKG-INFO +1 -1
  2. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/models.py +11 -3
  3. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/langchain.py +4 -0
  4. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/tracing/tracer.py +23 -0
  5. agentx_python-0.8.3/agentx/version.py +1 -0
  6. {agentx_python-0.8.1 → agentx_python-0.8.3/agentx_python.egg-info}/PKG-INFO +1 -1
  7. agentx_python-0.8.1/agentx/version.py +0 -1
  8. {agentx_python-0.8.1 → agentx_python-0.8.3}/LICENSE +0 -0
  9. {agentx_python-0.8.1 → agentx_python-0.8.3}/README.md +0 -0
  10. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/__init__.py +0 -0
  11. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/agentx.py +0 -0
  12. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/cli.py +0 -0
  13. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/__init__.py +0 -0
  14. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/_term.py +0 -0
  15. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/adapters/__init__.py +0 -0
  16. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/adapters/http_endpoint.py +0 -0
  17. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/adapters/precomputed.py +0 -0
  18. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/adapters/raw.py +0 -0
  19. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/client.py +0 -0
  20. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/datasets.py +0 -0
  21. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/evaluation_settings.py +0 -0
  22. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/prompts.py +0 -0
  23. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/reporting.py +0 -0
  24. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/results.py +0 -0
  25. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/runner.py +0 -0
  26. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/tool_schemas.py +0 -0
  27. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/evaluations/tracing.py +0 -0
  28. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/exceptions.py +0 -0
  29. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/export.py +0 -0
  30. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/feedback.py +0 -0
  31. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/__init__.py +0 -0
  32. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/_traced_call.py +0 -0
  33. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/anthropic.py +0 -0
  34. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/autogen.py +0 -0
  35. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/crewai.py +0 -0
  36. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/databricks.py +0 -0
  37. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/google_adk.py +0 -0
  38. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/google_genai.py +0 -0
  39. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/litellm.py +0 -0
  40. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/llamaindex.py +0 -0
  41. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/moveworks.py +0 -0
  42. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/openai.py +0 -0
  43. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/integrations/openai_agents.py +0 -0
  44. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/__init__.py +0 -0
  45. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/agents.py +0 -0
  46. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/client.py +0 -0
  47. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/judge_scorers.py +0 -0
  48. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/models.py +0 -0
  49. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/online_evaluators.py +0 -0
  50. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/patterns.py +0 -0
  51. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/profile.py +0 -0
  52. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/scorers.py +0 -0
  53. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/sessions.py +0 -0
  54. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/monitor/signals.py +0 -0
  55. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/outcomes.py +0 -0
  56. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/projects.py +0 -0
  57. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/py.typed +0 -0
  58. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/resources/__init__.py +0 -0
  59. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/resources/agent.py +0 -0
  60. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/resources/conversation.py +0 -0
  61. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/resources/workforce.py +0 -0
  62. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/testing.py +0 -0
  63. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/traces.py +0 -0
  64. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/tracing/__init__.py +0 -0
  65. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/tracing/ci_types.py +0 -0
  66. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/tracing/ingest_client.py +0 -0
  67. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx/util.py +0 -0
  68. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx_python.egg-info/SOURCES.txt +0 -0
  69. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx_python.egg-info/dependency_links.txt +0 -0
  70. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx_python.egg-info/entry_points.txt +0 -0
  71. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx_python.egg-info/not-zip-safe +0 -0
  72. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx_python.egg-info/requires.txt +0 -0
  73. {agentx_python-0.8.1 → agentx_python-0.8.3}/agentx_python.egg-info/top_level.txt +0 -0
  74. {agentx_python-0.8.1 → agentx_python-0.8.3}/setup.cfg +0 -0
  75. {agentx_python-0.8.1 → agentx_python-0.8.3}/setup.py +0 -0
  76. {agentx_python-0.8.1 → agentx_python-0.8.3}/tests/test_deep_dive_fixes.py +0 -0
  77. {agentx_python-0.8.1 → agentx_python-0.8.3}/tests/test_docs_match_sdk.py +0 -0
  78. {agentx_python-0.8.1 → agentx_python-0.8.3}/tests/test_integration.py +0 -0
  79. {agentx_python-0.8.1 → agentx_python-0.8.3}/tests/test_integrations.py +0 -0
  80. {agentx_python-0.8.1 → agentx_python-0.8.3}/tests/test_judge_scorers.py +0 -0
  81. {agentx_python-0.8.1 → agentx_python-0.8.3}/tests/test_pairwise.py +0 -0
  82. {agentx_python-0.8.1 → agentx_python-0.8.3}/tests/test_selfhost_analysis_fallback.py +0 -0
  83. {agentx_python-0.8.1 → agentx_python-0.8.3}/tests/test_span_tree.py +0 -0
  84. {agentx_python-0.8.1 → agentx_python-0.8.3}/tests/test_testing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentx-python
3
- Version: 0.8.1
3
+ Version: 0.8.3
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
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from typing import Any, Dict, List, Literal, Optional, Union
4
- from pydantic import BaseModel, Field, model_validator
4
+ from pydantic import AliasChoices, BaseModel, Field, model_validator
5
5
 
6
6
  # ---------------------------------------------------------------------------
7
7
  # Observable trace
@@ -418,7 +418,11 @@ class RunResultRow(BaseModel):
418
418
  latency_ms: Optional[float] = Field(default=None, alias="latencyMs")
419
419
  input_tokens: Optional[int] = Field(default=None, alias="inputTokens")
420
420
  output_tokens: Optional[int] = Field(default=None, alias="outputTokens")
421
- cosine_similarity: Optional[float] = Field(default=None, alias="cosineSimilarity")
421
+ # Self-host sends vectorSimilarity, the hosted platform cosineSimilarity - accept both
422
+ # (row.cosine_similarity was silently None forever on self-host before this).
423
+ cosine_similarity: Optional[float] = Field(
424
+ default=None, validation_alias=AliasChoices("cosineSimilarity", "vectorSimilarity")
425
+ )
422
426
  jaccard_similarity: Optional[float] = Field(default=None, alias="jaccardSimilarity")
423
427
  bleu_score: Optional[float] = Field(default=None, alias="bleuScore")
424
428
  rouge_score: Optional[float] = Field(default=None, alias="rougeScore")
@@ -468,7 +472,11 @@ class ReportStatistics(BaseModel):
468
472
  average_rating: float = Field(default=0.0, alias="averageRating")
469
473
  min_rating: float = Field(default=0.0, alias="minRating")
470
474
  max_rating: float = Field(default=0.0, alias="maxRating")
471
- cosine_similarity: Optional[float] = Field(default=None, alias="cosineSimilarity")
475
+ # Self-host sends vectorSimilarity, the hosted platform cosineSimilarity - accept both
476
+ # (row.cosine_similarity was silently None forever on self-host before this).
477
+ cosine_similarity: Optional[float] = Field(
478
+ default=None, validation_alias=AliasChoices("cosineSimilarity", "vectorSimilarity")
479
+ )
472
480
  jaccard_similarity: Optional[float] = Field(default=None, alias="jaccardSimilarity")
473
481
  bleu_score: Optional[float] = Field(default=None, alias="bleuScore")
474
482
  rouge_score: Optional[float] = Field(default=None, alias="rougeScore")
@@ -455,6 +455,7 @@ class AgentXCallbackHandler(BaseCallbackHandler):
455
455
  input=node.get("input"),
456
456
  output=node.get("output"),
457
457
  error=node.get("error"),
458
+ span_kind="chain",
458
459
  )
459
460
 
460
461
  llm_count = 0
@@ -470,6 +471,7 @@ class AgentXCallbackHandler(BaseCallbackHandler):
470
471
  model=step.get("model"),
471
472
  input_tokens=step.get("inputTokenSize"),
472
473
  output_tokens=step.get("outputTokenSize"),
474
+ span_kind="llm",
473
475
  )
474
476
  for tc in tool_calls:
475
477
  resolve_parent(tc.get("parent_run_id")).child_span(
@@ -480,6 +482,7 @@ class AgentXCallbackHandler(BaseCallbackHandler):
480
482
  input=tc.get("input"),
481
483
  output=tc.get("output"),
482
484
  error=None if tc.get("success", True) else str(tc.get("output") or "Tool call failed"),
485
+ span_kind="tool",
483
486
  )
484
487
  for step in state.get("retrieval_steps", []):
485
488
  resolve_parent(step.get("parent_run_id")).child_span(
@@ -490,6 +493,7 @@ class AgentXCallbackHandler(BaseCallbackHandler):
490
493
  input=step.get("query"),
491
494
  output=step.get("output"),
492
495
  metadata={"kind": "retrieval"},
496
+ span_kind="retrieval",
493
497
  )
494
498
 
495
499
  def on_chain_end(
@@ -71,6 +71,7 @@ class _TraceSpan:
71
71
  monitor: bool = False,
72
72
  pattern_ids: Optional[List[str]] = None,
73
73
  agent_id: Optional[str] = None,
74
+ span_kind: Optional[str] = None,
74
75
  ) -> None:
75
76
  self._tracer = tracer
76
77
  self.name = name
@@ -84,6 +85,10 @@ class _TraceSpan:
84
85
  # from a prior GET /agents lookup) to pin this trace to that exact agent. None (the
85
86
  # default) resolves from `name` alone server-side, one stable agent per distinct name.
86
87
  self._agent_id = agent_id
88
+ # What kind of step this span is ("agent", "llm", ...), stated rather than left to the
89
+ # backend's fallback ladder. Optional: a root that says nothing still classifies the way
90
+ # it always did, which for the common flat trace (root carries the model) is "llm".
91
+ self._span_kind = span_kind
87
92
  # When True, __exit__ sends synchronously (blocking) instead of enqueueing, so trace_id
88
93
  # is populated by the time the `with` block exits - see Tracer.trace()'s sync param.
89
94
  self._sync = sync
@@ -183,6 +188,7 @@ class _TraceSpan:
183
188
  cache_write_tokens=self._cache_write_tokens or None,
184
189
  span_id=self._span_id,
185
190
  parent_span_id=self._parent_span_id,
191
+ span_kind=self._span_kind,
186
192
  started_at_unix_nano=str(int(self._start * 1_000_000_000)) if self._start else None,
187
193
  )
188
194
  return False # never suppress exceptions
@@ -262,6 +268,7 @@ class _TraceSpan:
262
268
  error: Optional[str] = None,
263
269
  tool_calls: Optional[List[Dict[str, Any]]] = None,
264
270
  metadata: Optional[Dict[str, Any]] = None,
271
+ span_kind: Optional[str] = None,
265
272
  ) -> "_TraceSpan":
266
273
  """
267
274
  Send one real child-span row parented to this span, with explicit timing (the caller's
@@ -318,6 +325,11 @@ class _TraceSpan:
318
325
  wire["tool_calls"] = child.tool_calls
319
326
  if metadata:
320
327
  wire["metadata"] = _safe_serialize(metadata)
328
+ # What kind of step this is, stated rather than left for the backend to guess from the
329
+ # span's name and which columns happen to be null. Same idea as LangSmith's run_type and
330
+ # Langfuse's observation type; the engine folds other vocabularies onto its own.
331
+ if span_kind:
332
+ wire["span_kind"] = span_kind
321
333
  if child._session_id:
322
334
  wire["session_id"] = child._session_id
323
335
  wire["span_id"] = child._span_id
@@ -383,6 +395,9 @@ class _TraceSpan:
383
395
  output_tokens=step.get("outputTokenSize"),
384
396
  cache_read_tokens=step.get("cacheReadTokenSize"),
385
397
  cache_write_tokens=step.get("cacheWriteTokenSize"),
398
+ # Stated, so a step named anything other than "LLM Call N" still classifies -
399
+ # the backend's name regex was the only thing holding this together.
400
+ span_kind="llm",
386
401
  )
387
402
  for tc in tool_calls or []:
388
403
  # Some callers' tool_calls dicts (e.g. langchain.py's, which sets these on the
@@ -399,6 +414,7 @@ class _TraceSpan:
399
414
  input=tc.get("input"),
400
415
  output=tc.get("output"),
401
416
  error=None if tc.get("success", True) else str(tc.get("output") or "Tool call failed"),
417
+ span_kind="tool",
402
418
  )
403
419
  # Also mirror onto this span's own flat tool_calls list, sent in this span's own
404
420
  # wire payload on __exit__ (see tool_calls=self.tool_calls or None below). The
@@ -424,6 +440,7 @@ class _TraceSpan:
424
440
  input=step.get("query"),
425
441
  output=step.get("output"),
426
442
  metadata={"kind": "retrieval"},
443
+ span_kind="retrieval",
427
444
  )
428
445
 
429
446
  if self.input is None and input is not None:
@@ -665,6 +682,7 @@ class Tracer:
665
682
  input=input,
666
683
  output=output,
667
684
  error=error,
685
+ span_kind="tool",
668
686
  )
669
687
  # The child span above is only for the trace detail's span tree - the engine's
670
688
  # built-in "Tool failure" check and the dashboard's Tool quality column read the
@@ -781,6 +799,7 @@ class Tracer:
781
799
  input=query,
782
800
  output=output,
783
801
  metadata={"kind": "retrieval"},
802
+ span_kind="retrieval",
784
803
  )
785
804
 
786
805
  @contextmanager
@@ -823,6 +842,7 @@ class Tracer:
823
842
  monitor: Optional[bool] = None,
824
843
  pattern_ids: Optional[List[str]] = None,
825
844
  agent_id: Optional[str] = None,
845
+ span_kind: Optional[str] = None,
826
846
  ) -> _TraceSpan:
827
847
  """
828
848
  Return a :class:`_TraceSpan` that works as both a decorator and a
@@ -888,6 +908,7 @@ class Tracer:
888
908
  monitor=monitor,
889
909
  pattern_ids=pattern_ids,
890
910
  agent_id=agent_id,
911
+ span_kind=span_kind,
891
912
  )
892
913
 
893
914
  def flush(self, timeout: float = 5.0) -> bool:
@@ -1127,6 +1148,8 @@ class Tracer:
1127
1148
  wire["started_at_unix_nano"] = payload["started_at_unix_nano"]
1128
1149
  if "agent_id" in payload:
1129
1150
  wire["agent_id"] = payload["agent_id"]
1151
+ if "span_kind" in payload:
1152
+ wire["span_kind"] = payload["span_kind"]
1130
1153
 
1131
1154
  pending_tool_calls, self._pending_tool_calls = self._pending_tool_calls, []
1132
1155
  if pending_tool_calls:
@@ -0,0 +1 @@
1
+ VERSION = "0.8.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentx-python
3
- Version: 0.8.1
3
+ Version: 0.8.3
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
@@ -1 +0,0 @@
1
- VERSION = "0.8.1"
File without changes
File without changes
File without changes
File without changes