ragaai-catalyst 2.1.5.1b3__py3-none-any.whl → 2.1.6__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/synthetic_data_generation.py +3 -2
- ragaai_catalyst/tracers/agentic_tracing/upload/trace_uploader.py +1 -1
- ragaai_catalyst/tracers/agentic_tracing/utils/trace_utils.py +371 -0
- ragaai_catalyst/tracers/exporters/ragaai_trace_exporter.py +5 -6
- ragaai_catalyst/tracers/instrumentators/__init__.py +0 -5
- ragaai_catalyst/tracers/tracer.py +185 -35
- ragaai_catalyst/tracers/utils/trace_json_converter.py +37 -5
- {ragaai_catalyst-2.1.5.1b3.dist-info → ragaai_catalyst-2.1.6.dist-info}/METADATA +14 -13
- {ragaai_catalyst-2.1.5.1b3.dist-info → ragaai_catalyst-2.1.6.dist-info}/RECORD +12 -15
- {ragaai_catalyst-2.1.5.1b3.dist-info → ragaai_catalyst-2.1.6.dist-info}/WHEEL +1 -1
- ragaai_catalyst/tracers/instrumentators/langchain.py +0 -14
- ragaai_catalyst/tracers/instrumentators/llamaindex.py +0 -14
- ragaai_catalyst/tracers/instrumentators/openai.py +0 -13
- {ragaai_catalyst-2.1.5.1b3.dist-info → ragaai_catalyst-2.1.6.dist-info}/LICENSE +0 -0
- {ragaai_catalyst-2.1.5.1b3.dist-info → ragaai_catalyst-2.1.6.dist-info}/top_level.txt +0 -0
@@ -11,7 +11,6 @@ from tqdm import tqdm
|
|
11
11
|
import openai
|
12
12
|
import tiktoken
|
13
13
|
import litellm
|
14
|
-
import google.generativeai as genai
|
15
14
|
from groq import Groq
|
16
15
|
from litellm import completion
|
17
16
|
|
@@ -166,7 +165,9 @@ class SyntheticDataGeneration:
|
|
166
165
|
elif provider == "gemini":
|
167
166
|
if api_key is None and os.getenv("GEMINI_API_KEY") is None and api_base is None and internal_llm_proxy is None:
|
168
167
|
raise ValueError("API key must be provided for Gemini.")
|
169
|
-
|
168
|
+
if api_key:
|
169
|
+
os.environ["GEMINI_API_KEY"] = api_key
|
170
|
+
# genai.configure(api_key=api_key or os.getenv("GEMINI_API_KEY"))
|
170
171
|
|
171
172
|
elif provider == "openai":
|
172
173
|
if api_key is None and os.getenv("OPENAI_API_KEY") is None and internal_llm_proxy is None:
|
@@ -63,3 +63,374 @@ def log_event(event_data, log_file_path):
|
|
63
63
|
event_data = asdict(event_data)
|
64
64
|
with open(log_file_path, "a") as f:
|
65
65
|
f.write(json.dumps(event_data) + "\n")
|
66
|
+
|
67
|
+
|
68
|
+
def process_child_interactions(child, interaction_id, interactions):
|
69
|
+
"""
|
70
|
+
Helper method to process child interactions recursively.
|
71
|
+
|
72
|
+
Args:
|
73
|
+
child (dict): The child span to process
|
74
|
+
interaction_id (int): Current interaction ID
|
75
|
+
interactions (list): List of interactions to append to
|
76
|
+
|
77
|
+
Returns:
|
78
|
+
int: Next interaction ID to use
|
79
|
+
"""
|
80
|
+
child_type = child.get("type")
|
81
|
+
|
82
|
+
if child_type == "tool":
|
83
|
+
# Tool call start
|
84
|
+
interactions.append(
|
85
|
+
{
|
86
|
+
"id": str(interaction_id),
|
87
|
+
"span_id": child.get("id"),
|
88
|
+
"interaction_type": "tool_call_start",
|
89
|
+
"name": child.get("name"),
|
90
|
+
"content": {
|
91
|
+
"parameters": [
|
92
|
+
child.get("data", {}).get("input", {}).get("args"),
|
93
|
+
child.get("data", {}).get("input", {}).get("kwargs"),
|
94
|
+
]
|
95
|
+
},
|
96
|
+
"timestamp": child.get("start_time"),
|
97
|
+
"error": child.get("error"),
|
98
|
+
}
|
99
|
+
)
|
100
|
+
interaction_id += 1
|
101
|
+
|
102
|
+
# Tool call end
|
103
|
+
interactions.append(
|
104
|
+
{
|
105
|
+
"id": str(interaction_id),
|
106
|
+
"span_id": child.get("id"),
|
107
|
+
"interaction_type": "tool_call_end",
|
108
|
+
"name": child.get("name"),
|
109
|
+
"content": {
|
110
|
+
"returns": child.get("data", {}).get("output"),
|
111
|
+
},
|
112
|
+
"timestamp": child.get("end_time"),
|
113
|
+
"error": child.get("error"),
|
114
|
+
}
|
115
|
+
)
|
116
|
+
interaction_id += 1
|
117
|
+
|
118
|
+
elif child_type == "llm":
|
119
|
+
interactions.append(
|
120
|
+
{
|
121
|
+
"id": str(interaction_id),
|
122
|
+
"span_id": child.get("id"),
|
123
|
+
"interaction_type": "llm_call_start",
|
124
|
+
"name": child.get("name"),
|
125
|
+
"content": {
|
126
|
+
"prompt": child.get("data", {}).get("input"),
|
127
|
+
},
|
128
|
+
"timestamp": child.get("start_time"),
|
129
|
+
"error": child.get("error"),
|
130
|
+
}
|
131
|
+
)
|
132
|
+
interaction_id += 1
|
133
|
+
|
134
|
+
interactions.append(
|
135
|
+
{
|
136
|
+
"id": str(interaction_id),
|
137
|
+
"span_id": child.get("id"),
|
138
|
+
"interaction_type": "llm_call_end",
|
139
|
+
"name": child.get("name"),
|
140
|
+
"content": {"response": child.get("data", {}).get("output")},
|
141
|
+
"timestamp": child.get("end_time"),
|
142
|
+
"error": child.get("error"),
|
143
|
+
}
|
144
|
+
)
|
145
|
+
interaction_id += 1
|
146
|
+
|
147
|
+
elif child_type == "agent":
|
148
|
+
interactions.append(
|
149
|
+
{
|
150
|
+
"id": str(interaction_id),
|
151
|
+
"span_id": child.get("id"),
|
152
|
+
"interaction_type": "agent_call_start",
|
153
|
+
"name": child.get("name"),
|
154
|
+
"content": None,
|
155
|
+
"timestamp": child.get("start_time"),
|
156
|
+
"error": child.get("error"),
|
157
|
+
}
|
158
|
+
)
|
159
|
+
interaction_id += 1
|
160
|
+
|
161
|
+
# Process nested children recursively
|
162
|
+
if "children" in child.get("data", {}):
|
163
|
+
for nested_child in child["data"]["children"]:
|
164
|
+
interaction_id = process_child_interactions(
|
165
|
+
nested_child, interaction_id, interactions
|
166
|
+
)
|
167
|
+
|
168
|
+
interactions.append(
|
169
|
+
{
|
170
|
+
"id": str(interaction_id),
|
171
|
+
"span_id": child.get("id"),
|
172
|
+
"interaction_type": "agent_call_end",
|
173
|
+
"name": child.get("name"),
|
174
|
+
"content": child.get("data", {}).get("output"),
|
175
|
+
"timestamp": child.get("end_time"),
|
176
|
+
"error": child.get("error"),
|
177
|
+
}
|
178
|
+
)
|
179
|
+
interaction_id += 1
|
180
|
+
|
181
|
+
else:
|
182
|
+
interactions.append(
|
183
|
+
{
|
184
|
+
"id": str(interaction_id),
|
185
|
+
"span_id": child.get("id"),
|
186
|
+
"interaction_type": f"{child_type}_call_start",
|
187
|
+
"name": child.get("name"),
|
188
|
+
"content": child.get("data", {}),
|
189
|
+
"timestamp": child.get("start_time"),
|
190
|
+
"error": child.get("error"),
|
191
|
+
}
|
192
|
+
)
|
193
|
+
interaction_id += 1
|
194
|
+
|
195
|
+
interactions.append(
|
196
|
+
{
|
197
|
+
"id": str(interaction_id),
|
198
|
+
"span_id": child.get("id"),
|
199
|
+
"interaction_type": f"{child_type}_call_end",
|
200
|
+
"name": child.get("name"),
|
201
|
+
"content": child.get("data", {}),
|
202
|
+
"timestamp": child.get("end_time"),
|
203
|
+
"error": child.get("error"),
|
204
|
+
}
|
205
|
+
)
|
206
|
+
interaction_id += 1
|
207
|
+
|
208
|
+
# Process additional interactions and network calls
|
209
|
+
if "interactions" in child:
|
210
|
+
for interaction in child["interactions"]:
|
211
|
+
interaction["id"] = str(interaction_id)
|
212
|
+
interaction["span_id"] = child.get("id")
|
213
|
+
interaction["error"] = None
|
214
|
+
interactions.append(interaction)
|
215
|
+
interaction_id += 1
|
216
|
+
|
217
|
+
if "network_calls" in child:
|
218
|
+
for child_network_call in child["network_calls"]:
|
219
|
+
network_call = {}
|
220
|
+
network_call["id"] = str(interaction_id)
|
221
|
+
network_call["span_id"] = child.get("id")
|
222
|
+
network_call["interaction_type"] = "network_call"
|
223
|
+
network_call["name"] = None
|
224
|
+
network_call["content"] = {
|
225
|
+
"request": {
|
226
|
+
"url": child_network_call.get("url"),
|
227
|
+
"method": child_network_call.get("method"),
|
228
|
+
"headers": child_network_call.get("headers"),
|
229
|
+
},
|
230
|
+
"response": {
|
231
|
+
"status_code": child_network_call.get("status_code"),
|
232
|
+
"headers": child_network_call.get("response_headers"),
|
233
|
+
"body": child_network_call.get("response_body"),
|
234
|
+
},
|
235
|
+
}
|
236
|
+
network_call["timestamp"] = child_network_call.get("start_time")
|
237
|
+
network_call["error"] = child_network_call.get("error")
|
238
|
+
interactions.append(network_call)
|
239
|
+
interaction_id += 1
|
240
|
+
|
241
|
+
return interaction_id
|
242
|
+
|
243
|
+
|
244
|
+
def format_interactions(trace) -> dict:
|
245
|
+
"""
|
246
|
+
Format interactions from trace data into a standardized format.
|
247
|
+
Returns a dictionary containing formatted interactions based on trace data.
|
248
|
+
|
249
|
+
The function processes spans from self.trace and formats them into interactions
|
250
|
+
of various types including: agent_start, agent_end, input, output, tool_call_start,
|
251
|
+
tool_call_end, llm_call, file_read, file_write, network_call.
|
252
|
+
|
253
|
+
Returns:
|
254
|
+
dict: A dictionary with "workflow" key containing a list of interactions
|
255
|
+
sorted by timestamp.
|
256
|
+
"""
|
257
|
+
interactions = []
|
258
|
+
interaction_id = 1
|
259
|
+
|
260
|
+
if 'data' not in trace or not trace['data'][0]["spans"]:
|
261
|
+
return {"workflow": []}
|
262
|
+
|
263
|
+
for span in trace['data'][0]["spans"]:
|
264
|
+
# Process agent spans
|
265
|
+
if span['type'] == "agent":
|
266
|
+
# Add agent_start interaction
|
267
|
+
interactions.append(
|
268
|
+
{
|
269
|
+
"id": str(interaction_id),
|
270
|
+
"span_id": span['id'],
|
271
|
+
"interaction_type": "agent_call_start",
|
272
|
+
"name": span['name'],
|
273
|
+
"content": None,
|
274
|
+
"timestamp": span['start_time'],
|
275
|
+
"error": span['error'],
|
276
|
+
}
|
277
|
+
)
|
278
|
+
interaction_id += 1
|
279
|
+
|
280
|
+
# Process children of agent recursively
|
281
|
+
if "children" in span['data']:
|
282
|
+
for child in span['data']["children"]:
|
283
|
+
interaction_id = process_child_interactions(
|
284
|
+
child, interaction_id, interactions
|
285
|
+
)
|
286
|
+
|
287
|
+
# Add agent_end interaction
|
288
|
+
interactions.append(
|
289
|
+
{
|
290
|
+
"id": str(interaction_id),
|
291
|
+
"span_id": span['id'],
|
292
|
+
"interaction_type": "agent_call_end",
|
293
|
+
"name": span['name'],
|
294
|
+
"content": span['data'].get("output"),
|
295
|
+
"timestamp": span['end_time'],
|
296
|
+
"error": span['error'],
|
297
|
+
}
|
298
|
+
)
|
299
|
+
interaction_id += 1
|
300
|
+
|
301
|
+
elif span['type'] == "tool":
|
302
|
+
interactions.append(
|
303
|
+
{
|
304
|
+
"id": str(interaction_id),
|
305
|
+
"span_id": span['id'],
|
306
|
+
"interaction_type": "tool_call_start",
|
307
|
+
"name": span['name'],
|
308
|
+
"content": {
|
309
|
+
"prompt": span['data'].get("input"),
|
310
|
+
"response": span['data'].get("output"),
|
311
|
+
},
|
312
|
+
"timestamp": span['start_time'],
|
313
|
+
"error": span['error'],
|
314
|
+
}
|
315
|
+
)
|
316
|
+
interaction_id += 1
|
317
|
+
|
318
|
+
interactions.append(
|
319
|
+
{
|
320
|
+
"id": str(interaction_id),
|
321
|
+
"span_id": span['id'],
|
322
|
+
"interaction_type": "tool_call_end",
|
323
|
+
"name": span['name'],
|
324
|
+
"content": {
|
325
|
+
"prompt": span['data'].get("input"),
|
326
|
+
"response": span['data'].get("output"),
|
327
|
+
},
|
328
|
+
"timestamp": span['end_time'],
|
329
|
+
"error": span['error'],
|
330
|
+
}
|
331
|
+
)
|
332
|
+
interaction_id += 1
|
333
|
+
|
334
|
+
elif span['type'] == "llm":
|
335
|
+
interactions.append(
|
336
|
+
{
|
337
|
+
"id": str(interaction_id),
|
338
|
+
"span_id": span['id'],
|
339
|
+
"interaction_type": "llm_call_start",
|
340
|
+
"name": span['name'],
|
341
|
+
"content": {
|
342
|
+
"prompt": span['data'].get("input"),
|
343
|
+
},
|
344
|
+
"timestamp": span['start_time'],
|
345
|
+
"error": span['error']
|
346
|
+
}
|
347
|
+
)
|
348
|
+
interaction_id += 1
|
349
|
+
|
350
|
+
interactions.append(
|
351
|
+
{
|
352
|
+
"id": str(interaction_id),
|
353
|
+
"span_id": span['id'],
|
354
|
+
"interaction_type": "llm_call_end",
|
355
|
+
"name": span['name'],
|
356
|
+
"content": {"response": span['data'].get("output")},
|
357
|
+
"timestamp": span['end_time'],
|
358
|
+
"error": span['error'],
|
359
|
+
}
|
360
|
+
)
|
361
|
+
interaction_id += 1
|
362
|
+
|
363
|
+
else:
|
364
|
+
interactions.append(
|
365
|
+
{
|
366
|
+
"id": str(interaction_id),
|
367
|
+
"span_id": span['id'],
|
368
|
+
"interaction_type": f"{span['type']}_call_start",
|
369
|
+
"name": span['name'],
|
370
|
+
"content": span['data'],
|
371
|
+
"timestamp": span['start_time'],
|
372
|
+
"error": span['error'],
|
373
|
+
}
|
374
|
+
)
|
375
|
+
interaction_id += 1
|
376
|
+
|
377
|
+
interactions.append(
|
378
|
+
{
|
379
|
+
"id": str(interaction_id),
|
380
|
+
"span_id": span['id'],
|
381
|
+
"interaction_type": f"{span['type']}_call_end",
|
382
|
+
"name": span['name'],
|
383
|
+
"content": span['data'],
|
384
|
+
"timestamp": span['end_time'],
|
385
|
+
"error": span['error'],
|
386
|
+
}
|
387
|
+
)
|
388
|
+
interaction_id += 1
|
389
|
+
|
390
|
+
# Process interactions from span.data if they exist
|
391
|
+
if 'interactions' in span:
|
392
|
+
for span_interaction in span['interactions']:
|
393
|
+
interaction = {}
|
394
|
+
interaction["id"] = str(interaction_id)
|
395
|
+
interaction["span_id"] = span['id']
|
396
|
+
interaction["interaction_type"] = span_interaction['type']
|
397
|
+
interaction["content"] = span_interaction['content']
|
398
|
+
interaction["timestamp"] = span_interaction['timestamp']
|
399
|
+
interaction["error"] = span['error']
|
400
|
+
interactions.append(interaction)
|
401
|
+
interaction_id += 1
|
402
|
+
|
403
|
+
if 'network_calls' in span:
|
404
|
+
for span_network_call in span['network_calls']:
|
405
|
+
network_call = {}
|
406
|
+
network_call["id"] = str(interaction_id)
|
407
|
+
network_call["span_id"] = span['id']
|
408
|
+
network_call["interaction_type"] = "network_call"
|
409
|
+
network_call["name"] = None
|
410
|
+
network_call["content"] = {
|
411
|
+
"request": {
|
412
|
+
"url": span_network_call.get("url"),
|
413
|
+
"method": span_network_call.get("method"),
|
414
|
+
"headers": span_network_call.get("headers"),
|
415
|
+
},
|
416
|
+
"response": {
|
417
|
+
"status_code": span_network_call.get("status_code"),
|
418
|
+
"headers": span_network_call.get("response_headers"),
|
419
|
+
"body": span_network_call.get("response_body"),
|
420
|
+
},
|
421
|
+
}
|
422
|
+
network_call["timestamp"] = span_network_call.get("timestamp")
|
423
|
+
network_call["error"] = span_network_call.get("error")
|
424
|
+
interactions.append(network_call)
|
425
|
+
interaction_id += 1
|
426
|
+
|
427
|
+
# Sort interactions by timestamp
|
428
|
+
sorted_interactions = sorted(
|
429
|
+
interactions, key=lambda x: x["timestamp"] if x["timestamp"] else ""
|
430
|
+
)
|
431
|
+
|
432
|
+
# Reassign IDs to maintain sequential order after sorting
|
433
|
+
for idx, interaction in enumerate(sorted_interactions, 1):
|
434
|
+
interaction["id"] = str(idx)
|
435
|
+
|
436
|
+
return {"workflow": sorted_interactions}
|
@@ -3,13 +3,13 @@ import json
|
|
3
3
|
import tempfile
|
4
4
|
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
|
5
5
|
import logging
|
6
|
-
from datetime import datetime
|
7
6
|
from dataclasses import asdict
|
8
7
|
from ragaai_catalyst.tracers.utils.trace_json_converter import convert_json_format
|
9
8
|
from ragaai_catalyst.tracers.agentic_tracing.tracers.base import TracerJSONEncoder
|
10
9
|
from ragaai_catalyst.tracers.agentic_tracing.utils.system_monitor import SystemMonitor
|
11
10
|
from ragaai_catalyst.tracers.agentic_tracing.upload.trace_uploader import submit_upload_task
|
12
11
|
from ragaai_catalyst.tracers.agentic_tracing.utils.zip_list_of_unique_files import zip_list_of_unique_files
|
12
|
+
from ragaai_catalyst.tracers.agentic_tracing.utils.trace_utils import format_interactions
|
13
13
|
|
14
14
|
|
15
15
|
logger = logging.getLogger("RagaAICatalyst")
|
@@ -77,8 +77,9 @@ class RAGATraceExporter(SpanExporter):
|
|
77
77
|
|
78
78
|
def prepare_trace(self, spans, trace_id):
|
79
79
|
try:
|
80
|
-
ragaai_trace = convert_json_format(spans, self.custom_model_cost)
|
81
|
-
|
80
|
+
ragaai_trace = convert_json_format(spans, self.custom_model_cost)
|
81
|
+
interactions = format_interactions(ragaai_trace)
|
82
|
+
ragaai_trace["workflow"] = interactions['workflow']
|
82
83
|
|
83
84
|
# Add source code hash
|
84
85
|
hash_id, zip_path = zip_list_of_unique_files(
|
@@ -111,9 +112,7 @@ class RAGATraceExporter(SpanExporter):
|
|
111
112
|
def upload_trace(self, ragaai_trace_details, trace_id):
|
112
113
|
filepath = ragaai_trace_details['trace_file_path']
|
113
114
|
hash_id = ragaai_trace_details['hash_id']
|
114
|
-
zip_path = ragaai_trace_details['code_zip_path']
|
115
|
-
|
116
|
-
|
115
|
+
zip_path = ragaai_trace_details['code_zip_path']
|
117
116
|
|
118
117
|
self.upload_task_id = submit_upload_task(
|
119
118
|
filepath=filepath,
|
@@ -1,4 +1,3 @@
|
|
1
|
-
from audioop import add
|
2
1
|
import os
|
3
2
|
import uuid
|
4
3
|
import datetime
|
@@ -22,11 +21,6 @@ from opentelemetry.sdk import trace as trace_sdk
|
|
22
21
|
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
|
23
22
|
from ragaai_catalyst.tracers.exporters.file_span_exporter import FileSpanExporter
|
24
23
|
from ragaai_catalyst.tracers.exporters.raga_exporter import RagaExporter
|
25
|
-
from ragaai_catalyst.tracers.instrumentators import (
|
26
|
-
LangchainInstrumentor,
|
27
|
-
OpenAIInstrumentor,
|
28
|
-
LlamaIndexInstrumentor,
|
29
|
-
)
|
30
24
|
from ragaai_catalyst.tracers.utils import get_unique_key
|
31
25
|
# from ragaai_catalyst.tracers.llamaindex_callback import LlamaIndexTracer
|
32
26
|
from ragaai_catalyst.tracers.llamaindex_instrumentation import LlamaIndexInstrumentationTracer
|
@@ -37,6 +31,9 @@ from ragaai_catalyst.tracers.exporters.ragaai_trace_exporter import RAGATraceExp
|
|
37
31
|
from ragaai_catalyst.tracers.agentic_tracing.utils.file_name_tracker import TrackName
|
38
32
|
|
39
33
|
logger = logging.getLogger(__name__)
|
34
|
+
logging_level = (
|
35
|
+
logger.setLevel(logging.DEBUG) if os.getenv("DEBUG") == "1" else logging.INFO
|
36
|
+
)
|
40
37
|
|
41
38
|
class Tracer(AgenticTracing):
|
42
39
|
NUM_PROJECTS = 99999
|
@@ -90,7 +87,7 @@ class Tracer(AgenticTracing):
|
|
90
87
|
|
91
88
|
# take care of auto_instrumentation
|
92
89
|
if isinstance(auto_instrumentation, bool):
|
93
|
-
if tracer_type
|
90
|
+
if tracer_type.startswith("agentic/"):
|
94
91
|
auto_instrumentation = {
|
95
92
|
"llm": False,
|
96
93
|
"tool": False,
|
@@ -184,30 +181,148 @@ class Tracer(AgenticTracing):
|
|
184
181
|
elif tracer_type == "llamaindex":
|
185
182
|
self._upload_task = None
|
186
183
|
self.llamaindex_tracer = None
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
#
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
184
|
+
# Handle agentic tracers
|
185
|
+
elif tracer_type == "agentic" or tracer_type.startswith("agentic/"):
|
186
|
+
|
187
|
+
# Setup instrumentors based on tracer type
|
188
|
+
instrumentors = []
|
189
|
+
|
190
|
+
# Add LLM Instrumentors
|
191
|
+
if tracer_type in ['agentic/crewai']:
|
192
|
+
try:
|
193
|
+
from openinference.instrumentation.vertexai import VertexAIInstrumentor
|
194
|
+
instrumentors.append((VertexAIInstrumentor, []))
|
195
|
+
except (ImportError, ModuleNotFoundError):
|
196
|
+
logger.debug("VertexAI not available in environment")
|
197
|
+
try:
|
198
|
+
from openinference.instrumentation.anthropic import AnthropicInstrumentor
|
199
|
+
instrumentors.append((AnthropicInstrumentor, []))
|
200
|
+
except (ImportError, ModuleNotFoundError):
|
201
|
+
logger.debug("Anthropic not available in environment")
|
202
|
+
try:
|
203
|
+
from openinference.instrumentation.groq import GroqInstrumentor
|
204
|
+
instrumentors.append((GroqInstrumentor, []))
|
205
|
+
except (ImportError, ModuleNotFoundError):
|
206
|
+
logger.debug("Groq not available in environment")
|
207
|
+
try:
|
208
|
+
from openinference.instrumentation.litellm import LiteLLMInstrumentor
|
209
|
+
instrumentors.append((LiteLLMInstrumentor, []))
|
210
|
+
except (ImportError, ModuleNotFoundError):
|
211
|
+
logger.debug("LiteLLM not available in environment")
|
212
|
+
try:
|
213
|
+
from openinference.instrumentation.mistralai import MistralAIInstrumentor
|
214
|
+
instrumentors.append((MistralAIInstrumentor, []))
|
215
|
+
except (ImportError, ModuleNotFoundError):
|
216
|
+
logger.debug("MistralAI not available in environment")
|
217
|
+
try:
|
218
|
+
from openinference.instrumentation.openai import OpenAIInstrumentor
|
219
|
+
instrumentors.append((OpenAIInstrumentor, []))
|
220
|
+
except (ImportError, ModuleNotFoundError):
|
221
|
+
logger.debug("OpenAI not available in environment")
|
222
|
+
try:
|
223
|
+
from openinference.instrumentation.bedrock import BedrockInstrumentor
|
224
|
+
instrumentors.append((BedrockInstrumentor, []))
|
225
|
+
except (ImportError, ModuleNotFoundError):
|
226
|
+
logger.debug("Bedrock not available in environment")
|
227
|
+
|
228
|
+
# If tracer_type is just "agentic", try to instrument all available packages
|
229
|
+
if tracer_type == "agentic":
|
230
|
+
logger.info("Attempting to instrument all available agentic packages")
|
231
|
+
|
232
|
+
# Try to import and add all known instrumentors
|
233
|
+
try:
|
234
|
+
# LlamaIndex
|
235
|
+
try:
|
236
|
+
from openinference.instrumentation.llama_index import LlamaIndexInstrumentor
|
237
|
+
instrumentors.append((LlamaIndexInstrumentor, []))
|
238
|
+
logger.info("Instrumenting LlamaIndex...")
|
239
|
+
except (ImportError, ModuleNotFoundError):
|
240
|
+
logger.debug("LlamaIndex not available in environment")
|
241
|
+
|
242
|
+
# LangChain
|
243
|
+
try:
|
244
|
+
from openinference.instrumentation.langchain import LangChainInstrumentor
|
245
|
+
instrumentors.append((LangChainInstrumentor, []))
|
246
|
+
logger.info("Instrumenting LangChain...")
|
247
|
+
except (ImportError, ModuleNotFoundError):
|
248
|
+
logger.debug("LangChain not available in environment")
|
249
|
+
|
250
|
+
# CrewAI
|
251
|
+
try:
|
252
|
+
from openinference.instrumentation.crewai import CrewAIInstrumentor
|
253
|
+
instrumentors.append((CrewAIInstrumentor, []))
|
254
|
+
logger.info("Instrumenting CrewAI...")
|
255
|
+
except (ImportError, ModuleNotFoundError):
|
256
|
+
logger.debug("CrewAI not available in environment")
|
257
|
+
|
258
|
+
# Haystack
|
259
|
+
try:
|
260
|
+
from openinference.instrumentation.haystack import HaystackInstrumentor
|
261
|
+
instrumentors.append((HaystackInstrumentor, []))
|
262
|
+
logger.info("Instrumenting Haystack...")
|
263
|
+
except (ImportError, ModuleNotFoundError):
|
264
|
+
logger.debug("Haystack not available in environment")
|
265
|
+
|
266
|
+
# AutoGen
|
267
|
+
try:
|
268
|
+
from openinference.instrumentation.autogen import AutogenInstrumentor
|
269
|
+
instrumentors.append((AutogenInstrumentor, []))
|
270
|
+
logger.info("Instrumenting AutoGen...")
|
271
|
+
except (ImportError, ModuleNotFoundError):
|
272
|
+
logger.debug("AutoGen not available in environment")
|
273
|
+
|
274
|
+
# Smolagents
|
275
|
+
try:
|
276
|
+
from openinference.instrumentation.smolagents import SmolagentsInstrumentor
|
277
|
+
instrumentors.append((SmolagentsInstrumentor, []))
|
278
|
+
logger.info("Instrumenting Smolagents...")
|
279
|
+
except (ImportError, ModuleNotFoundError):
|
280
|
+
logger.debug("Smolagents not available in environment")
|
281
|
+
|
282
|
+
if not instrumentors:
|
283
|
+
logger.warning("No agentic packages found in environment to instrument")
|
284
|
+
self._upload_task = None
|
285
|
+
return
|
286
|
+
|
287
|
+
except Exception as e:
|
288
|
+
logger.error(f"Error during auto-instrumentation: {str(e)}")
|
289
|
+
self._upload_task = None
|
290
|
+
return
|
291
|
+
|
292
|
+
# Handle specific framework instrumentation
|
293
|
+
elif tracer_type == "agentic/llamaindex":
|
294
|
+
from openinference.instrumentation.llama_index import LlamaIndexInstrumentor
|
295
|
+
instrumentors += [(LlamaIndexInstrumentor, [])]
|
296
|
+
|
297
|
+
elif tracer_type == "agentic/langchain" or tracer_type == "agentic/langgraph":
|
298
|
+
from openinference.instrumentation.langchain import LangChainInstrumentor
|
299
|
+
instrumentors += [(LangChainInstrumentor, [])]
|
300
|
+
|
301
|
+
elif tracer_type == "agentic/crewai":
|
302
|
+
from openinference.instrumentation.crewai import CrewAIInstrumentor
|
303
|
+
from openinference.instrumentation.langchain import LangChainInstrumentor
|
304
|
+
instrumentors += [(CrewAIInstrumentor, []), (LangChainInstrumentor, [])]
|
207
305
|
|
208
|
-
|
209
|
-
|
210
|
-
|
306
|
+
elif tracer_type == "agentic/haystack":
|
307
|
+
from openinference.instrumentation.haystack import HaystackInstrumentor
|
308
|
+
instrumentors += [(HaystackInstrumentor, [])]
|
309
|
+
|
310
|
+
elif tracer_type == "agentic/autogen":
|
311
|
+
from openinference.instrumentation.autogen import AutogenInstrumentor
|
312
|
+
instrumentors += [(AutogenInstrumentor, [])]
|
313
|
+
|
314
|
+
elif tracer_type == "agentic/smolagents":
|
315
|
+
from openinference.instrumentation.smolagents import SmolagentsInstrumentor
|
316
|
+
instrumentors += [(SmolagentsInstrumentor, [])]
|
317
|
+
|
318
|
+
else:
|
319
|
+
# Unknown agentic tracer type
|
320
|
+
logger.warning(f"Unknown agentic tracer type: {tracer_type}")
|
321
|
+
self._upload_task = None
|
322
|
+
return
|
323
|
+
|
324
|
+
# Common setup for all agentic tracers
|
325
|
+
self._setup_agentic_tracer(instrumentors)
|
211
326
|
else:
|
212
327
|
self._upload_task = None
|
213
328
|
# raise ValueError (f"Currently supported tracer types are 'langchain' and 'llamaindex'.")
|
@@ -576,12 +691,13 @@ class Tracer(AgenticTracing):
|
|
576
691
|
- dataset_name: Dataset name
|
577
692
|
- user_details: User details
|
578
693
|
- base_url: Base URL for API
|
694
|
+
- custom_model_cost: Dictionary of custom model costs
|
579
695
|
|
580
696
|
Raises:
|
581
|
-
AttributeError: If the tracer_type is not
|
697
|
+
AttributeError: If the tracer_type is not an agentic tracer or if the dynamic_exporter is not initialized.
|
582
698
|
"""
|
583
|
-
if self.tracer_type
|
584
|
-
raise AttributeError("
|
699
|
+
if not self.tracer_type.startswith("agentic/") or not hasattr(self, "dynamic_exporter"):
|
700
|
+
raise AttributeError("This method is only available for agentic tracers with a dynamic exporter.")
|
585
701
|
|
586
702
|
for key, value in kwargs.items():
|
587
703
|
if hasattr(self.dynamic_exporter, key):
|
@@ -590,6 +706,40 @@ class Tracer(AgenticTracing):
|
|
590
706
|
else:
|
591
707
|
logger.warning(f"Dynamic exporter has no attribute '{key}'")
|
592
708
|
|
709
|
+
def _setup_agentic_tracer(self, instrumentors):
|
710
|
+
"""
|
711
|
+
Common setup for all agentic tracers.
|
712
|
+
|
713
|
+
Args:
|
714
|
+
instrumentors (list): List of tuples (instrumentor_class, args) to be instrumented
|
715
|
+
"""
|
716
|
+
from opentelemetry.sdk import trace as trace_sdk
|
717
|
+
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
|
718
|
+
from ragaai_catalyst.tracers.exporters.dynamic_trace_exporter import DynamicTraceExporter
|
719
|
+
|
720
|
+
# Get the code_files
|
721
|
+
self.file_tracker.trace_main_file()
|
722
|
+
list_of_unique_files = self.file_tracker.get_unique_files()
|
723
|
+
|
724
|
+
# Create a dynamic exporter that allows property updates
|
725
|
+
self.dynamic_exporter = DynamicTraceExporter(
|
726
|
+
files_to_zip=list_of_unique_files,
|
727
|
+
project_name=self.project_name,
|
728
|
+
project_id=self.project_id,
|
729
|
+
dataset_name=self.dataset_name,
|
730
|
+
user_details=self.user_details,
|
731
|
+
base_url=self.base_url,
|
732
|
+
custom_model_cost=self.model_custom_cost
|
733
|
+
)
|
734
|
+
|
735
|
+
# Set up tracer provider
|
736
|
+
tracer_provider = trace_sdk.TracerProvider()
|
737
|
+
tracer_provider.add_span_processor(SimpleSpanProcessor(self.dynamic_exporter))
|
738
|
+
|
739
|
+
# Instrument all specified instrumentors
|
740
|
+
for instrumentor_class, args in instrumentors:
|
741
|
+
instrumentor_class().instrument(tracer_provider=tracer_provider, *args)
|
742
|
+
|
593
743
|
def update_file_list(self):
|
594
744
|
"""
|
595
745
|
Update the file list in the dynamic exporter with the latest tracked files.
|
@@ -598,8 +748,8 @@ class Tracer(AgenticTracing):
|
|
598
748
|
Raises:
|
599
749
|
AttributeError: If the tracer_type is not 'agentic/llamaindex' or if the dynamic_exporter is not initialized.
|
600
750
|
"""
|
601
|
-
if self.tracer_type
|
602
|
-
raise AttributeError("
|
751
|
+
if not self.tracer_type.startswith("agentic/") or not hasattr(self, "dynamic_exporter"):
|
752
|
+
raise AttributeError("This method is only available for agentic tracers with a dynamic exporter.")
|
603
753
|
|
604
754
|
# Get the latest list of unique files
|
605
755
|
list_of_unique_files = self.file_tracker.get_unique_files()
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import json
|
2
2
|
import sys
|
3
3
|
from datetime import datetime
|
4
|
-
from typing import final
|
4
|
+
from typing import final, List, Dict, Any, Optional
|
5
5
|
import pytz
|
6
6
|
import uuid
|
7
7
|
from ragaai_catalyst.tracers.agentic_tracing.utils.llm_utils import calculate_llm_cost, get_model_cost
|
@@ -35,14 +35,29 @@ def get_uuid(name):
|
|
35
35
|
"""Generate a random UUID (not based on name)."""
|
36
36
|
return str(uuid.uuid5(uuid.NAMESPACE_DNS, name))
|
37
37
|
|
38
|
+
def get_ordered_family(parent_children_mapping: Dict[str, Any]) -> List[str]:
|
39
|
+
def ordering_function(parent_id: str, ordered_family: List[str]):
|
40
|
+
children = parent_children_mapping.get(parent_id, [])
|
41
|
+
parent_child_ids =[child['id'] for child in children if child['id'] in parent_children_mapping]
|
42
|
+
for child_id in parent_child_ids:
|
43
|
+
if child_id not in ordered_family:
|
44
|
+
ordered_family.append(child_id)
|
45
|
+
ordering_function(child_id, ordered_family)
|
46
|
+
ordered_family = [None]
|
47
|
+
ordering_function(None, ordered_family)
|
48
|
+
return reversed(ordered_family)
|
49
|
+
|
38
50
|
def get_spans(input_trace, custom_model_cost):
|
39
|
-
|
51
|
+
span_map = {}
|
52
|
+
parent_children_mapping = {}
|
40
53
|
span_type_mapping={"AGENT":"agent","LLM":"llm","TOOL":"tool"}
|
41
54
|
span_name_occurrence = {}
|
42
55
|
for span in input_trace:
|
43
56
|
final_span = {}
|
44
57
|
span_type=span_type_mapping.get(span["attributes"]["openinference.span.kind"],"custom")
|
45
|
-
|
58
|
+
span_id = span["context"]["span_id"]
|
59
|
+
parent_id = span["parent_id"]
|
60
|
+
final_span["id"] = span_id
|
46
61
|
if span["name"] not in span_name_occurrence:
|
47
62
|
span_name_occurrence[span['name']]=0
|
48
63
|
else:
|
@@ -53,7 +68,7 @@ def get_spans(input_trace, custom_model_cost):
|
|
53
68
|
final_span["type"] = span_type
|
54
69
|
final_span["start_time"] = convert_time_format(span['start_time'])
|
55
70
|
final_span["end_time"] = convert_time_format(span['end_time'])
|
56
|
-
final_span["parent_id"] =
|
71
|
+
final_span["parent_id"] = parent_id
|
57
72
|
final_span["extra_info"] = None
|
58
73
|
'''Handle Error if any'''
|
59
74
|
if span["status"]["status_code"].lower() == "error":
|
@@ -82,6 +97,7 @@ def get_spans(input_trace, custom_model_cost):
|
|
82
97
|
final_span["data"]["output"] = span["attributes"]["output.value"]
|
83
98
|
else:
|
84
99
|
final_span["data"]["output"] = ""
|
100
|
+
final_span["data"]['children'] = []
|
85
101
|
|
86
102
|
elif span_type=="tool":
|
87
103
|
available_fields = list(span['attributes'].keys())
|
@@ -189,7 +205,23 @@ def get_spans(input_trace, custom_model_cost):
|
|
189
205
|
"total_tokens": final_span["info"]["tokens"]["total_tokens"]
|
190
206
|
}
|
191
207
|
final_span["info"]["cost"] = calculate_llm_cost(token_usage=token_usage, model_name=model_name, model_costs=model_costs, model_custom_cost=custom_model_cost)
|
192
|
-
|
208
|
+
span_map[span_id] = final_span
|
209
|
+
if parent_id not in parent_children_mapping:
|
210
|
+
parent_children_mapping[parent_id] = []
|
211
|
+
parent_children_mapping[parent_id].append(final_span)
|
212
|
+
ordered_family = get_ordered_family(parent_children_mapping)
|
213
|
+
data = []
|
214
|
+
for parent_id in ordered_family:
|
215
|
+
children = parent_children_mapping[parent_id]
|
216
|
+
if parent_id in span_map:
|
217
|
+
parent_type = span_map[parent_id]["type"]
|
218
|
+
if parent_type == 'agent':
|
219
|
+
span_map[parent_id]['data']["children"] = children
|
220
|
+
else:
|
221
|
+
grand_parent_id = span_map[parent_id]["parent_id"]
|
222
|
+
parent_children_mapping[grand_parent_id].extend(children)
|
223
|
+
else:
|
224
|
+
data = children
|
193
225
|
return data
|
194
226
|
|
195
227
|
def convert_json_format(input_trace, custom_model_cost):
|
@@ -1,32 +1,21 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ragaai_catalyst
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.6
|
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>, Tushar Kumar <tushar.kumar@raga.ai>
|
6
6
|
Requires-Python: <3.13,>=3.9
|
7
7
|
Description-Content-Type: text/markdown
|
8
8
|
License-File: LICENSE
|
9
9
|
Requires-Dist: aiohttp>=3.10.2
|
10
|
-
Requires-Dist: opentelemetry-api==1.25.0
|
11
|
-
Requires-Dist: opentelemetry-sdk==1.25.0
|
12
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc==1.25.0
|
13
|
-
Requires-Dist: opentelemetry-instrumentation==0.46b0
|
14
|
-
Requires-Dist: opentelemetry-instrumentation-fastapi==0.46b0
|
15
|
-
Requires-Dist: opentelemetry-instrumentation-asgi==0.46b0
|
16
|
-
Requires-Dist: opentelemetry-semantic-conventions==0.46b0
|
17
|
-
Requires-Dist: opentelemetry-util-http==0.46b0
|
18
|
-
Requires-Dist: opentelemetry-instrumentation-langchain~=0.24.0
|
19
|
-
Requires-Dist: opentelemetry-instrumentation-openai~=0.24.0
|
20
10
|
Requires-Dist: langchain-core>=0.2.11
|
21
11
|
Requires-Dist: langchain>=0.2.11
|
22
12
|
Requires-Dist: openai>=1.57.0
|
23
13
|
Requires-Dist: pandas
|
24
14
|
Requires-Dist: groq>=0.11.0
|
25
15
|
Requires-Dist: pypdf>=5.3.1
|
26
|
-
Requires-Dist: google-generativeai>=0.8.2
|
27
16
|
Requires-Dist: google-genai>=1.3.0
|
28
17
|
Requires-Dist: Markdown>=3.7
|
29
|
-
Requires-Dist: litellm
|
18
|
+
Requires-Dist: litellm>=1.51.1
|
30
19
|
Requires-Dist: tenacity==8.3.0
|
31
20
|
Requires-Dist: tqdm>=4.66.5
|
32
21
|
Requires-Dist: llama-index>=0.10.0
|
@@ -40,6 +29,18 @@ Requires-Dist: tiktoken>=0.7.0
|
|
40
29
|
Requires-Dist: tomli>=2.0.0
|
41
30
|
Requires-Dist: rich>=13.9.4
|
42
31
|
Requires-Dist: openinference-instrumentation-llama-index
|
32
|
+
Requires-Dist: openinference-instrumentation-langchain
|
33
|
+
Requires-Dist: openinference-instrumentation-vertexai
|
34
|
+
Requires-Dist: openinference-instrumentation-anthropic
|
35
|
+
Requires-Dist: openinference-instrumentation-groq
|
36
|
+
Requires-Dist: openinference-instrumentation-litellm
|
37
|
+
Requires-Dist: openinference-instrumentation-mistralai
|
38
|
+
Requires-Dist: openinference-instrumentation-openai
|
39
|
+
Requires-Dist: openinference-instrumentation-bedrock
|
40
|
+
Requires-Dist: openinference-instrumentation-crewai
|
41
|
+
Requires-Dist: openinference-instrumentation-haystack
|
42
|
+
Requires-Dist: openinference-instrumentation-autogen
|
43
|
+
Requires-Dist: openinference-instrumentation-smolagents
|
43
44
|
Requires-Dist: opentelemetry-sdk
|
44
45
|
Requires-Dist: opentelemetry-exporter-otlp
|
45
46
|
Requires-Dist: opentelemetry-proto>=1.12.0
|
@@ -10,7 +10,7 @@ ragaai_catalyst/prompt_manager.py,sha256=W8ypramzOprrJ7-22d5vkBXIuIQ8v9XAzKDGxKs
|
|
10
10
|
ragaai_catalyst/proxy_call.py,sha256=CHxldeceZUaLU-to_hs_Kf1z_b2vHMssLS_cOBedu78,5499
|
11
11
|
ragaai_catalyst/ragaai_catalyst.py,sha256=1FaeK_VZpJLQ1ZqEWpMyI8J8M2MI0abLLLDFWY9W-4A,19580
|
12
12
|
ragaai_catalyst/redteaming_old.py,sha256=W2d89Ok8W-C8g7TBM3fDIFLof3q9FuYSr0jcryH2XQo,7097
|
13
|
-
ragaai_catalyst/synthetic_data_generation.py,sha256=
|
13
|
+
ragaai_catalyst/synthetic_data_generation.py,sha256=RsaT2sJ4MxvwYU0t4tOTm9lAcsJJEPR3Z_YhG-Lo39g,37880
|
14
14
|
ragaai_catalyst/utils.py,sha256=TlhEFwLyRU690HvANbyoRycR3nQ67lxVUQoUOfTPYQ0,3772
|
15
15
|
ragaai_catalyst/redteaming/__init__.py,sha256=TJdvZpaZGFsg9qKONdjTosSVLZGadYFpHG6KE0xapKU,155
|
16
16
|
ragaai_catalyst/redteaming/evaluator.py,sha256=C50SAc3RsR7PZnz-VQ7wQfDpiVEb7T3W3KV4Lj0tWYE,4599
|
@@ -31,7 +31,7 @@ ragaai_catalyst/tracers/distributed.py,sha256=MwlBwIxCAng-OI-7Ove_rkE1mTLeuW4Jw-
|
|
31
31
|
ragaai_catalyst/tracers/langchain_callback.py,sha256=CB75zzG3-DkYTELj0vI1MOHQTY0MuQJfoHIXz9Cl8S8,34568
|
32
32
|
ragaai_catalyst/tracers/llamaindex_callback.py,sha256=ZY0BJrrlz-P9Mg2dX-ZkVKG3gSvzwqBtk7JL_05MiYA,14028
|
33
33
|
ragaai_catalyst/tracers/llamaindex_instrumentation.py,sha256=Ys_jLkvVqo12bKgXDmkp4TxJu9HkBATrFE8cIcTYxWw,14329
|
34
|
-
ragaai_catalyst/tracers/tracer.py,sha256=
|
34
|
+
ragaai_catalyst/tracers/tracer.py,sha256=stD4Lr7UfIBalljG-VVH0BpP2Ji15wIwYhOyMcYYI4Q,35861
|
35
35
|
ragaai_catalyst/tracers/upload_traces.py,sha256=OKsc-Obf8bJvKBprt3dqj8GQQNkoX3kT_t8TBDi9YDQ,5670
|
36
36
|
ragaai_catalyst/tracers/agentic_tracing/README.md,sha256=X4QwLb7-Jg7GQMIXj-SerZIgDETfw-7VgYlczOR8ZeQ,4508
|
37
37
|
ragaai_catalyst/tracers/agentic_tracing/__init__.py,sha256=yf6SKvOPSpH-9LiKaoLKXwqj5sez8F_5wkOb91yp0oE,260
|
@@ -54,7 +54,7 @@ ragaai_catalyst/tracers/agentic_tracing/tracers/network_tracer.py,sha256=m8CxYkl
|
|
54
54
|
ragaai_catalyst/tracers/agentic_tracing/tracers/tool_tracer.py,sha256=xxrliKPfdfbIZRZqMnUewsaTD8_Hv0dbuoBivNZGD4U,21674
|
55
55
|
ragaai_catalyst/tracers/agentic_tracing/tracers/user_interaction_tracer.py,sha256=bhSUhNQCuJXKjgJAXhjKEYjnHMpYN90FSZdR84fNIKU,4614
|
56
56
|
ragaai_catalyst/tracers/agentic_tracing/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
57
|
-
ragaai_catalyst/tracers/agentic_tracing/upload/trace_uploader.py,sha256=
|
57
|
+
ragaai_catalyst/tracers/agentic_tracing/upload/trace_uploader.py,sha256=UnGpcMpRbntUrYsIU11r-gMHtzNkDGSGCbepiL_XTFA,12379
|
58
58
|
ragaai_catalyst/tracers/agentic_tracing/upload/upload_agentic_traces.py,sha256=icycLgfA0734xxoM1rTMG_iIrI3iM94th8RQggJ7sSw,8541
|
59
59
|
ragaai_catalyst/tracers/agentic_tracing/upload/upload_code.py,sha256=aw_eHhUYRbR_9IbIkNjYb7NOsmETD3k1p4a6gxaGI7Q,6462
|
60
60
|
ragaai_catalyst/tracers/agentic_tracing/upload/upload_local_metric.py,sha256=m1O8lKpxKwtHofXLW3fTHX5yfqDW5GxoveARlg5cTw4,2571
|
@@ -70,28 +70,25 @@ ragaai_catalyst/tracers/agentic_tracing/utils/model_costs.json,sha256=2tzGw_cKCT
|
|
70
70
|
ragaai_catalyst/tracers/agentic_tracing/utils/span_attributes.py,sha256=qmODERcFZhc8MX24boFCXkkh6sJ-vZngRHPvxhyWFeE,4347
|
71
71
|
ragaai_catalyst/tracers/agentic_tracing/utils/supported_llm_provider.toml,sha256=LvFDivDIE96Zasp-fgDEqUJ5GEQZUawQucR3aOcSUTY,926
|
72
72
|
ragaai_catalyst/tracers/agentic_tracing/utils/system_monitor.py,sha256=H8WNsk4v_5T6OUw4TFOzlDLjQhJwjh1nAMyMAoqMEi4,6946
|
73
|
-
ragaai_catalyst/tracers/agentic_tracing/utils/trace_utils.py,sha256=
|
73
|
+
ragaai_catalyst/tracers/agentic_tracing/utils/trace_utils.py,sha256=rssHolDvKxZ9V6-4VTFAqC65o6-CG924hA0CnG3smSc,15902
|
74
74
|
ragaai_catalyst/tracers/agentic_tracing/utils/unique_decorator.py,sha256=G027toV-Km20JjKrc-Y_PilQ8ABEKrBvvzgLTnqVg7I,5819
|
75
75
|
ragaai_catalyst/tracers/agentic_tracing/utils/zip_list_of_unique_files.py,sha256=4TeCGsFF26249fV6dJHLTZDrRa93SG9oer4rudoF8Y4,19443
|
76
76
|
ragaai_catalyst/tracers/exporters/__init__.py,sha256=wQbaqyeIjVZxYprHCKZ9BeiqxeXYBKjzEgP79LWNxCU,293
|
77
77
|
ragaai_catalyst/tracers/exporters/dynamic_trace_exporter.py,sha256=w9U8UTxvTbGTDUoMtsgy2BsdpYp-APTKFdGV4o5JPaM,5051
|
78
78
|
ragaai_catalyst/tracers/exporters/file_span_exporter.py,sha256=RgGteu-NVGprXKkynvyIO5yOjpbtA41R3W_NzCjnkwE,6445
|
79
79
|
ragaai_catalyst/tracers/exporters/raga_exporter.py,sha256=6xvjWXyh8XPkHKSLLmAZUQSvwuyY17ov8pv2VdfI0qA,17875
|
80
|
-
ragaai_catalyst/tracers/exporters/ragaai_trace_exporter.py,sha256=
|
81
|
-
ragaai_catalyst/tracers/instrumentators/__init__.py,sha256=
|
82
|
-
ragaai_catalyst/tracers/instrumentators/langchain.py,sha256=yMN0qVF0pUVk6R5M1vJoUXezDo1ejs4klCFRlE8x4vE,574
|
83
|
-
ragaai_catalyst/tracers/instrumentators/llamaindex.py,sha256=SMrRlR4xM7k9HK43hakE8rkrWHxMlmtmWD-AX6TeByc,416
|
84
|
-
ragaai_catalyst/tracers/instrumentators/openai.py,sha256=14R4KW9wQCR1xysLfsP_nxS7cqXrTPoD8En4MBAaZUU,379
|
80
|
+
ragaai_catalyst/tracers/exporters/ragaai_trace_exporter.py,sha256=HZG1UjcipgQOHkeqQHVGxenIab2mHqcVmWqtOXlMt6Q,5305
|
81
|
+
ragaai_catalyst/tracers/instrumentators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
85
82
|
ragaai_catalyst/tracers/utils/__init__.py,sha256=KeMaZtYaTojilpLv65qH08QmpYclfpacDA0U3wg6Ybw,64
|
86
83
|
ragaai_catalyst/tracers/utils/convert_langchain_callbacks_output.py,sha256=ofrNrxf2b1hpjDh_zeaxiYq86azn1MF3kW8-ViYPEg0,1641
|
87
84
|
ragaai_catalyst/tracers/utils/convert_llama_instru_callback.py,sha256=8qLo7x4Zsn3dhJfSv9gviB60YXZ2TOsWEouucJmBM0c,1724
|
88
85
|
ragaai_catalyst/tracers/utils/extraction_logic_llama_index.py,sha256=ZhPs0YhVtB82-Pq9o1BvCinKE_WPvVxPTEcZjlJbFYM,2371
|
89
86
|
ragaai_catalyst/tracers/utils/langchain_tracer_extraction_logic.py,sha256=XS2_x2qneqEx9oAighLg-LRiueWcESLwIC2r7eJT-Ww,3117
|
90
87
|
ragaai_catalyst/tracers/utils/model_prices_and_context_window_backup.json,sha256=C3uwkibJ08C9sOX-54kulZYmJlIpZ-SQpfE6HNGrjbM,343502
|
91
|
-
ragaai_catalyst/tracers/utils/trace_json_converter.py,sha256=
|
88
|
+
ragaai_catalyst/tracers/utils/trace_json_converter.py,sha256=06oTKZHtKL9ylBybpYNU8AfT9xIVMekUBOhlUnRvzB8,13969
|
92
89
|
ragaai_catalyst/tracers/utils/utils.py,sha256=ViygfJ7vZ7U0CTSA1lbxVloHp4NSlmfDzBRNCJuMhis,2374
|
93
|
-
ragaai_catalyst-2.1.
|
94
|
-
ragaai_catalyst-2.1.
|
95
|
-
ragaai_catalyst-2.1.
|
96
|
-
ragaai_catalyst-2.1.
|
97
|
-
ragaai_catalyst-2.1.
|
90
|
+
ragaai_catalyst-2.1.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
91
|
+
ragaai_catalyst-2.1.6.dist-info/METADATA,sha256=d03IHMstFZ0bue-BLh9sC63Fn60j86hy9uBdbZ42iHE,22108
|
92
|
+
ragaai_catalyst-2.1.6.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
|
93
|
+
ragaai_catalyst-2.1.6.dist-info/top_level.txt,sha256=HpgsdRgEJMk8nqrU6qdCYk3di7MJkDL0B19lkc7dLfM,16
|
94
|
+
ragaai_catalyst-2.1.6.dist-info/RECORD,,
|
@@ -1,14 +0,0 @@
|
|
1
|
-
from importlib.util import find_spec
|
2
|
-
from opentelemetry.instrumentation.langchain import LangchainInstrumentor
|
3
|
-
|
4
|
-
|
5
|
-
class Langchain:
|
6
|
-
def __init__(self) -> None:
|
7
|
-
# Check if the necessary part of the 'opentelemetry' package is installed
|
8
|
-
if find_spec("opentelemetry.instrumentation.langchain") is None:
|
9
|
-
raise ModuleNotFoundError(
|
10
|
-
"Missing `opentelemetry-instrumentation-langchain` component. Install with `pip install opentelemetry-instrumentation-langchain`."
|
11
|
-
)
|
12
|
-
|
13
|
-
def get(self):
|
14
|
-
return LangchainInstrumentor
|
@@ -1,14 +0,0 @@
|
|
1
|
-
from importlib.util import find_spec
|
2
|
-
|
3
|
-
|
4
|
-
class LlamaIndex:
|
5
|
-
def __init__(self) -> None:
|
6
|
-
if find_spec("llamaindex") is None:
|
7
|
-
raise ModuleNotFoundError(
|
8
|
-
"Missing `llamaindex` package. Install with `pip install llamaindex`."
|
9
|
-
)
|
10
|
-
|
11
|
-
def get(self):
|
12
|
-
from opentelemetry.instrumentation.llamaindex import LlamaIndexInstrumentor
|
13
|
-
|
14
|
-
return LlamaIndexInstrumentor
|
@@ -1,13 +0,0 @@
|
|
1
|
-
from importlib.util import find_spec
|
2
|
-
from opentelemetry.instrumentation.openai import OpenAIInstrumentor
|
3
|
-
|
4
|
-
|
5
|
-
class OpenAI:
|
6
|
-
def __init__(self) -> None:
|
7
|
-
if find_spec("openai") is None:
|
8
|
-
raise ModuleNotFoundError(
|
9
|
-
"Missing `openai` package. Install with `pip install openai`."
|
10
|
-
)
|
11
|
-
|
12
|
-
def get(self):
|
13
|
-
return OpenAIInstrumentor
|
File without changes
|
File without changes
|