ragaai-catalyst 2.1b2__py3-none-any.whl → 2.1b3__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/agentic_tracing.py +1 -0
- ragaai_catalyst/tracers/agentic_tracing/base.py +6 -10
- ragaai_catalyst/tracers/agentic_tracing/llm_tracer.py +4 -0
- ragaai_catalyst/tracers/agentic_tracing/zip_list_of_unique_files.py +5 -3
- {ragaai_catalyst-2.1b2.dist-info → ragaai_catalyst-2.1b3.dist-info}/METADATA +1 -1
- {ragaai_catalyst-2.1b2.dist-info → ragaai_catalyst-2.1b3.dist-info}/RECORD +8 -8
- {ragaai_catalyst-2.1b2.dist-info → ragaai_catalyst-2.1b3.dist-info}/WHEEL +0 -0
- {ragaai_catalyst-2.1b2.dist-info → ragaai_catalyst-2.1b3.dist-info}/top_level.txt +0 -0
@@ -1,27 +1,24 @@
|
|
1
1
|
import json
|
2
2
|
import os
|
3
3
|
import platform
|
4
|
-
import re
|
5
4
|
import psutil
|
6
5
|
import pkg_resources
|
7
6
|
from datetime import datetime
|
8
7
|
from pathlib import Path
|
9
|
-
from typing import
|
8
|
+
from typing import List
|
10
9
|
import uuid
|
11
10
|
import sys
|
11
|
+
import tempfile
|
12
12
|
|
13
13
|
from .data_structure import (
|
14
14
|
Trace, Metadata, SystemInfo, OSInfo, EnvironmentInfo,
|
15
15
|
Resources, CPUResource, MemoryResource, DiskResource, NetworkResource,
|
16
16
|
ResourceInfo, MemoryInfo, DiskInfo, NetworkInfo,
|
17
|
-
Component,
|
18
|
-
NetworkCall, Interaction, Error
|
17
|
+
Component,
|
19
18
|
)
|
20
19
|
|
21
|
-
from ..upload_traces import UploadTraces
|
22
20
|
from .upload_agentic_traces import UploadAgenticTraces
|
23
21
|
from .upload_code import upload_code
|
24
|
-
from ...ragaai_catalyst import RagaAICatalyst
|
25
22
|
|
26
23
|
from .file_name_tracker import TrackName
|
27
24
|
from .zip_list_of_unique_files import zip_list_of_unique_files
|
@@ -182,14 +179,13 @@ class BaseTracer:
|
|
182
179
|
self.trace = self._extract_cost_tokens(self.trace)
|
183
180
|
|
184
181
|
# Create traces directory if it doesn't exist
|
185
|
-
self.traces_dir =
|
186
|
-
self.traces_dir.mkdir(exist_ok=True)
|
182
|
+
self.traces_dir = tempfile.gettempdir()
|
187
183
|
filename = self.trace.id + ".json"
|
188
|
-
filepath = self.traces_dir
|
184
|
+
filepath = f"{self.traces_dir}/{filename}"
|
189
185
|
|
190
186
|
#get unique files and zip it. Generate a unique hash ID for the contents of the files
|
191
187
|
list_of_unique_files = self.file_tracker.get_unique_files()
|
192
|
-
hash_id, zip_path = zip_list_of_unique_files(list_of_unique_files)
|
188
|
+
hash_id, zip_path = zip_list_of_unique_files(list_of_unique_files, output_dir=self.traces_dir)
|
193
189
|
|
194
190
|
#replace source code with zip_path
|
195
191
|
self.trace.metadata.system_info.source_code = hash_id
|
@@ -7,6 +7,8 @@ import importlib.util
|
|
7
7
|
import json
|
8
8
|
import astor
|
9
9
|
from pathlib import Path
|
10
|
+
import logging
|
11
|
+
logger = logging.getLogger(__name__)
|
10
12
|
|
11
13
|
# Define the PackageUsageRemover class
|
12
14
|
class PackageUsageRemover(ast.NodeTransformer):
|
@@ -165,15 +167,15 @@ class TraceDependencyTracker:
|
|
165
167
|
try:
|
166
168
|
relative_path = os.path.relpath(filepath, base_path)
|
167
169
|
zipf.write(filepath, relative_path)
|
168
|
-
|
170
|
+
# logger.info(f"Added to zip: {relative_path}")
|
169
171
|
except Exception as e:
|
170
172
|
print(f"Warning: Could not add {filepath} to zip: {str(e)}")
|
171
173
|
|
172
174
|
return hash_id, zip_filename
|
173
175
|
|
174
176
|
# Main function for creating a zip of unique files
|
175
|
-
def zip_list_of_unique_files(filepaths):
|
176
|
-
tracker = TraceDependencyTracker()
|
177
|
+
def zip_list_of_unique_files(filepaths, output_dir):
|
178
|
+
tracker = TraceDependencyTracker(output_dir)
|
177
179
|
return tracker.create_zip(filepaths)
|
178
180
|
|
179
181
|
# Example usage
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ragaai_catalyst
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.1b3
|
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.9
|
@@ -17,11 +17,11 @@ ragaai_catalyst/tracers/tracer.py,sha256=dGYQfo0RXms6w-sAJf04gqTo1zOXTqreGXaJlnv
|
|
17
17
|
ragaai_catalyst/tracers/upload_traces.py,sha256=hs0PEmit3n3_uUqrdbwcBdyK5Nbkik3JQVwJMEwYTd4,4796
|
18
18
|
ragaai_catalyst/tracers/agentic_tracing/__init__.py,sha256=6QyQI8P7aNFHTantNJOP1ZdSNrDKBLhlg_gGNj7tm1c,73
|
19
19
|
ragaai_catalyst/tracers/agentic_tracing/agent_tracer.py,sha256=Ff9KbTjKkuZkGAECyvKRe8LjjAjwQ-seTwsX2ycGnIg,18995
|
20
|
-
ragaai_catalyst/tracers/agentic_tracing/agentic_tracing.py,sha256=
|
21
|
-
ragaai_catalyst/tracers/agentic_tracing/base.py,sha256=
|
20
|
+
ragaai_catalyst/tracers/agentic_tracing/agentic_tracing.py,sha256=NVLw1n3FZUhZR-znaV_kSpWh1fQq2ElHYTklxPFg_Vc,8452
|
21
|
+
ragaai_catalyst/tracers/agentic_tracing/base.py,sha256=jRf_-5EIfCzGbaSQtkqgiDQAH4ymoKUrg9A8YqB08jk,14008
|
22
22
|
ragaai_catalyst/tracers/agentic_tracing/data_structure.py,sha256=qyfCI1oGQ461WbS6BYBiAEUmgpw9xFsccpjsi_mVX3c,7152
|
23
23
|
ragaai_catalyst/tracers/agentic_tracing/file_name_tracker.py,sha256=515NNDQJTyy3O-2rdlUYUoWL9qSwLIfvV3sMB9BtHp8,1366
|
24
|
-
ragaai_catalyst/tracers/agentic_tracing/llm_tracer.py,sha256=
|
24
|
+
ragaai_catalyst/tracers/agentic_tracing/llm_tracer.py,sha256=dI2Pg4cNGTf5k7g7ViVRUu6Pck8In4aqQYGLn_xwNxY,32705
|
25
25
|
ragaai_catalyst/tracers/agentic_tracing/network_tracer.py,sha256=6FTA15xMnum9omM_0Jd9cMIuWdKu1gR5Tc8fOXAkP8E,10068
|
26
26
|
ragaai_catalyst/tracers/agentic_tracing/sample.py,sha256=S4rCcKzU_5SB62BYEbNn_1VbbTdG4396N8rdZ3ZNGcE,5654
|
27
27
|
ragaai_catalyst/tracers/agentic_tracing/tool_tracer.py,sha256=Yc4x82rk0hCANwXUt4M66Qv_4OdpsXsjlq6OIOef1io,8763
|
@@ -30,7 +30,7 @@ ragaai_catalyst/tracers/agentic_tracing/unique_decorator_test.py,sha256=Xk1cLzs-
|
|
30
30
|
ragaai_catalyst/tracers/agentic_tracing/upload_agentic_traces.py,sha256=ydaWAbrSS5B6ijabzTnUVxlW8m6eX5dsEJnzl06ZDFU,7539
|
31
31
|
ragaai_catalyst/tracers/agentic_tracing/upload_code.py,sha256=u9bRWcM5oDezJupEQoHUXrKz7YvZJK9IZf10ejBWoa4,4254
|
32
32
|
ragaai_catalyst/tracers/agentic_tracing/user_interaction_tracer.py,sha256=wsCwTK7tM_L3mdNrcg5Mq3D1k07XCHZkhOB26kz_rLY,1472
|
33
|
-
ragaai_catalyst/tracers/agentic_tracing/zip_list_of_unique_files.py,sha256=
|
33
|
+
ragaai_catalyst/tracers/agentic_tracing/zip_list_of_unique_files.py,sha256=faFat_OAUnVJGnauMVo6yeHhTv-_njgyXGOtUwYJ8kE,7568
|
34
34
|
ragaai_catalyst/tracers/agentic_tracing/examples/FinancialAnalysisSystem.ipynb,sha256=0qZxjWqYCTAVvdo3Tsp544D8Am48wfeMQ9RKpKgAL8g,34291
|
35
35
|
ragaai_catalyst/tracers/agentic_tracing/examples/GameActivityEventPlanner.ipynb,sha256=QCMFJYbGX0fd9eMW4PqyQLZjyWuTXo7n1nqO_hMLf0s,4225
|
36
36
|
ragaai_catalyst/tracers/agentic_tracing/examples/TravelPlanner.ipynb,sha256=fU3inXoemJbdTkGAQl_N1UwVEZ10LrKv4gCEpbQ4ISg,43481
|
@@ -50,7 +50,7 @@ ragaai_catalyst/tracers/instrumentators/llamaindex.py,sha256=SMrRlR4xM7k9HK43hak
|
|
50
50
|
ragaai_catalyst/tracers/instrumentators/openai.py,sha256=14R4KW9wQCR1xysLfsP_nxS7cqXrTPoD8En4MBAaZUU,379
|
51
51
|
ragaai_catalyst/tracers/utils/__init__.py,sha256=KeMaZtYaTojilpLv65qH08QmpYclfpacDA0U3wg6Ybw,64
|
52
52
|
ragaai_catalyst/tracers/utils/utils.py,sha256=ViygfJ7vZ7U0CTSA1lbxVloHp4NSlmfDzBRNCJuMhis,2374
|
53
|
-
ragaai_catalyst-2.
|
54
|
-
ragaai_catalyst-2.
|
55
|
-
ragaai_catalyst-2.
|
56
|
-
ragaai_catalyst-2.
|
53
|
+
ragaai_catalyst-2.1b3.dist-info/METADATA,sha256=nXXIldP0lixlE4HcRaOoMgTUAWnbOZCTWz4I40T6nAg,1795
|
54
|
+
ragaai_catalyst-2.1b3.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
|
55
|
+
ragaai_catalyst-2.1b3.dist-info/top_level.txt,sha256=HpgsdRgEJMk8nqrU6qdCYk3di7MJkDL0B19lkc7dLfM,16
|
56
|
+
ragaai_catalyst-2.1b3.dist-info/RECORD,,
|
File without changes
|
File without changes
|