ragaai-catalyst 2.2.1__py3-none-any.whl → 2.2.2__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/ragaai_catalyst.py +119 -82
- ragaai_catalyst/tracers/agentic_tracing/upload/trace_uploader.py +14 -15
- ragaai_catalyst/tracers/agentic_tracing/upload/upload_agentic_traces.py +132 -67
- ragaai_catalyst/tracers/agentic_tracing/upload/upload_code.py +156 -72
- ragaai_catalyst/tracers/tracer.py +67 -39
- {ragaai_catalyst-2.2.1.dist-info → ragaai_catalyst-2.2.2.dist-info}/METADATA +1 -1
- {ragaai_catalyst-2.2.1.dist-info → ragaai_catalyst-2.2.2.dist-info}/RECORD +10 -10
- {ragaai_catalyst-2.2.1.dist-info → ragaai_catalyst-2.2.2.dist-info}/WHEEL +1 -1
- {ragaai_catalyst-2.2.1.dist-info → ragaai_catalyst-2.2.2.dist-info}/licenses/LICENSE +0 -0
- {ragaai_catalyst-2.2.1.dist-info → ragaai_catalyst-2.2.2.dist-info}/top_level.txt +0 -0
@@ -1,35 +1,26 @@
|
|
1
|
-
import
|
2
|
-
import uuid
|
1
|
+
import asyncio
|
3
2
|
import datetime
|
3
|
+
import json
|
4
4
|
import logging
|
5
|
-
import
|
5
|
+
import os
|
6
|
+
from concurrent.futures import ThreadPoolExecutor
|
7
|
+
from contextlib import contextmanager
|
8
|
+
from pathlib import Path
|
9
|
+
|
6
10
|
import aiohttp
|
7
11
|
import requests
|
8
12
|
from litellm import model_cost
|
9
|
-
from pathlib import Path
|
10
|
-
from contextlib import contextmanager
|
11
|
-
from concurrent.futures import ThreadPoolExecutor
|
12
|
-
from ragaai_catalyst.tracers.langchain_callback import LangchainTracer
|
13
|
-
from ragaai_catalyst.tracers.utils.convert_langchain_callbacks_output import convert_langchain_callbacks_output
|
14
13
|
|
15
|
-
from ragaai_catalyst.tracers.utils.langchain_tracer_extraction_logic import langchain_tracer_extraction
|
16
|
-
from ragaai_catalyst.tracers.upload_traces import UploadTraces
|
17
|
-
import tempfile
|
18
|
-
import json
|
19
|
-
import numpy as np
|
20
|
-
from opentelemetry.sdk import trace as trace_sdk
|
21
|
-
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
|
22
|
-
from ragaai_catalyst.tracers.exporters.file_span_exporter import FileSpanExporter
|
23
|
-
from ragaai_catalyst.tracers.exporters.raga_exporter import RagaExporter
|
24
|
-
from ragaai_catalyst.tracers.utils import get_unique_key
|
25
14
|
# from ragaai_catalyst.tracers.llamaindex_callback import LlamaIndexTracer
|
26
|
-
from ragaai_catalyst.tracers.llamaindex_instrumentation import LlamaIndexInstrumentationTracer
|
27
15
|
from openinference.instrumentation.langchain import LangChainInstrumentor
|
16
|
+
from opentelemetry.sdk import trace as trace_sdk
|
17
|
+
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
|
18
|
+
|
28
19
|
from ragaai_catalyst import RagaAICatalyst
|
29
20
|
from ragaai_catalyst.tracers.agentic_tracing import AgenticTracing
|
30
|
-
from ragaai_catalyst.tracers.agentic_tracing.tracers.llm_tracer import LLMTracerMixin
|
31
|
-
from ragaai_catalyst.tracers.exporters.ragaai_trace_exporter import RAGATraceExporter
|
32
21
|
from ragaai_catalyst.tracers.agentic_tracing.utils.file_name_tracker import TrackName
|
22
|
+
from ragaai_catalyst.tracers.exporters.file_span_exporter import FileSpanExporter
|
23
|
+
from ragaai_catalyst.tracers.utils import get_unique_key
|
33
24
|
|
34
25
|
logger = logging.getLogger(__name__)
|
35
26
|
logging_level = (
|
@@ -200,12 +191,16 @@ class Tracer(AgenticTracing):
|
|
200
191
|
# Add LLM Instrumentors
|
201
192
|
if tracer_type in ['agentic/crewai']:
|
202
193
|
try:
|
203
|
-
from openinference.instrumentation.vertexai import
|
194
|
+
from openinference.instrumentation.vertexai import (
|
195
|
+
VertexAIInstrumentor,
|
196
|
+
)
|
204
197
|
instrumentors.append((VertexAIInstrumentor, []))
|
205
198
|
except (ImportError, ModuleNotFoundError):
|
206
199
|
logger.debug("VertexAI not available in environment")
|
207
200
|
try:
|
208
|
-
from openinference.instrumentation.anthropic import
|
201
|
+
from openinference.instrumentation.anthropic import (
|
202
|
+
AnthropicInstrumentor,
|
203
|
+
)
|
209
204
|
instrumentors.append((AnthropicInstrumentor, []))
|
210
205
|
except (ImportError, ModuleNotFoundError):
|
211
206
|
logger.debug("Anthropic not available in environment")
|
@@ -215,12 +210,16 @@ class Tracer(AgenticTracing):
|
|
215
210
|
except (ImportError, ModuleNotFoundError):
|
216
211
|
logger.debug("Groq not available in environment")
|
217
212
|
try:
|
218
|
-
from openinference.instrumentation.litellm import
|
213
|
+
from openinference.instrumentation.litellm import (
|
214
|
+
LiteLLMInstrumentor,
|
215
|
+
)
|
219
216
|
instrumentors.append((LiteLLMInstrumentor, []))
|
220
217
|
except (ImportError, ModuleNotFoundError):
|
221
218
|
logger.debug("LiteLLM not available in environment")
|
222
219
|
try:
|
223
|
-
from openinference.instrumentation.mistralai import
|
220
|
+
from openinference.instrumentation.mistralai import (
|
221
|
+
MistralAIInstrumentor,
|
222
|
+
)
|
224
223
|
instrumentors.append((MistralAIInstrumentor, []))
|
225
224
|
except (ImportError, ModuleNotFoundError):
|
226
225
|
logger.debug("MistralAI not available in environment")
|
@@ -230,7 +229,9 @@ class Tracer(AgenticTracing):
|
|
230
229
|
except (ImportError, ModuleNotFoundError):
|
231
230
|
logger.debug("OpenAI not available in environment")
|
232
231
|
try:
|
233
|
-
from openinference.instrumentation.bedrock import
|
232
|
+
from openinference.instrumentation.bedrock import (
|
233
|
+
BedrockInstrumentor,
|
234
|
+
)
|
234
235
|
instrumentors.append((BedrockInstrumentor, []))
|
235
236
|
except (ImportError, ModuleNotFoundError):
|
236
237
|
logger.debug("Bedrock not available in environment")
|
@@ -243,7 +244,9 @@ class Tracer(AgenticTracing):
|
|
243
244
|
try:
|
244
245
|
# LlamaIndex
|
245
246
|
try:
|
246
|
-
from openinference.instrumentation.llama_index import
|
247
|
+
from openinference.instrumentation.llama_index import (
|
248
|
+
LlamaIndexInstrumentor,
|
249
|
+
)
|
247
250
|
instrumentors.append((LlamaIndexInstrumentor, []))
|
248
251
|
logger.info("Instrumenting LlamaIndex...")
|
249
252
|
except (ImportError, ModuleNotFoundError):
|
@@ -251,7 +254,9 @@ class Tracer(AgenticTracing):
|
|
251
254
|
|
252
255
|
# LangChain
|
253
256
|
try:
|
254
|
-
from openinference.instrumentation.langchain import
|
257
|
+
from openinference.instrumentation.langchain import (
|
258
|
+
LangChainInstrumentor,
|
259
|
+
)
|
255
260
|
instrumentors.append((LangChainInstrumentor, []))
|
256
261
|
logger.info("Instrumenting LangChain...")
|
257
262
|
except (ImportError, ModuleNotFoundError):
|
@@ -259,7 +264,9 @@ class Tracer(AgenticTracing):
|
|
259
264
|
|
260
265
|
# CrewAI
|
261
266
|
try:
|
262
|
-
from openinference.instrumentation.crewai import
|
267
|
+
from openinference.instrumentation.crewai import (
|
268
|
+
CrewAIInstrumentor,
|
269
|
+
)
|
263
270
|
instrumentors.append((CrewAIInstrumentor, []))
|
264
271
|
logger.info("Instrumenting CrewAI...")
|
265
272
|
except (ImportError, ModuleNotFoundError):
|
@@ -267,7 +274,9 @@ class Tracer(AgenticTracing):
|
|
267
274
|
|
268
275
|
# Haystack
|
269
276
|
try:
|
270
|
-
from openinference.instrumentation.haystack import
|
277
|
+
from openinference.instrumentation.haystack import (
|
278
|
+
HaystackInstrumentor,
|
279
|
+
)
|
271
280
|
instrumentors.append((HaystackInstrumentor, []))
|
272
281
|
logger.info("Instrumenting Haystack...")
|
273
282
|
except (ImportError, ModuleNotFoundError):
|
@@ -275,7 +284,9 @@ class Tracer(AgenticTracing):
|
|
275
284
|
|
276
285
|
# AutoGen
|
277
286
|
try:
|
278
|
-
from openinference.instrumentation.autogen import
|
287
|
+
from openinference.instrumentation.autogen import (
|
288
|
+
AutogenInstrumentor,
|
289
|
+
)
|
279
290
|
instrumentors.append((AutogenInstrumentor, []))
|
280
291
|
logger.info("Instrumenting AutoGen...")
|
281
292
|
except (ImportError, ModuleNotFoundError):
|
@@ -283,7 +294,9 @@ class Tracer(AgenticTracing):
|
|
283
294
|
|
284
295
|
# Smolagents
|
285
296
|
try:
|
286
|
-
from openinference.instrumentation.smolagents import
|
297
|
+
from openinference.instrumentation.smolagents import (
|
298
|
+
SmolagentsInstrumentor,
|
299
|
+
)
|
287
300
|
instrumentors.append((SmolagentsInstrumentor, []))
|
288
301
|
logger.info("Instrumenting Smolagents...")
|
289
302
|
except (ImportError, ModuleNotFoundError):
|
@@ -291,7 +304,9 @@ class Tracer(AgenticTracing):
|
|
291
304
|
|
292
305
|
# OpenAI Agents
|
293
306
|
try:
|
294
|
-
from openinference.instrumentation.openai_agents import
|
307
|
+
from openinference.instrumentation.openai_agents import (
|
308
|
+
OpenAIAgentsInstrumentor,
|
309
|
+
)
|
295
310
|
instrumentors.append((OpenAIAgentsInstrumentor, []))
|
296
311
|
logger.info("Instrumenting OpenAI Agents...")
|
297
312
|
except (ImportError, ModuleNotFoundError):
|
@@ -309,16 +324,22 @@ class Tracer(AgenticTracing):
|
|
309
324
|
|
310
325
|
# Handle specific framework instrumentation
|
311
326
|
elif tracer_type == "agentic/llamaindex" or tracer_type == "llamaindex":
|
312
|
-
from openinference.instrumentation.llama_index import
|
327
|
+
from openinference.instrumentation.llama_index import (
|
328
|
+
LlamaIndexInstrumentor,
|
329
|
+
)
|
313
330
|
instrumentors += [(LlamaIndexInstrumentor, [])]
|
314
331
|
|
315
332
|
elif tracer_type == "agentic/langchain" or tracer_type == "agentic/langgraph" or tracer_type == "langchain":
|
316
|
-
from openinference.instrumentation.langchain import
|
333
|
+
from openinference.instrumentation.langchain import (
|
334
|
+
LangChainInstrumentor,
|
335
|
+
)
|
317
336
|
instrumentors += [(LangChainInstrumentor, [])]
|
318
337
|
|
319
338
|
elif tracer_type == "agentic/crewai":
|
320
339
|
from openinference.instrumentation.crewai import CrewAIInstrumentor
|
321
|
-
from openinference.instrumentation.langchain import
|
340
|
+
from openinference.instrumentation.langchain import (
|
341
|
+
LangChainInstrumentor,
|
342
|
+
)
|
322
343
|
instrumentors += [(CrewAIInstrumentor, []), (LangChainInstrumentor, [])]
|
323
344
|
|
324
345
|
elif tracer_type == "agentic/haystack":
|
@@ -330,11 +351,15 @@ class Tracer(AgenticTracing):
|
|
330
351
|
instrumentors += [(AutogenInstrumentor, [])]
|
331
352
|
|
332
353
|
elif tracer_type == "agentic/smolagents":
|
333
|
-
from openinference.instrumentation.smolagents import
|
354
|
+
from openinference.instrumentation.smolagents import (
|
355
|
+
SmolagentsInstrumentor,
|
356
|
+
)
|
334
357
|
instrumentors += [(SmolagentsInstrumentor, [])]
|
335
358
|
|
336
359
|
elif tracer_type == "agentic/openai_agents":
|
337
|
-
from openinference.instrumentation.openai_agents import
|
360
|
+
from openinference.instrumentation.openai_agents import (
|
361
|
+
OpenAIAgentsInstrumentor,
|
362
|
+
)
|
338
363
|
instrumentors += [(OpenAIAgentsInstrumentor, [])]
|
339
364
|
|
340
365
|
else:
|
@@ -800,7 +825,10 @@ class Tracer(AgenticTracing):
|
|
800
825
|
"""
|
801
826
|
from opentelemetry.sdk import trace as trace_sdk
|
802
827
|
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
|
803
|
-
|
828
|
+
|
829
|
+
from ragaai_catalyst.tracers.exporters.dynamic_trace_exporter import (
|
830
|
+
DynamicTraceExporter,
|
831
|
+
)
|
804
832
|
|
805
833
|
# Get the code_files
|
806
834
|
self.file_tracker.trace_main_file()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ragaai_catalyst
|
3
|
-
Version: 2.2.
|
3
|
+
Version: 2.2.2
|
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>, Rishabh Pandey <rishabh.pandey@raga.ai>, Jyotsana C G <jyotsana@raga.ai>
|
6
6
|
Requires-Python: <=3.13.2,>=3.10
|
@@ -8,7 +8,7 @@ ragaai_catalyst/guardrails_manager.py,sha256=_VrARJ1udmCF8TklNKy7XTQUaM8ATDhTOAG
|
|
8
8
|
ragaai_catalyst/internal_api_completion.py,sha256=DdICI5yfEudiOAIC8L4oxH0Qz7kX-BZCdo9IWsi2gNo,2965
|
9
9
|
ragaai_catalyst/prompt_manager.py,sha256=W8ypramzOprrJ7-22d5vkBXIuIQ8v9XAzKDGxKsTK28,16550
|
10
10
|
ragaai_catalyst/proxy_call.py,sha256=CHxldeceZUaLU-to_hs_Kf1z_b2vHMssLS_cOBedu78,5499
|
11
|
-
ragaai_catalyst/ragaai_catalyst.py,sha256=
|
11
|
+
ragaai_catalyst/ragaai_catalyst.py,sha256=H7nhKuPi3pJH3QzO2dWshZ6FXgyZ5YRNOcB7MkXPRes,25413
|
12
12
|
ragaai_catalyst/redteaming_old.py,sha256=W2d89Ok8W-C8g7TBM3fDIFLof3q9FuYSr0jcryH2XQo,7097
|
13
13
|
ragaai_catalyst/synthetic_data_generation.py,sha256=7lIWa3nwgW2-FlJrDaGxTN6OE4-dbbhLtKNOBQufhho,37952
|
14
14
|
ragaai_catalyst/utils.py,sha256=TlhEFwLyRU690HvANbyoRycR3nQ67lxVUQoUOfTPYQ0,3772
|
@@ -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=ngHe17GDSjHThrZO9uPr8yH-qYvnysPQrS7B0Aq_hJU,42071
|
35
35
|
ragaai_catalyst/tracers/upload_traces.py,sha256=w1clGGfdOMpStUJX40NAlxe6dcFdN4pwcezyII0bGYA,6994
|
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,9 +54,9 @@ 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=
|
58
|
-
ragaai_catalyst/tracers/agentic_tracing/upload/upload_agentic_traces.py,sha256=
|
59
|
-
ragaai_catalyst/tracers/agentic_tracing/upload/upload_code.py,sha256=
|
57
|
+
ragaai_catalyst/tracers/agentic_tracing/upload/trace_uploader.py,sha256=yA2_4fO0rWP0O4mrqcPGt_aZiB4gluVS5nCk6Q6k1y8,12946
|
58
|
+
ragaai_catalyst/tracers/agentic_tracing/upload/upload_agentic_traces.py,sha256=qcii8NMZGJvmv19AokjCH2egGIsALLWK9JqHtgkFB_0,10447
|
59
|
+
ragaai_catalyst/tracers/agentic_tracing/upload/upload_code.py,sha256=XWRqVU_4kEgpPpx-TKmfgFFI5mxf_uO54yNhD5ogYNk,10170
|
60
60
|
ragaai_catalyst/tracers/agentic_tracing/upload/upload_local_metric.py,sha256=m1O8lKpxKwtHofXLW3fTHX5yfqDW5GxoveARlg5cTw4,2571
|
61
61
|
ragaai_catalyst/tracers/agentic_tracing/utils/__init__.py,sha256=XdB3X_ufe4RVvGorxSqAiB9dYv4UD7Hvvuw3bsDUppY,60
|
62
62
|
ragaai_catalyst/tracers/agentic_tracing/utils/api_utils.py,sha256=JyNCbfpW-w4O9CjtemTqmor2Rh1WGpQwhRaDSRmBxw8,689
|
@@ -88,8 +88,8 @@ ragaai_catalyst/tracers/utils/rag_extraction_logic_final.py,sha256=3ygkRT__lLDRf
|
|
88
88
|
ragaai_catalyst/tracers/utils/rag_trace_json_converter.py,sha256=54IEZO-YRjUAahV5nw8KClXqTF1LhfDry_TsZ4KGow4,20467
|
89
89
|
ragaai_catalyst/tracers/utils/trace_json_converter.py,sha256=YllXhkfyYOuQ0rsX9VqiUjMUeztDMs8TFMudIPkWvrY,10191
|
90
90
|
ragaai_catalyst/tracers/utils/utils.py,sha256=L19LQGc8h08FFhyptBtixIHGG_e-VdSPsKs7JNaXnGE,2378
|
91
|
-
ragaai_catalyst-2.2.
|
92
|
-
ragaai_catalyst-2.2.
|
93
|
-
ragaai_catalyst-2.2.
|
94
|
-
ragaai_catalyst-2.2.
|
95
|
-
ragaai_catalyst-2.2.
|
91
|
+
ragaai_catalyst-2.2.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
92
|
+
ragaai_catalyst-2.2.2.dist-info/METADATA,sha256=2XcrTsdS1a_QyQyy5qa0dnxSBdKudwn62leYQNx0Udo,17677
|
93
|
+
ragaai_catalyst-2.2.2.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
94
|
+
ragaai_catalyst-2.2.2.dist-info/top_level.txt,sha256=HpgsdRgEJMk8nqrU6qdCYk3di7MJkDL0B19lkc7dLfM,16
|
95
|
+
ragaai_catalyst-2.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|