ragaai-catalyst 2.1b1__py3-none-any.whl → 2.1b2__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.
@@ -230,7 +230,7 @@ class BaseTracer:
230
230
 
231
231
  # Cleanup
232
232
  self.components = []
233
- self.file_tracker = TrackName()
233
+ self.file_tracker.reset()
234
234
 
235
235
  def add_component(self, component: Component):
236
236
  """Add a component to the trace"""
@@ -8,13 +8,9 @@ class TrackName:
8
8
  def trace_decorator(self, func):
9
9
  @wraps(func)
10
10
  def wrapper(*args, **kwargs):
11
- # frame = inspect.stack()[1]
12
- # file_name = frame.filename
13
11
  file_name = self._get_file_name()
14
- # print(f"Called from file: {frame.filename}")
15
- # print(f"Called from line: {frame.lineno}")
16
- # print(f"Called from function: {frame.function}")
17
12
  self.files.add(file_name)
13
+
18
14
  return func(*args, **kwargs)
19
15
  return wrapper
20
16
 
@@ -43,4 +39,8 @@ class TrackName:
43
39
 
44
40
 
45
41
  def get_unique_files(self):
46
- return list(self.files)
42
+ return list(self.files)
43
+
44
+ def reset(self):
45
+ """Reset the file tracker by clearing all tracked files."""
46
+ self.files.clear()
@@ -1,161 +1,3 @@
1
- # import os
2
- # import hashlib
3
- # import zipfile
4
- # import re
5
- # import ast
6
- # import importlib.util
7
- # import json
8
- # from pathlib import Path
9
-
10
- # class TraceDependencyTracker:
11
- # def __init__(self, output_dir=None):
12
- # self.tracked_files = set()
13
- # self.python_imports = set()
14
- # self.output_dir = output_dir or os.getcwd()
15
-
16
- # def track_file_access(self, filepath):
17
- # """Track a file that's been accessed."""
18
- # if os.path.exists(filepath):
19
- # self.tracked_files.add(os.path.abspath(filepath))
20
-
21
- # def find_config_files(self, content, base_path):
22
- # """Find configuration files referenced in the content."""
23
- # patterns = [
24
- # r'(?:open|read|load|with\s+open)\s*\([\'"]([^\'"]*\.(?:json|yaml|yml|txt|cfg|config|ini))[\'"]',
25
- # r'(?:config|cfg|conf|settings|file|path)(?:_file|_path)?\s*=\s*[\'"]([^\'"]*\.(?:json|yaml|yml|txt|cfg|config|ini))[\'"]',
26
- # r'[\'"]([^\'"]*\.txt)[\'"]',
27
- # r'[\'"]([^\'"]*\.(?:yaml|yml))[\'"]',
28
- # r'from\s+(\S+)\s+import',
29
- # r'import\s+(\S+)'
30
- # ]
31
-
32
- # for pattern in patterns:
33
- # matches = re.finditer(pattern, content)
34
- # for match in matches:
35
- # filepath = match.group(1)
36
- # if not os.path.isabs(filepath):
37
- # full_path = os.path.join(os.path.dirname(base_path), filepath)
38
- # else:
39
- # full_path = filepath
40
-
41
- # if os.path.exists(full_path):
42
- # self.track_file_access(full_path)
43
- # try:
44
- # with open(full_path, 'r', encoding='utf-8') as f:
45
- # self.find_config_files(f.read(), full_path)
46
- # except (UnicodeDecodeError, IOError):
47
- # pass
48
-
49
- # def analyze_python_imports(self, filepath):
50
- # """Analyze Python file for imports and track imported files."""
51
- # try:
52
- # with open(filepath, 'r', encoding='utf-8') as file:
53
- # tree = ast.parse(file.read(), filename=filepath)
54
-
55
- # for node in ast.walk(tree):
56
- # if isinstance(node, (ast.Import, ast.ImportFrom)):
57
- # if isinstance(node, ast.ImportFrom) and node.module:
58
- # module_name = node.module
59
- # else:
60
- # for name in node.names:
61
- # module_name = name.name.split('.')[0]
62
-
63
- # try:
64
- # spec = importlib.util.find_spec(module_name)
65
- # if spec and spec.origin and not spec.origin.startswith(os.path.dirname(importlib.__file__)):
66
- # self.python_imports.add(spec.origin)
67
- # except (ImportError, AttributeError):
68
- # pass
69
- # except Exception as e:
70
- # print(f"Warning: Could not analyze imports in {filepath}: {str(e)}")
71
-
72
- # def create_zip(self, filepaths):
73
- # """
74
- # Process files and create a single zip with all dependencies.
75
-
76
- # Args:
77
- # filepaths (list): List of file paths to process.
78
-
79
- # Returns:
80
- # tuple: A tuple containing the hash ID (str) and the path to the saved .zip file (str).
81
- # """
82
- # # Process all files and their dependencies
83
- # for filepath in filepaths:
84
- # abs_path = os.path.abspath(filepath)
85
- # self.track_file_access(abs_path)
86
-
87
- # try:
88
- # with open(abs_path, 'r', encoding='utf-8') as file:
89
- # content = file.read()
90
-
91
- # self.find_config_files(content, abs_path)
92
-
93
- # if filepath.endswith('.py'):
94
- # self.analyze_python_imports(abs_path)
95
- # except Exception as e:
96
- # print(f"Warning: Could not process {filepath}: {str(e)}")
97
-
98
- # # Add Python imports to tracked files
99
- # self.tracked_files.update(self.python_imports)
100
-
101
- # # Generate hash from all files
102
- # hash_contents = []
103
- # for filepath in sorted(self.tracked_files):
104
- # # Skip any file paths that contain 'env'
105
- # if 'env' in filepath:
106
- # continue # Skip env folder
107
- # try:
108
- # with open(filepath, 'rb') as file:
109
- # content = file.read()
110
- # hash_contents.append(content)
111
- # except Exception as e:
112
- # print(f"Warning: Could not read {filepath} for hash calculation: {str(e)}")
113
-
114
- # combined_content = b''.join(hash_contents)
115
- # hash_id = hashlib.sha256(combined_content).hexdigest()
116
-
117
- # # Create zip file
118
- # zip_filename = os.path.join(self.output_dir, f'{hash_id}.zip')
119
-
120
- # # Determine base path excluding 'env' folders
121
- # base_path = os.path.commonpath([os.path.abspath(p) for p in self.tracked_files if 'env' not in p])
122
-
123
- # with zipfile.ZipFile(zip_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:
124
- # for filepath in sorted(self.tracked_files):
125
- # # Skip any file paths that contain 'env'
126
- # if 'env' in filepath:
127
- # continue # Skip env folder
128
- # try:
129
- # relative_path = os.path.relpath(filepath, base_path)
130
- # zipf.write(filepath, relative_path)
131
- # print(f"Added to zip: {relative_path}")
132
- # except Exception as e:
133
- # print(f"Warning: Could not add {filepath} to zip: {str(e)}")
134
-
135
- # return hash_id, zip_filename
136
-
137
- # def zip_list_of_unique_files(filepaths):
138
- # """
139
- # Enhanced version of the original function that tracks all dependencies.
140
-
141
- # Args:
142
- # filepaths (list): List of file paths to process.
143
-
144
- # Returns:
145
- # tuple: A tuple containing the hash ID (str) and the path to the saved .zip file (str).
146
- # """
147
- # tracker = TraceDependencyTracker()
148
- # return tracker.create_zip(filepaths)
149
-
150
- # if __name__ == "__main__":
151
- # filepaths = ["script1.py", "script2.py"]
152
- # hash_id, zip_path = zip_list_of_unique_files(filepaths)
153
- # print(f"Created zip file: {zip_path}")
154
- # print(f"Hash ID: {hash_id}")
155
-
156
-
157
-
158
-
159
1
  import os
