ragaai-catalyst 2.1.4b3__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/data/data_structure.py +1 -1
- ragaai_catalyst/tracers/agentic_tracing/tracers/agent_tracer.py +20 -11
- ragaai_catalyst/tracers/agentic_tracing/tracers/base.py +7 -5
- ragaai_catalyst/tracers/agentic_tracing/tracers/custom_tracer.py +8 -14
- ragaai_catalyst/tracers/agentic_tracing/tracers/langgraph_tracer.py +0 -0
- ragaai_catalyst/tracers/agentic_tracing/tracers/llm_tracer.py +18 -8
- ragaai_catalyst/tracers/agentic_tracing/tracers/main_tracer.py +4 -1
- ragaai_catalyst/tracers/agentic_tracing/tracers/network_tracer.py +14 -14
- ragaai_catalyst/tracers/agentic_tracing/tracers/tool_tracer.py +16 -5
- ragaai_catalyst/tracers/agentic_tracing/tracers/user_interaction_tracer.py +3 -3
- ragaai_catalyst/tracers/agentic_tracing/utils/model_costs.json +14 -0
- ragaai_catalyst/tracers/llamaindex_callback.py +3 -3
- ragaai_catalyst/tracers/tracer.py +1 -1
- {ragaai_catalyst-2.1.4b3.dist-info → ragaai_catalyst-2.1.4b5.dist-info}/METADATA +1 -1
- {ragaai_catalyst-2.1.4b3.dist-info → ragaai_catalyst-2.1.4b5.dist-info}/RECORD +17 -16
- {ragaai_catalyst-2.1.4b3.dist-info → ragaai_catalyst-2.1.4b5.dist-info}/WHEEL +0 -0
- {ragaai_catalyst-2.1.4b3.dist-info → ragaai_catalyst-2.1.4b5.dist-info}/top_level.txt +0 -0
@@ -218,7 +218,7 @@ class Component:
|
|
218
218
|
id=interaction.get("id", str(uuid.uuid4())),
|
219
219
|
type=interaction.get("interaction_type", ""),
|
220
220
|
content=str(interaction.get("content", "")),
|
221
|
-
timestamp=interaction.get("timestamp", datetime.
|
221
|
+
timestamp=interaction.get("timestamp", datetime.now().astimezone().isoformat())
|
222
222
|
)
|
223
223
|
)
|
224
224
|
else:
|
@@ -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
|
|
@@ -117,7 +119,7 @@ class AgentTracerMixin:
|
|
117
119
|
agent_type=agent_type,
|
118
120
|
version=version,
|
119
121
|
capabilities=capabilities or [],
|
120
|
-
start_time=datetime.now(),
|
122
|
+
start_time=datetime.now().astimezone().isoformat(),
|
121
123
|
memory_used=0,
|
122
124
|
input_data=tracer._sanitize_input(args, kwargs),
|
123
125
|
output_data=None,
|
@@ -167,7 +169,7 @@ class AgentTracerMixin:
|
|
167
169
|
children_token = tracer.agent_children.set([])
|
168
170
|
|
169
171
|
try:
|
170
|
-
start_time = datetime.now()
|
172
|
+
start_time = datetime.now().astimezone().isoformat()
|
171
173
|
result = method(self, *args, **kwargs)
|
172
174
|
|
173
175
|
# Update agent component with method result
|
@@ -183,7 +185,7 @@ class AgentTracerMixin:
|
|
183
185
|
tracer._sanitize_input(args, kwargs)
|
184
186
|
)
|
185
187
|
component["start_time"] = (
|
186
|
-
start_time
|
188
|
+
start_time
|
187
189
|
)
|
188
190
|
|
189
191
|
# Get children accumulated during method execution
|
@@ -265,7 +267,7 @@ class AgentTracerMixin:
|
|
265
267
|
if not self.auto_instrument_agent:
|
266
268
|
return func(*args, **kwargs)
|
267
269
|
|
268
|
-
start_time = datetime.now()
|
270
|
+
start_time = datetime.now().astimezone().isoformat()
|
269
271
|
self.start_time = start_time
|
270
272
|
self.input_data = self._sanitize_input(args, kwargs)
|
271
273
|
start_memory = psutil.Process().memory_info().rss
|
@@ -390,7 +392,7 @@ class AgentTracerMixin:
|
|
390
392
|
if not self.auto_instrument_agent:
|
391
393
|
return await func(*args, **kwargs)
|
392
394
|
|
393
|
-
start_time = datetime.now()
|
395
|
+
start_time = datetime.now().astimezone().isoformat()
|
394
396
|
start_memory = psutil.Process().memory_info().rss
|
395
397
|
component_id = str(uuid.uuid4())
|
396
398
|
|
@@ -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"],
|
@@ -533,7 +542,7 @@ class AgentTracerMixin:
|
|
533
542
|
"source_hash_id": None,
|
534
543
|
"type": "agent",
|
535
544
|
"name": kwargs["name"],
|
536
|
-
"start_time": start_time
|
545
|
+
"start_time": start_time,
|
537
546
|
"end_time": datetime.now().astimezone().isoformat(),
|
538
547
|
"error": kwargs.get("error"),
|
539
548
|
"parent_id": kwargs.get("parent_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
|
@@ -170,11 +171,11 @@ class BaseTracer:
|
|
170
171
|
self.trace_id = str(uuid.uuid4())
|
171
172
|
|
172
173
|
# Get the start time
|
173
|
-
self.start_time = datetime.now().isoformat()
|
174
|
+
self.start_time = datetime.now().astimezone().isoformat()
|
174
175
|
|
175
176
|
self.data_key = [
|
176
177
|
{
|
177
|
-
"start_time": datetime.now().isoformat(),
|
178
|
+
"start_time": datetime.now().astimezone().isoformat(),
|
178
179
|
"end_time": "",
|
179
180
|
"spans": self.components,
|
180
181
|
}
|
@@ -184,7 +185,7 @@ class BaseTracer:
|
|
184
185
|
id=self.trace_id,
|
185
186
|
trace_name=self.trace_name,
|
186
187
|
project_name=self.project_name,
|
187
|
-
start_time=datetime.now().isoformat(),
|
188
|
+
start_time=datetime.now().astimezone().isoformat(),
|
188
189
|
end_time="", # Will be set when trace is stopped
|
189
190
|
metadata=metadata,
|
190
191
|
data=self.data_key,
|
@@ -194,8 +195,8 @@ class BaseTracer:
|
|
194
195
|
def stop(self):
|
195
196
|
"""Stop the trace and save to JSON file"""
|
196
197
|
if hasattr(self, "trace"):
|
197
|
-
self.trace.data[0]["end_time"] = datetime.now().isoformat()
|
198
|
-
self.trace.end_time = datetime.now().isoformat()
|
198
|
+
self.trace.data[0]["end_time"] = datetime.now().astimezone().isoformat()
|
199
|
+
self.trace.end_time = datetime.now().astimezone().isoformat()
|
199
200
|
|
200
201
|
# Change span ids to int
|
201
202
|
self.trace = self._change_span_ids_to_int(self.trace)
|
@@ -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
|
+
|
@@ -69,7 +69,7 @@ class CustomTracerMixin:
|
|
69
69
|
if not self.is_active or not self.auto_instrument_custom:
|
70
70
|
return func(*args, **kwargs)
|
71
71
|
|
72
|
-
start_time = datetime.now().astimezone()
|
72
|
+
start_time = datetime.now().astimezone().isoformat()
|
73
73
|
start_memory = psutil.Process().memory_info().rss
|
74
74
|
component_id = str(uuid.uuid4())
|
75
75
|
hash_id = generate_unique_hash_simple(func)
|
@@ -100,7 +100,7 @@ class CustomTracerMixin:
|
|
100
100
|
result = func(*args, **kwargs)
|
101
101
|
|
102
102
|
# Calculate resource usage
|
103
|
-
end_time = datetime.now().astimezone()
|
103
|
+
end_time = datetime.now().astimezone().isoformat()
|
104
104
|
end_memory = psutil.Process().memory_info().rss
|
105
105
|
memory_used = max(0, end_memory - start_memory)
|
106
106
|
|
@@ -136,7 +136,7 @@ class CustomTracerMixin:
|
|
136
136
|
# End tracking network calls for this component
|
137
137
|
self.end_component(component_id)
|
138
138
|
|
139
|
-
end_time = datetime.now().astimezone()
|
139
|
+
end_time = datetime.now().astimezone().isoformat()
|
140
140
|
|
141
141
|
custom_component = self.create_custom_component(
|
142
142
|
component_id=component_id,
|
@@ -155,16 +155,13 @@ class CustomTracerMixin:
|
|
155
155
|
|
156
156
|
self.add_component(custom_component)
|
157
157
|
raise
|
158
|
-
finally:
|
159
|
-
if trace_variables:
|
160
|
-
sys.settrace(None)
|
161
158
|
|
162
159
|
async def _trace_custom_execution(self, func, name, custom_type, version, trace_variables, *args, **kwargs):
|
163
160
|
"""Asynchronous version of custom tracing"""
|
164
161
|
if not self.is_active or not self.auto_instrument_custom:
|
165
162
|
return await func(*args, **kwargs)
|
166
163
|
|
167
|
-
start_time = datetime.now().astimezone()
|
164
|
+
start_time = datetime.now().astimezone().isoformat()
|
168
165
|
start_memory = psutil.Process().memory_info().rss
|
169
166
|
component_id = str(uuid.uuid4())
|
170
167
|
hash_id = generate_unique_hash_simple(func)
|
@@ -191,7 +188,7 @@ class CustomTracerMixin:
|
|
191
188
|
result = await func(*args, **kwargs)
|
192
189
|
|
193
190
|
# Calculate resource usage
|
194
|
-
end_time = datetime.now().astimezone()
|
191
|
+
end_time = datetime.now().astimezone().isoformat()
|
195
192
|
end_memory = psutil.Process().memory_info().rss
|
196
193
|
memory_used = max(0, end_memory - start_memory)
|
197
194
|
|
@@ -220,7 +217,7 @@ class CustomTracerMixin:
|
|
220
217
|
"details": {}
|
221
218
|
}
|
222
219
|
|
223
|
-
end_time = datetime.now().astimezone()
|
220
|
+
end_time = datetime.now().astimezone().isoformat()
|
224
221
|
|
225
222
|
custom_component = self.create_custom_component(
|
226
223
|
component_id=component_id,
|
@@ -238,9 +235,6 @@ class CustomTracerMixin:
|
|
238
235
|
)
|
239
236
|
self.add_component(custom_component)
|
240
237
|
raise
|
241
|
-
finally:
|
242
|
-
if trace_variables:
|
243
|
-
sys.settrace(None)
|
244
238
|
|
245
239
|
def create_custom_component(self, **kwargs):
|
246
240
|
"""Create a custom component according to the data structure"""
|
@@ -260,8 +254,8 @@ class CustomTracerMixin:
|
|
260
254
|
"source_hash_id": None,
|
261
255
|
"type": "custom",
|
262
256
|
"name": kwargs["name"],
|
263
|
-
"start_time": start_time
|
264
|
-
"end_time": kwargs["end_time"]
|
257
|
+
"start_time": start_time,
|
258
|
+
"end_time": kwargs["end_time"],
|
265
259
|
"error": kwargs.get("error"),
|
266
260
|
"parent_id": self.current_agent_id.get() if hasattr(self, 'current_agent_id') else None,
|
267
261
|
"info": {
|
File without changes
|
@@ -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
|
|
@@ -665,7 +675,7 @@ class LLMTracerMixin:
|
|
665
675
|
"type": type(e).__name__,
|
666
676
|
"message": str(e),
|
667
677
|
"traceback": traceback.format_exc(),
|
668
|
-
"timestamp": datetime.now().isoformat(),
|
678
|
+
"timestamp": datetime.now().astimezone().isoformat(),
|
669
679
|
}
|
670
680
|
}
|
671
681
|
raise
|
@@ -708,7 +718,7 @@ class LLMTracerMixin:
|
|
708
718
|
parent_agent_id = self.current_agent_id.get()
|
709
719
|
self.start_component(component_id)
|
710
720
|
|
711
|
-
start_time = datetime.now()
|
721
|
+
start_time = datetime.now().astimezone().isoformat()
|
712
722
|
error_info = None
|
713
723
|
result = None
|
714
724
|
|
@@ -721,7 +731,7 @@ class LLMTracerMixin:
|
|
721
731
|
"type": type(e).__name__,
|
722
732
|
"message": str(e),
|
723
733
|
"traceback": traceback.format_exc(),
|
724
|
-
"timestamp": datetime.now().isoformat(),
|
734
|
+
"timestamp": datetime.now().astimezone().isoformat(),
|
725
735
|
}
|
726
736
|
}
|
727
737
|
raise
|
@@ -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
|
|
@@ -346,7 +349,7 @@ class AgenticTracing(
|
|
346
349
|
version=self.version.get(),
|
347
350
|
capabilities=self.capabilities.get(),
|
348
351
|
start_time=self.start_time,
|
349
|
-
end_time=datetime.now(),
|
352
|
+
end_time=datetime.now().astimezone().isoformat(),
|
350
353
|
memory_used=0,
|
351
354
|
input_data=self.input_data,
|
352
355
|
output_data=None,
|
@@ -105,10 +105,10 @@ def monkey_patch_urllib(network_tracer):
|
|
105
105
|
method = url.get_method()
|
106
106
|
url_str = url.full_url
|
107
107
|
|
108
|
-
start_time = datetime.now()
|
108
|
+
start_time = datetime.now().astimezone()
|
109
109
|
try:
|
110
110
|
response = original_urlopen(url, data, timeout, *args, **kwargs)
|
111
|
-
end_time = datetime.now()
|
111
|
+
end_time = datetime.now().astimezone()
|
112
112
|
network_tracer.record_call(
|
113
113
|
method=method,
|
114
114
|
url=url_str,
|
@@ -122,7 +122,7 @@ def monkey_patch_urllib(network_tracer):
|
|
122
122
|
)
|
123
123
|
return response
|
124
124
|
except Exception as e:
|
125
|
-
end_time = datetime.now()
|
125
|
+
end_time = datetime.now().astimezone()
|
126
126
|
network_tracer.record_call(
|
127
127
|
method=method,
|
128
128
|
url=url_str,
|
@@ -144,10 +144,10 @@ def monkey_patch_requests(network_tracer):
|
|
144
144
|
original_request = requests.Session.request
|
145
145
|
|
146
146
|
def patched_request(self, method, url, *args, **kwargs):
|
147
|
-
start_time = datetime.now()
|
147
|
+
start_time = datetime.now().astimezone()
|
148
148
|
try:
|
149
149
|
response = original_request(self, method, url, *args, **kwargs)
|
150
|
-
end_time = datetime.now()
|
150
|
+
end_time = datetime.now().astimezone()
|
151
151
|
network_tracer.record_call(
|
152
152
|
method=method,
|
153
153
|
url=url,
|
@@ -161,7 +161,7 @@ def monkey_patch_requests(network_tracer):
|
|
161
161
|
)
|
162
162
|
return response
|
163
163
|
except Exception as e:
|
164
|
-
end_time = datetime.now()
|
164
|
+
end_time = datetime.now().astimezone()
|
165
165
|
network_tracer.record_call(
|
166
166
|
method=method,
|
167
167
|
url=url,
|
@@ -184,7 +184,7 @@ def monkey_patch_http_client(network_tracer):
|
|
184
184
|
original_https_request = HTTPSConnection.request
|
185
185
|
|
186
186
|
def patched_request(self, method, url, body=None, headers=None, *args, **kwargs):
|
187
|
-
start_time = datetime.now()
|
187
|
+
start_time = datetime.now().astimezone()
|
188
188
|
try:
|
189
189
|
result = (
|
190
190
|
original_http_request(self, method, url, body, headers, *args, **kwargs)
|
@@ -194,7 +194,7 @@ def monkey_patch_http_client(network_tracer):
|
|
194
194
|
)
|
195
195
|
)
|
196
196
|
response = self.getresponse()
|
197
|
-
end_time = datetime.now()
|
197
|
+
end_time = datetime.now().astimezone()
|
198
198
|
network_tracer.record_call(
|
199
199
|
method=method,
|
200
200
|
url=f"{self._http_vsn_str} {self.host}:{self.port}{url}",
|
@@ -208,7 +208,7 @@ def monkey_patch_http_client(network_tracer):
|
|
208
208
|
)
|
209
209
|
return result
|
210
210
|
except Exception as e:
|
211
|
-
end_time = datetime.now()
|
211
|
+
end_time = datetime.now().astimezone()
|
212
212
|
network_tracer.record_call(
|
213
213
|
method=method,
|
214
214
|
url=f"{self._http_vsn_str} {self.host}:{self.port}{url}",
|
@@ -233,10 +233,10 @@ def monkey_patch_socket(network_tracer):
|
|
233
233
|
|
234
234
|
def patched_create_connection(address, *args, **kwargs):
|
235
235
|
host, port = address
|
236
|
-
start_time = datetime.now()
|
236
|
+
start_time = datetime.now().astimezone()
|
237
237
|
try:
|
238
238
|
result = original_create_connection(address, *args, **kwargs)
|
239
|
-
end_time = datetime.now()
|
239
|
+
end_time = datetime.now().astimezone()
|
240
240
|
network_tracer.record_call(
|
241
241
|
method="CONNECT",
|
242
242
|
url=f"{host}:{port}",
|
@@ -245,7 +245,7 @@ def monkey_patch_socket(network_tracer):
|
|
245
245
|
)
|
246
246
|
return result
|
247
247
|
except Exception as e:
|
248
|
-
end_time = datetime.now()
|
248
|
+
end_time = datetime.now().astimezone()
|
249
249
|
network_tracer.record_call(
|
250
250
|
method="CONNECT",
|
251
251
|
url=f"{host}:{port}",
|
@@ -265,10 +265,10 @@ def restore_socket(original_create_connection):
|
|
265
265
|
|
266
266
|
async def patch_aiohttp_trace_config(network_tracer):
|
267
267
|
async def on_request_start(session, trace_config_ctx, params):
|
268
|
-
trace_config_ctx.start = datetime.now()
|
268
|
+
trace_config_ctx.start = datetime.now().astimezone()
|
269
269
|
|
270
270
|
async def on_request_end(session, trace_config_ctx, params):
|
271
|
-
end_time = datetime.now()
|
271
|
+
end_time = datetime.now().astimezone()
|
272
272
|
response = params.response
|
273
273
|
network_tracer.record_call(
|
274
274
|
method=params.method,
|
@@ -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 = {
|
@@ -58,7 +58,7 @@ class UserInteractionTracer:
|
|
58
58
|
"component_id": self.component_id.get(),
|
59
59
|
"interaction_type": "input",
|
60
60
|
"content": content,
|
61
|
-
"timestamp": datetime.now().isoformat()
|
61
|
+
"timestamp": datetime.now().astimezone().isoformat()
|
62
62
|
})
|
63
63
|
return content
|
64
64
|
|
@@ -70,7 +70,7 @@ class UserInteractionTracer:
|
|
70
70
|
"component_id": self.component_id.get(),
|
71
71
|
"interaction_type": "output",
|
72
72
|
"content": content,
|
73
|
-
"timestamp": datetime.now().isoformat()
|
73
|
+
"timestamp": datetime.now().astimezone().isoformat()
|
74
74
|
})
|
75
75
|
return self.original_print(*args, **kwargs)
|
76
76
|
|
@@ -112,7 +112,7 @@ class UserInteractionTracer:
|
|
112
112
|
"component_id": self.component_id.get(),
|
113
113
|
"interaction_type": interaction_type,
|
114
114
|
"file_path": file_path,
|
115
|
-
"timestamp": datetime.now().isoformat()
|
115
|
+
"timestamp": datetime.now().astimezone().isoformat()
|
116
116
|
}
|
117
117
|
interaction.update(kwargs)
|
118
118
|
self.interactions.append(interaction)
|
@@ -1959,6 +1959,20 @@
|
|
1959
1959
|
"litellm_provider": "mistral",
|
1960
1960
|
"mode": "embedding"
|
1961
1961
|
},
|
1962
|
+
"deepseek/deepseek-reasoner": {
|
1963
|
+
"max_tokens": 8192,
|
1964
|
+
"max_input_tokens": 64000,
|
1965
|
+
"max_output_tokens": 8192,
|
1966
|
+
"input_cost_per_token": 5.5e-07,
|
1967
|
+
"input_cost_per_token_cache_hit": 1.4e-07,
|
1968
|
+
"output_cost_per_token": 2.19e-06,
|
1969
|
+
"litellm_provider": "deepseek",
|
1970
|
+
"mode": "chat",
|
1971
|
+
"supports_function_calling": true,
|
1972
|
+
"supports_assistant_prefill": true,
|
1973
|
+
"supports_tool_choice": true,
|
1974
|
+
"supports_prompt_caching": true
|
1975
|
+
},
|
1962
1976
|
"deepseek/deepseek-chat": {
|
1963
1977
|
"max_tokens": 4096,
|
1964
1978
|
"max_input_tokens": 128000,
|
@@ -58,7 +58,7 @@ class LlamaIndexTracer:
|
|
58
58
|
) -> None:
|
59
59
|
trace = {
|
60
60
|
"event_type": event_type,
|
61
|
-
"timestamp": datetime.now().isoformat(),
|
61
|
+
"timestamp": datetime.now().astimezone().isoformat(),
|
62
62
|
"payload": payload,
|
63
63
|
"status": "started",
|
64
64
|
"event_id": event_id,
|
@@ -82,7 +82,7 @@ class LlamaIndexTracer:
|
|
82
82
|
) -> None:
|
83
83
|
trace = {
|
84
84
|
"event_type": event_type,
|
85
|
-
"timestamp": datetime.now().isoformat(),
|
85
|
+
"timestamp": datetime.now().astimezone().isoformat(),
|
86
86
|
"payload": payload,
|
87
87
|
"status": "completed",
|
88
88
|
"event_id": event_id,
|
@@ -220,7 +220,7 @@ class LlamaIndexTracer:
|
|
220
220
|
user_detail["trace_id"] = self._generate_trace_id()
|
221
221
|
metadata = user_detail["metadata"]
|
222
222
|
metadata["log_source"] = "llamaindex_tracer"
|
223
|
-
metadata["recorded_on"] = datetime.
|
223
|
+
metadata["recorded_on"] = datetime.now().astimezone().replace('T', ' ')
|
224
224
|
user_detail["metadata"] = metadata
|
225
225
|
return user_detail
|
226
226
|
|
@@ -116,7 +116,7 @@ class Tracer(AgenticTracing):
|
|
116
116
|
self.base_url = f"{RagaAICatalyst.BASE_URL}"
|
117
117
|
self.timeout = 30
|
118
118
|
self.num_projects = 100
|
119
|
-
self.start_time = datetime.datetime.now(
|
119
|
+
self.start_time = datetime.datetime.now().astimezone().isoformat()
|
120
120
|
|
121
121
|
if update_llm_cost:
|
122
122
|
# First update the model costs file from GitHub
|
@@ -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
|
@@ -12,13 +12,13 @@ ragaai_catalyst/ragaai_catalyst.py,sha256=FdqMzwuQLqS2-3JJDsTQ8uh2itllOxfPrRUjb8
|
|
12
12
|
ragaai_catalyst/synthetic_data_generation.py,sha256=uDV9tNwto2xSkWg5XHXUvjErW-4P34CTrxaJpRfezyA,19250
|
13
13
|
ragaai_catalyst/utils.py,sha256=TlhEFwLyRU690HvANbyoRycR3nQ67lxVUQoUOfTPYQ0,3772
|
14
14
|
ragaai_catalyst/tracers/__init__.py,sha256=yxepo7iVjTNI_wFdk3Z6Ghu64SazVyszCPEHYrX5WQk,50
|
15
|
-
ragaai_catalyst/tracers/llamaindex_callback.py,sha256=
|
16
|
-
ragaai_catalyst/tracers/tracer.py,sha256=
|
15
|
+
ragaai_catalyst/tracers/llamaindex_callback.py,sha256=HGs0TgtSgn8xXL8CSgdL9ymvYQGxZCNmPY5tRTw-I4s,14047
|
16
|
+
ragaai_catalyst/tracers/tracer.py,sha256=4RaLmtAvVA-KT-O4Oi5T-VLVFmKqhbWjHYNxuQ6Fktk,15585
|
17
17
|
ragaai_catalyst/tracers/upload_traces.py,sha256=hs0PEmit3n3_uUqrdbwcBdyK5Nbkik3JQVwJMEwYTd4,4796
|
18
18
|
ragaai_catalyst/tracers/agentic_tracing/README.md,sha256=X4QwLb7-Jg7GQMIXj-SerZIgDETfw-7VgYlczOR8ZeQ,4508
|
19
19
|
ragaai_catalyst/tracers/agentic_tracing/__init__.py,sha256=yf6SKvOPSpH-9LiKaoLKXwqj5sez8F_5wkOb91yp0oE,260
|
20
20
|
ragaai_catalyst/tracers/agentic_tracing/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
|
-
ragaai_catalyst/tracers/agentic_tracing/data/data_structure.py,sha256=
|
21
|
+
ragaai_catalyst/tracers/agentic_tracing/data/data_structure.py,sha256=nFnwqL1-Uznwndi2ugDnhziUbIASlcBYnM6Dyq7pPt8,9243
|
22
22
|
ragaai_catalyst/tracers/agentic_tracing/tests/FinancialAnalysisSystem.ipynb,sha256=0qZxjWqYCTAVvdo3Tsp544D8Am48wfeMQ9RKpKgAL8g,34291
|
23
23
|
ragaai_catalyst/tracers/agentic_tracing/tests/GameActivityEventPlanner.ipynb,sha256=QCMFJYbGX0fd9eMW4PqyQLZjyWuTXo7n1nqO_hMLf0s,4225
|
24
24
|
ragaai_catalyst/tracers/agentic_tracing/tests/TravelPlanner.ipynb,sha256=fU3inXoemJbdTkGAQl_N1UwVEZ10LrKv4gCEpbQ4ISg,43481
|
@@ -26,14 +26,15 @@ 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=
|
31
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/custom_tracer.py,sha256=
|
32
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/
|
33
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/
|
34
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/
|
35
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/
|
36
|
-
ragaai_catalyst/tracers/agentic_tracing/tracers/
|
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
|
+
ragaai_catalyst/tracers/agentic_tracing/tracers/custom_tracer.py,sha256=uay8lU7T-CKsVu8KvWX31qfMqufK9S3Ive7XKo2Ksmk,12252
|
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=VmPxlIQBo58ewf1vyi34gqw7M4YviRmb5KgnSQMdejY,29331
|
34
|
+
ragaai_catalyst/tracers/agentic_tracing/tracers/main_tracer.py,sha256=nxUOQSyWBTnbsZfxmr1lje2OggqNf9fwtGUb-sBo6mI,15215
|
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=XUDWn9F07lzrhFTaKcLZyJnLjIbFaucNGSHDgDQqxks,12169
|
37
|
+
ragaai_catalyst/tracers/agentic_tracing/tracers/user_interaction_tracer.py,sha256=bhSUhNQCuJXKjgJAXhjKEYjnHMpYN90FSZdR84fNIKU,4614
|
37
38
|
ragaai_catalyst/tracers/agentic_tracing/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
39
|
ragaai_catalyst/tracers/agentic_tracing/upload/upload_agentic_traces.py,sha256=1MDKXAAPzOEdxFKWWQrRgrmM3kz--DGXSywGXQmR3lQ,6041
|
39
40
|
ragaai_catalyst/tracers/agentic_tracing/upload/upload_code.py,sha256=HgpMgI-JTWZrizcM7GGUIaAgaZF4aRT3D0dJXVEkblY,4271
|
@@ -45,7 +46,7 @@ ragaai_catalyst/tracers/agentic_tracing/utils/file_name_tracker.py,sha256=515NND
|
|
45
46
|
ragaai_catalyst/tracers/agentic_tracing/utils/generic.py,sha256=WwXT01xmp8MSr7KinuDCSK9a1ifpLcT7ajFkvYviG_A,1190
|
46
47
|
ragaai_catalyst/tracers/agentic_tracing/utils/get_user_trace_metrics.py,sha256=vPZ4dn4EHFW0kqd1GyRpsYXbfrRrd0DXCmh-pzsDBNE,1109
|
47
48
|
ragaai_catalyst/tracers/agentic_tracing/utils/llm_utils.py,sha256=wlXCuaRe81s-7FWdJ_MquXFGRZZfNrZxLIIxl-Ohbqk,15541
|
48
|
-
ragaai_catalyst/tracers/agentic_tracing/utils/model_costs.json,sha256=
|
49
|
+
ragaai_catalyst/tracers/agentic_tracing/utils/model_costs.json,sha256=weznWpRd6N5X-O8lkzVA6nd5LSYJKa62s3GZL51NQpU,293833
|
49
50
|
ragaai_catalyst/tracers/agentic_tracing/utils/span_attributes.py,sha256=MqeRNGxzeuh9qTK0NbYMftl9V9Z0V7gMgBoHkrXP56k,1592
|
50
51
|
ragaai_catalyst/tracers/agentic_tracing/utils/trace_utils.py,sha256=RciiDdo2riibEoM8X0FKHaXi78y3bWwNkV8U0leqigk,3508
|
51
52
|
ragaai_catalyst/tracers/agentic_tracing/utils/unique_decorator.py,sha256=DQHjcEuqEKsNSWaNs7SoOaq50yK4Jsl966S7mBnV-zA,5723
|
@@ -59,7 +60,7 @@ ragaai_catalyst/tracers/instrumentators/llamaindex.py,sha256=SMrRlR4xM7k9HK43hak
|
|
59
60
|
ragaai_catalyst/tracers/instrumentators/openai.py,sha256=14R4KW9wQCR1xysLfsP_nxS7cqXrTPoD8En4MBAaZUU,379
|
60
61
|
ragaai_catalyst/tracers/utils/__init__.py,sha256=KeMaZtYaTojilpLv65qH08QmpYclfpacDA0U3wg6Ybw,64
|
61
62
|
ragaai_catalyst/tracers/utils/utils.py,sha256=ViygfJ7vZ7U0CTSA1lbxVloHp4NSlmfDzBRNCJuMhis,2374
|
62
|
-
ragaai_catalyst-2.1.
|
63
|
-
ragaai_catalyst-2.1.
|
64
|
-
ragaai_catalyst-2.1.
|
65
|
-
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
|