ragaai-catalyst 2.1.4b4__py3-none-any.whl → 2.1.4b5__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.
- ragaai_catalyst/tracers/agentic_tracing/tracers/agent_tracer.py +14 -5
- ragaai_catalyst/tracers/agentic_tracing/tracers/base.py +2 -0
- ragaai_catalyst/tracers/agentic_tracing/tracers/llm_tracer.py +15 -5
- ragaai_catalyst/tracers/agentic_tracing/tracers/main_tracer.py +3 -0
- ragaai_catalyst/tracers/agentic_tracing/tracers/tool_tracer.py +16 -5
- {ragaai_catalyst-2.1.4b4.dist-info → ragaai_catalyst-2.1.4b5.dist-info}/METADATA +1 -1
- {ragaai_catalyst-2.1.4b4.dist-info → ragaai_catalyst-2.1.4b5.dist-info}/RECORD +9 -9
- {ragaai_catalyst-2.1.4b4.dist-info → ragaai_catalyst-2.1.4b5.dist-info}/WHEEL +0 -0
- {ragaai_catalyst-2.1.4b4.dist-info → ragaai_catalyst-2.1.4b5.dist-info}/top_level.txt +0 -0
@@ -66,8 +66,8 @@ class AgentTracerMixin:
|
|
66
66
|
if metrics:
|
67
67
|
if isinstance(metrics, dict):
|
68
68
|
metrics = [metrics]
|
69
|
-
|
70
|
-
|
69
|
+
try:
|
70
|
+
for metric in metrics:
|
71
71
|
self.span(name).add_metrics(
|
72
72
|
name=metric["name"],
|
73
73
|
score=metric["score"],
|
@@ -77,8 +77,10 @@ class AgentTracerMixin:
|
|
77
77
|
metadata=metric.get("metadata", {}),
|
78
78
|
config=metric.get("config", {}),
|
79
79
|
)
|
80
|
-
|
81
|
-
|
80
|
+
except ValueError as e:
|
81
|
+
logger.error(f"Validation Error: {e}")
|
82
|
+
except Exception as e:
|
83
|
+
logger.error(f"Error adding metric: {e}")
|
82
84
|
if feedback:
|
83
85
|
self.span(name).add_feedback(feedback)
|
84
86
|
|
@@ -525,7 +527,14 @@ class AgentTracerMixin:
|
|
525
527
|
# metrics
|
526
528
|
metrics = []
|
527
529
|
if name in self.span_attributes_dict:
|
528
|
-
|
530
|
+
raw_metrics = self.span_attributes_dict[name].metrics or []
|
531
|
+
# Check for duplicates
|
532
|
+
for metric in raw_metrics:
|
533
|
+
metric_name = metric["name"]
|
534
|
+
if self.visited_metrics.count(metric_name) >= 1:
|
535
|
+
raise ValueError(f"Duplicate metric '{metric_name}' found in trace. Metric names must be unique across all spans.")
|
536
|
+
self.visited_metrics.append(metric_name)
|
537
|
+
metrics.append(metric)
|
529
538
|
|
530
539
|
component = {
|
531
540
|
"id": kwargs["component_id"],
|
@@ -78,6 +78,7 @@ class BaseTracer:
|
|
78
78
|
self.dataset_name = self.user_details["dataset_name"] # Access the dataset_name
|
79
79
|
self.project_id = self.user_details["project_id"] # Access the project_id
|
80
80
|
self.trace_name = self.user_details["trace_name"] # Access the trace_name
|
81
|
+
self.visited_metrics = []
|
81
82
|
|
82
83
|
# Initialize trace data
|
83
84
|
self.trace_id = None
|
@@ -802,3 +803,4 @@ class BaseTracer:
|
|
802
803
|
if span_name not in self.span_attributes_dict:
|
803
804
|
self.span_attributes_dict[span_name] = SpanAttributes(span_name)
|
804
805
|
return self.span_attributes_dict[span_name]
|
806
|
+
|
@@ -363,7 +363,14 @@ class LLMTracerMixin:
|
|
363
363
|
# metrics
|
364
364
|
metrics = []
|
365
365
|
if name in self.span_attributes_dict:
|
366
|
-
|
366
|
+
raw_metrics = self.span_attributes_dict[name].metrics or []
|
367
|
+
# Check for duplicates
|
368
|
+
for metric in raw_metrics:
|
369
|
+
metric_name = metric["name"]
|
370
|
+
if self.visited_metrics.count(metric_name) >= 1:
|
371
|
+
raise ValueError(f"Duplicate metric '{metric_name}' found in trace. Metric names must be unique across all spans.")
|
372
|
+
self.visited_metrics.append(metric_name)
|
373
|
+
metrics.append(metric)
|
367
374
|
|
368
375
|
component = {
|
369
376
|
"id": component_id,
|
@@ -621,8 +628,8 @@ class LLMTracerMixin:
|
|
621
628
|
if metrics:
|
622
629
|
if isinstance(metrics, dict):
|
623
630
|
metrics = [metrics]
|
624
|
-
|
625
|
-
|
631
|
+
try:
|
632
|
+
for metric in metrics:
|
626
633
|
self.span(name).add_metrics(
|
627
634
|
name=metric["name"],
|
628
635
|
score=metric["score"],
|
@@ -632,8 +639,11 @@ class LLMTracerMixin:
|
|
632
639
|
metadata=metric.get("metadata", {}),
|
633
640
|
config=metric.get("config", {}),
|
634
641
|
)
|
635
|
-
|
636
|
-
|
642
|
+
except ValueError as e:
|
643
|
+
logger.error(f"Validation Error: {e}")
|
644
|
+
except Exception as e:
|
645
|
+
logger.error(f"Error adding metric: {e}")
|
646
|
+
|
637
647
|
if feedback:
|
638
648
|
self.span(name).add_feedback(feedback)
|
639
649
|
|
@@ -209,6 +209,9 @@ class AgenticTracing(
|
|
209
209
|
# Deactivate network tracing
|
210
210
|
self.network_tracer.deactivate_patches()
|
211
211
|
|
212
|
+
# Clear visited metrics when stopping trace
|
213
|
+
self.visited_metrics.clear()
|
214
|
+
|
212
215
|
# Stop base tracer (includes saving to file)
|
213
216
|
super().stop()
|
214
217
|
|
@@ -63,8 +63,8 @@ class ToolTracerMixin:
|
|
63
63
|
if metrics:
|
64
64
|
if isinstance(metrics, dict):
|
65
65
|
metrics = [metrics]
|
66
|
-
|
67
|
-
|
66
|
+
try:
|
67
|
+
for metric in metrics:
|
68
68
|
self.span(name).add_metrics(
|
69
69
|
name=metric["name"],
|
70
70
|
score=metric["score"],
|
@@ -74,8 +74,11 @@ class ToolTracerMixin:
|
|
74
74
|
metadata=metric.get("metadata", {}),
|
75
75
|
config=metric.get("config", {}),
|
76
76
|
)
|
77
|
-
|
78
|
-
logger.error(f"Error
|
77
|
+
except ValueError as e:
|
78
|
+
logger.error(f"Validation Error: {e}")
|
79
|
+
except Exception as e:
|
80
|
+
logger.error(f"Error adding metric: {e}")
|
81
|
+
|
79
82
|
if feedback:
|
80
83
|
self.span(name).add_feedback(feedback)
|
81
84
|
|
@@ -274,8 +277,16 @@ class ToolTracerMixin:
|
|
274
277
|
|
275
278
|
# metrics
|
276
279
|
metrics = []
|
280
|
+
metrics = []
|
277
281
|
if name in self.span_attributes_dict:
|
278
|
-
|
282
|
+
raw_metrics = self.span_attributes_dict[name].metrics or []
|
283
|
+
# Check for duplicates
|
284
|
+
for metric in raw_metrics:
|
285
|
+
metric_name = metric["name"]
|
286
|
+
if self.visited_metrics.count(metric_name) >= 1:
|
287
|
+
raise ValueError(f"Duplicate metric '{metric_name}' found in trace. Metric names must be unique across all spans.")
|
288
|
+
self.visited_metrics.append(metric_name)
|
289
|
+
metrics.append(metric)
|
279
290
|
|
280
291
|
start_time = kwargs["start_time"]
|
281
292
|
component = {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ragaai_catalyst
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.4b5
|
4
4
|
Summary: RAGA AI CATALYST
|
5
5
|
Author-email: Kiran Scaria <kiran.scaria@raga.ai>, Kedar Gaikwad <kedar.gaikwad@raga.ai>, Dushyant Mahajan <dushyant.mahajan@raga.ai>, Siddhartha Kosti <siddhartha.kosti@raga.ai>, Ritika Goel <ritika.goel@raga.ai>, Vijay Chaurasia <vijay.chaurasia@raga.ai>
|
6
6
|
Requires-Python: <3.13,>=3.9
|
@@ -26,14 +26,14 @@ ragaai_catalyst/tracers/agentic_tracing/tests/__init__.py,sha256=47DEQpj8HBSa-_T
|
|
26
26
|
ragaai_catalyst/tracers/agentic_tracing/tests/ai_travel_agent.py,sha256=S4rCcKzU_5SB62BYEbNn_1VbbTdG4396N8rdZ3ZNGcE,5654
|
27
27
|
ragaai_catalyst/tracers/agentic_tracing/tests/unique_decorator_test.py,sha256=Xk1cLzs-2A3dgyBwRRnCWs7Eubki40FVonwd433hPN8,4805
|
28
28
|
ragaai_catalyst/tracers/agentic_tracing/tracers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/agent_tracer.py,sha256=
|
30
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/base.py,sha256=
|
29
|
+
ragaai_catalyst/tracers/agentic_tracing/tracers/agent_tracer.py,sha256=Xe7LcJWfHphezpHNBlKKU_D-AjjU-c9mNpYWCNZbhoQ,25531
|
30
|
+
ragaai_catalyst/tracers/agentic_tracing/tracers/base.py,sha256=ihB0y54-JmSYLZRH6gmkm73jrqeD0NtuVWswuuq5N1o,31304
|
31
31
|
ragaai_catalyst/tracers/agentic_tracing/tracers/custom_tracer.py,sha256=uay8lU7T-CKsVu8KvWX31qfMqufK9S3Ive7XKo2Ksmk,12252
|
32
32
|
ragaai_catalyst/tracers/agentic_tracing/tracers/langgraph_tracer.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/llm_tracer.py,sha256=
|
34
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/main_tracer.py,sha256=
|
33
|
+
ragaai_catalyst/tracers/agentic_tracing/tracers/llm_tracer.py,sha256=VmPxlIQBo58ewf1vyi34gqw7M4YviRmb5KgnSQMdejY,29331
|
34
|
+
ragaai_catalyst/tracers/agentic_tracing/tracers/main_tracer.py,sha256=nxUOQSyWBTnbsZfxmr1lje2OggqNf9fwtGUb-sBo6mI,15215
|
35
35
|
ragaai_catalyst/tracers/agentic_tracing/tracers/network_tracer.py,sha256=CviGiAg0W0krJxORMBDTosQytIoJDQ5RwU6xt_U_mOg,10408
|
36
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/tool_tracer.py,sha256=
|
36
|
+
ragaai_catalyst/tracers/agentic_tracing/tracers/tool_tracer.py,sha256=XUDWn9F07lzrhFTaKcLZyJnLjIbFaucNGSHDgDQqxks,12169
|
37
37
|
ragaai_catalyst/tracers/agentic_tracing/tracers/user_interaction_tracer.py,sha256=bhSUhNQCuJXKjgJAXhjKEYjnHMpYN90FSZdR84fNIKU,4614
|
38
38
|
ragaai_catalyst/tracers/agentic_tracing/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
39
39
|
ragaai_catalyst/tracers/agentic_tracing/upload/upload_agentic_traces.py,sha256=1MDKXAAPzOEdxFKWWQrRgrmM3kz--DGXSywGXQmR3lQ,6041
|
@@ -60,7 +60,7 @@ ragaai_catalyst/tracers/instrumentators/llamaindex.py,sha256=SMrRlR4xM7k9HK43hak
|
|
60
60
|
ragaai_catalyst/tracers/instrumentators/openai.py,sha256=14R4KW9wQCR1xysLfsP_nxS7cqXrTPoD8En4MBAaZUU,379
|
61
61
|
ragaai_catalyst/tracers/utils/__init__.py,sha256=KeMaZtYaTojilpLv65qH08QmpYclfpacDA0U3wg6Ybw,64
|
62
62
|
ragaai_catalyst/tracers/utils/utils.py,sha256=ViygfJ7vZ7U0CTSA1lbxVloHp4NSlmfDzBRNCJuMhis,2374
|
63
|
-
ragaai_catalyst-2.1.
|
64
|
-
ragaai_catalyst-2.1.
|
65
|
-
ragaai_catalyst-2.1.
|
66
|
-
ragaai_catalyst-2.1.
|
63
|
+
ragaai_catalyst-2.1.4b5.dist-info/METADATA,sha256=7pslb4wedeSS3p7J4rw4Lh8IL70dRP_vNKK0_5giJqE,12770
|
64
|
+
ragaai_catalyst-2.1.4b5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
65
|
+
ragaai_catalyst-2.1.4b5.dist-info/top_level.txt,sha256=HpgsdRgEJMk8nqrU6qdCYk3di7MJkDL0B19lkc7dLfM,16
|
66
|
+
ragaai_catalyst-2.1.4b5.dist-info/RECORD,,
|
File without changes
|
File without changes
|