ragaai-catalyst 2.2b0__py3-none-any.whl → 2.2b1__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/tracer.py +21 -60
- {ragaai_catalyst-2.2b0.dist-info → ragaai_catalyst-2.2b1.dist-info}/METADATA +1 -1
- {ragaai_catalyst-2.2b0.dist-info → ragaai_catalyst-2.2b1.dist-info}/RECORD +6 -6
- {ragaai_catalyst-2.2b0.dist-info → ragaai_catalyst-2.2b1.dist-info}/WHEEL +0 -0
- {ragaai_catalyst-2.2b0.dist-info → ragaai_catalyst-2.2b1.dist-info}/licenses/LICENSE +0 -0
- {ragaai_catalyst-2.2b0.dist-info → ragaai_catalyst-2.2b1.dist-info}/top_level.txt +0 -0
@@ -404,66 +404,27 @@ class Tracer(AgenticTracing):
|
|
404
404
|
|
405
405
|
def recursive_mask_values(obj, parent_key=None):
|
406
406
|
"""Apply masking to all values in nested structure."""
|
407
|
-
|
408
|
-
if
|
409
|
-
# Special handling for LangChain data
|
410
|
-
if isinstance(obj, dict):
|
411
|
-
if obj.get("name", "") == "retrieve_documents.langchain.workflow":
|
412
|
-
prompt_structured_data = {
|
413
|
-
"traceloop.entity.input": json.dumps({
|
414
|
-
"kwargs": {
|
415
|
-
"input": masking_func(json.loads(obj.get("attributes", {}).get("traceloop.entity.input", "")).get("kwargs", {}).get("input", "")),
|
416
|
-
}
|
417
|
-
})
|
418
|
-
}
|
419
|
-
prompt_data = {
|
420
|
-
"name": "retrieve_documents.langchain.workflow",
|
421
|
-
"attributes": prompt_structured_data,
|
422
|
-
}
|
423
|
-
return prompt_data
|
424
|
-
elif obj.get("name", "") == "PromptTemplate.langchain.task":
|
425
|
-
context_structured_data = {
|
426
|
-
"traceloop.entity.input": json.dumps({
|
427
|
-
"kwargs": {
|
428
|
-
"context": masking_func(json.loads(obj.get("attributes", {}).get("traceloop.entity.input", "")).get("kwargs", {}).get("context", "")),
|
429
|
-
}
|
430
|
-
}),
|
431
|
-
"traceloop.entity.output": json.dumps({
|
432
|
-
"kwargs": {
|
433
|
-
"text": masking_func(json.loads(obj.get("attributes", {}).get("traceloop.entity.output", "")).get("kwargs", {}).get("text", "")),
|
434
|
-
}
|
435
|
-
})
|
436
|
-
}
|
437
|
-
context_data = {
|
438
|
-
"name": "PromptTemplate.langchain.task",
|
439
|
-
"attributes": context_structured_data,
|
440
|
-
}
|
441
|
-
return context_data
|
442
|
-
elif obj.get("name", "") == "ChatOpenAI.langchain.task":
|
443
|
-
response_structured_data = {"gen_ai.completion.0.content": masking_func(obj.get("attributes", {}).get("gen_ai.completion.0.content", "")),
|
444
|
-
"gen_ai.prompt.0.content": masking_func(obj.get("attributes", {}).get("gen_ai.prompt.0.content", ""))}
|
445
|
-
response_data = {
|
446
|
-
"name": "ChatOpenAI.langchain.task",
|
447
|
-
"attributes" : response_structured_data
|
448
|
-
}
|
449
|
-
return response_data
|
450
|
-
else:
|
407
|
+
try:
|
408
|
+
if isinstance(obj, dict):
|
451
409
|
return {k: recursive_mask_values(v, k) for k, v in obj.items()}
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
410
|
+
elif isinstance(obj, list):
|
411
|
+
return [recursive_mask_values(item, parent_key) for item in obj]
|
412
|
+
elif isinstance(obj, str):
|
413
|
+
# List of keys that should NOT be masked
|
414
|
+
excluded_keys = {
|
415
|
+
'start_time', 'end_time', 'name', 'id',
|
416
|
+
'hash_id', 'parent_id', 'source_hash_id',
|
417
|
+
'cost', 'type', 'feedback', 'error', 'ctx','telemetry.sdk.version',
|
418
|
+
'telemetry.sdk.language','service.name'
|
419
|
+
}
|
420
|
+
# Apply masking only if the key is NOT in the excluded list
|
421
|
+
if parent_key and parent_key.lower() not in excluded_keys:
|
422
|
+
return masking_func(obj)
|
423
|
+
return obj
|
424
|
+
else:
|
425
|
+
return obj
|
426
|
+
except Exception as e:
|
427
|
+
logger.error(f"Error masking value: {e}")
|
467
428
|
return obj
|
468
429
|
|
469
430
|
def file_post_processor(original_trace_json_path: os.PathLike) -> os.PathLike:
|
@@ -953,4 +914,4 @@ class Tracer(AgenticTracing):
|
|
953
914
|
self.dynamic_exporter.user_details = user_details
|
954
915
|
self.metadata = user_metadata
|
955
916
|
else:
|
956
|
-
logger.warning("metadata must be a dictionary")
|
917
|
+
logger.warning("metadata must be a dictionary")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ragaai_catalyst
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.2b1
|
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.2,>=3.10
|
@@ -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=hdQK3-zV14lBqz8B6gLrMLNtfV34BmJ4-7eiNeLABq8,41931
|
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
|
@@ -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=K4X4yUmB01UtFX-_xmJsgFOAmzGe8qQ6SYQRHUyWlKs,9405
|
90
90
|
ragaai_catalyst/tracers/utils/utils.py,sha256=ViygfJ7vZ7U0CTSA1lbxVloHp4NSlmfDzBRNCJuMhis,2374
|
91
|
-
ragaai_catalyst-2.
|
92
|
-
ragaai_catalyst-2.
|
93
|
-
ragaai_catalyst-2.
|
94
|
-
ragaai_catalyst-2.
|
95
|
-
ragaai_catalyst-2.
|
91
|
+
ragaai_catalyst-2.2b1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
92
|
+
ragaai_catalyst-2.2b1.dist-info/METADATA,sha256=iSfX0l6C-mJbeeDDnCwc99nVsjwTgM_lG7AkUBrmOoo,17603
|
93
|
+
ragaai_catalyst-2.2b1.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
94
|
+
ragaai_catalyst-2.2b1.dist-info/top_level.txt,sha256=HpgsdRgEJMk8nqrU6qdCYk3di7MJkDL0B19lkc7dLfM,16
|
95
|
+
ragaai_catalyst-2.2b1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|