160
2
  import hashlib
161
3
  import zipfile
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ragaai_catalyst
3
- Version: 2.1b1
3
+ Version: 2.1b2
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
@@ -18,9 +18,9 @@ ragaai_catalyst/tracers/upload_traces.py,sha256=hs0PEmit3n3_uUqrdbwcBdyK5Nbkik3J
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
20
  ragaai_catalyst/tracers/agentic_tracing/agentic_tracing.py,sha256=vlh1nvIx9qAHI1m4YKe1R9HkjWiA6sKnP_6GRUed00g,8366
21
- ragaai_catalyst/tracers/agentic_tracing/base.py,sha256=FefIRrPw2BYNi1u707O8cNTmZIrVwi7OxMrfzdvC0U4,14205
21
+ ragaai_catalyst/tracers/agentic_tracing/base.py,sha256=xnd9jE_aEh56iSharHuMlHxBvPcSQD8KtihPLjKn5Mc,14199
22
22
  ragaai_catalyst/tracers/agentic_tracing/data_structure.py,sha256=qyfCI1oGQ461WbS6BYBiAEUmgpw9xFsccpjsi_mVX3c,7152
23
- ragaai_catalyst/tracers/agentic_tracing/file_name_tracker.py,sha256=1YibFmifGh-PF7Jl0vtCN2QYF-v6Xq9jTgozDkWvgO0,1501
23
+ ragaai_catalyst/tracers/agentic_tracing/file_name_tracker.py,sha256=515NNDQJTyy3O-2rdlUYUoWL9qSwLIfvV3sMB9BtHp8,1366
24
24
  ragaai_catalyst/tracers/agentic_tracing/llm_tracer.py,sha256=PTOnyj4AVEyUqyQK1fY-Beckt0v_-BvJfGwIEoIxca4,32561
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
@@ -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=mW2Cle4sAia2L5GBPWnIcyCms5T_89qOALlW2mxvLEw,13999
33
+ ragaai_catalyst/tracers/agentic_tracing/zip_list_of_unique_files.py,sha256=qlK-7HtybA7Z0xvK0iiVE7lC0gsDgwvdO0MJ9a37f2w,7486
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.1b1.dist-info/METADATA,sha256=cztOcfVRDK_Rz7DqQStsEX7vIXp7DxAg0Hhq_hmZiew,1795
54
- ragaai_catalyst-2.1b1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
55
- ragaai_catalyst-2.1b1.dist-info/top_level.txt,sha256=HpgsdRgEJMk8nqrU6qdCYk3di7MJkDL0B19lkc7dLfM,16
56
- ragaai_catalyst-2.1b1.dist-info/RECORD,,
53
+ ragaai_catalyst-2.1b2.dist-info/METADATA,sha256=Epkb-INU3JO8UmJXpehYK4lT3iqr62xjmf3nU1YbUI4,1795
54
+ ragaai_catalyst-2.1b2.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
55
+ ragaai_catalyst-2.1b2.dist-info/top_level.txt,sha256=HpgsdRgEJMk8nqrU6qdCYk3di7MJkDL0B19lkc7dLfM,16
56
+ ragaai_catalyst-2.1b2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.7.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5