ragaai-catalyst 2.2.3b0__py3-none-any.whl → 2.2.3b2__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/dataset.py +41 -43
- ragaai_catalyst/evaluation.py +15 -17
- ragaai_catalyst/guard_executor.py +8 -8
- ragaai_catalyst/tracers/agentic_tracing/upload/upload_code.py +8 -12
- ragaai_catalyst/tracers/agentic_tracing/utils/api_utils.py +4 -1
- ragaai_catalyst/tracers/agentic_tracing/utils/llm_utils.py +3 -2
- ragaai_catalyst/tracers/agentic_tracing/utils/span_attributes.py +6 -3
- ragaai_catalyst/tracers/distributed.py +6 -3
- ragaai_catalyst/tracers/exporters/dynamic_trace_exporter.py +4 -4
- ragaai_catalyst/tracers/exporters/file_span_exporter.py +1 -3
- ragaai_catalyst/tracers/exporters/raga_exporter.py +2 -2
- ragaai_catalyst/tracers/exporters/ragaai_trace_exporter.py +3 -3
- ragaai_catalyst/tracers/tracer.py +9 -12
- ragaai_catalyst/tracers/utils/model_prices_and_context_window_backup.json +6131 -2218
- ragaai_catalyst/tracers/utils/trace_json_converter.py +3 -1
- ragaai_catalyst/tracers/utils/utils.py +1 -1
- {ragaai_catalyst-2.2.3b0.dist-info → ragaai_catalyst-2.2.3b2.dist-info}/METADATA +1 -1
- {ragaai_catalyst-2.2.3b0.dist-info → ragaai_catalyst-2.2.3b2.dist-info}/RECORD +21 -21
- {ragaai_catalyst-2.2.3b0.dist-info → ragaai_catalyst-2.2.3b2.dist-info}/WHEEL +0 -0
- {ragaai_catalyst-2.2.3b0.dist-info → ragaai_catalyst-2.2.3b2.dist-info}/licenses/LICENSE +0 -0
- {ragaai_catalyst-2.2.3b0.dist-info → ragaai_catalyst-2.2.3b2.dist-info}/top_level.txt +0 -0
@@ -136,9 +136,7 @@ class FileSpanExporter(SpanExporter):
|
|
136
136
|
"""
|
137
137
|
async with aiohttp.ClientSession() as session:
|
138
138
|
if not os.getenv("RAGAAI_CATALYST_TOKEN"):
|
139
|
-
|
140
|
-
"RAGAAI_CATALYST_TOKEN not found. Cannot upload traces."
|
141
|
-
)
|
139
|
+
logger.error("RAGAAI_CATALYST_TOKEN not found. Cannot upload traces.")
|
142
140
|
|
143
141
|
try:
|
144
142
|
upload_stat = await self.raga_client.check_and_upload_files(
|
@@ -60,7 +60,7 @@ class RagaExporter:
|
|
60
60
|
self.secret_key = os.getenv("RAGAAI_CATALYST_SECRET_KEY")
|
61
61
|
self.max_urls = 20
|
62
62
|
if not self.access_key or not self.secret_key:
|
63
|
-
|
63
|
+
logger.error(
|
64
64
|
"RAGAAI_CATALYST_ACCESS_KEY and RAGAAI_CATALYST_SECRET_KEY environment variables must be set"
|
65
65
|
)
|
66
66
|
if not os.getenv("RAGAAI_CATALYST_TOKEN"):
|
@@ -68,7 +68,7 @@ class RagaExporter:
|
|
68
68
|
|
69
69
|
create_status_code = self._create_schema()
|
70
70
|
if create_status_code != 200:
|
71
|
-
|
71
|
+
logger.error(
|
72
72
|
"Failed to create schema. Please consider raising an issue."
|
73
73
|
)
|
74
74
|
# elif status_code != 200:
|
@@ -51,7 +51,7 @@ class RAGATraceExporter(SpanExporter):
|
|
51
51
|
span_json = json.loads(span.to_json())
|
52
52
|
trace_id = span_json.get("context").get("trace_id")
|
53
53
|
if trace_id is None:
|
54
|
-
|
54
|
+
logger.error("Trace ID is None")
|
55
55
|
|
56
56
|
if trace_id not in self.trace_spans:
|
57
57
|
self.trace_spans[trace_id] = list()
|
@@ -63,11 +63,11 @@ class RAGATraceExporter(SpanExporter):
|
|
63
63
|
try:
|
64
64
|
self.process_complete_trace(trace, trace_id)
|
65
65
|
except Exception as e:
|
66
|
-
|
66
|
+
logger.error(f"Error processing complete trace: {e}")
|
67
67
|
try:
|
68
68
|
del self.trace_spans[trace_id]
|
69
69
|
except Exception as e:
|
70
|
-
|
70
|
+
logger.error(f"Error deleting trace: {e}")
|
71
71
|
except Exception as e:
|
72
72
|
logger.warning(f"Error processing span: {e}")
|
73
73
|
continue
|
@@ -166,7 +166,7 @@ class Tracer(AgenticTracing):
|
|
166
166
|
project["name"] for project in response.json()["data"]["content"]
|
167
167
|
]
|
168
168
|
if project_name not in project_list:
|
169
|
-
|
169
|
+
logger.error("Project not found. Please enter a valid project name")
|
170
170
|
|
171
171
|
self.project_id = [
|
172
172
|
project["id"] for project in response.json()["data"]["content"] if project["name"] == project_name
|
@@ -177,7 +177,6 @@ class Tracer(AgenticTracing):
|
|
177
177
|
|
178
178
|
except requests.exceptions.RequestException as e:
|
179
179
|
logger.error(f"Failed to retrieve projects list: {e}")
|
180
|
-
raise
|
181
180
|
|
182
181
|
# if tracer_type == "langchain":
|
183
182
|
# instrumentors = []
|
@@ -367,11 +366,11 @@ class Tracer(AgenticTracing):
|
|
367
366
|
})
|
368
367
|
"""
|
369
368
|
if not isinstance(cost_config, dict):
|
370
|
-
|
369
|
+
logger.error("cost_config must be a dictionary")
|
371
370
|
|
372
371
|
required_keys = {"model_name", "input_cost_per_million_token", "output_cost_per_million_token"}
|
373
372
|
if not all(key in cost_config for key in required_keys):
|
374
|
-
|
373
|
+
logger.error(f"cost_config must contain all required keys: {required_keys}")
|
375
374
|
|
376
375
|
model_name = cost_config["model_name"]
|
377
376
|
self.model_custom_cost[model_name] = {
|
@@ -400,7 +399,7 @@ class Tracer(AgenticTracing):
|
|
400
399
|
return value
|
401
400
|
"""
|
402
401
|
if not callable(masking_func):
|
403
|
-
|
402
|
+
logger.error("masking_func must be a callable")
|
404
403
|
|
405
404
|
def recursive_mask_values(obj, parent_key=None):
|
406
405
|
"""Apply masking to all values in nested structure."""
|
@@ -475,7 +474,7 @@ class Tracer(AgenticTracing):
|
|
475
474
|
def post_processor_func(original_trace_json_path: os.PathLike) -> os.PathLike
|
476
475
|
"""
|
477
476
|
if not callable(post_processor_func):
|
478
|
-
|
477
|
+
logger.error("post_processor_func must be a callable")
|
479
478
|
self.post_processor = post_processor_func
|
480
479
|
# Register in parent AgenticTracing class
|
481
480
|
super().register_post_processor(post_processor_func)
|
@@ -578,7 +577,7 @@ class Tracer(AgenticTracing):
|
|
578
577
|
"llama_index": LlamaIndexInstrumentor,
|
579
578
|
}
|
580
579
|
if tracer_type not in instrumentors:
|
581
|
-
|
580
|
+
logger.error(f"Invalid tracer type: {tracer_type}")
|
582
581
|
return instrumentors[tracer_type]().get()
|
583
582
|
|
584
583
|
@contextmanager
|
@@ -699,9 +698,7 @@ class Tracer(AgenticTracing):
|
|
699
698
|
"""
|
700
699
|
async with aiohttp.ClientSession() as session:
|
701
700
|
if not os.getenv("RAGAAI_CATALYST_TOKEN"):
|
702
|
-
|
703
|
-
"RAGAAI_CATALYST_TOKEN not found. Cannot upload traces."
|
704
|
-
)
|
701
|
+
logger.error("RAGAAI_CATALYST_TOKEN not found. Cannot upload traces.")
|
705
702
|
|
706
703
|
try:
|
707
704
|
upload_stat = await asyncio.wait_for(
|
@@ -785,7 +782,7 @@ class Tracer(AgenticTracing):
|
|
785
782
|
AttributeError: If the tracer_type is not an agentic tracer or if the dynamic_exporter is not initialized.
|
786
783
|
"""
|
787
784
|
if not self.tracer_type.startswith("agentic/") or not hasattr(self, "dynamic_exporter"):
|
788
|
-
|
785
|
+
logger.error("This method is only available for agentic tracers with a dynamic exporter.")
|
789
786
|
|
790
787
|
for key, value in kwargs.items():
|
791
788
|
if hasattr(self.dynamic_exporter, key):
|
@@ -852,7 +849,7 @@ class Tracer(AgenticTracing):
|
|
852
849
|
AttributeError: If the tracer_type is not 'agentic/llamaindex' or if the dynamic_exporter is not initialized.
|
853
850
|
"""
|
854
851
|
if not self.tracer_type.startswith("agentic/") or not hasattr(self, "dynamic_exporter"):
|
855
|
-
|
852
|
+
logger.error("This method is only available for agentic tracers with a dynamic exporter.")
|
856
853
|
|
857
854
|
# Get the latest list of unique files
|
858
855
|
list_of_unique_files = self.file_tracker.get_unique_files()
|