alita-sdk 0.3.414__py3-none-any.whl → 0.3.416__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.
- alita_sdk/runtime/tools/sandbox.py +15 -31
- alita_sdk/tools/utils/content_parser.py +9 -1
- {alita_sdk-0.3.414.dist-info → alita_sdk-0.3.416.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.414.dist-info → alita_sdk-0.3.416.dist-info}/RECORD +7 -7
- {alita_sdk-0.3.414.dist-info → alita_sdk-0.3.416.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.414.dist-info → alita_sdk-0.3.416.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.414.dist-info → alita_sdk-0.3.416.dist-info}/top_level.txt +0 -0
|
@@ -64,36 +64,10 @@ def _is_deno_available() -> bool:
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
def _setup_pyodide_cache_env() -> None:
|
|
67
|
-
"""Setup Pyodide caching environment variables for performance optimization"""
|
|
67
|
+
"""Setup Pyodide caching environment variables for performance optimization [NO-OP]"""
|
|
68
68
|
try:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if os.path.exists(cache_env_file):
|
|
72
|
-
with open(cache_env_file, 'r') as f:
|
|
73
|
-
for line in f:
|
|
74
|
-
line = line.strip()
|
|
75
|
-
if line.startswith('export ') and '=' in line:
|
|
76
|
-
# Parse export VAR=value format
|
|
77
|
-
var_assignment = line[7:] # Remove 'export '
|
|
78
|
-
if '=' in var_assignment:
|
|
79
|
-
key, value = var_assignment.split('=', 1)
|
|
80
|
-
# Remove quotes if present
|
|
81
|
-
value = value.strip('"').strip("'")
|
|
82
|
-
os.environ[key] = value
|
|
83
|
-
logger.debug(f"Set Pyodide cache env: {key}={value}")
|
|
84
|
-
|
|
85
|
-
# Set default caching environment variables if not already set
|
|
86
|
-
cache_defaults = {
|
|
87
|
-
'PYODIDE_PACKAGES_PATH': os.path.expanduser('~/.cache/pyodide'),
|
|
88
|
-
'DENO_DIR': os.path.expanduser('~/.cache/deno'),
|
|
89
|
-
'PYODIDE_CACHE_DIR': os.path.expanduser('~/.cache/pyodide'),
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
for key, default_value in cache_defaults.items():
|
|
93
|
-
if key not in os.environ:
|
|
94
|
-
os.environ[key] = default_value
|
|
95
|
-
logger.debug(f"Set default Pyodide env: {key}={default_value}")
|
|
96
|
-
|
|
69
|
+
for key in ["SANDBOX_BASE", "DENO_DIR"]:
|
|
70
|
+
logger.info("Sandbox env: %s -> %s", key, os.environ.get(key, "n/a"))
|
|
97
71
|
except Exception as e:
|
|
98
72
|
logger.warning(f"Could not setup Pyodide cache environment: {e}")
|
|
99
73
|
|
|
@@ -142,7 +116,7 @@ class PyodideSandboxTool(BaseTool):
|
|
|
142
116
|
def _prepare_pyodide_input(self, code: str) -> str:
|
|
143
117
|
"""Prepare input for PyodideSandboxTool by injecting state and alita_client into the code block."""
|
|
144
118
|
pyodide_predata = ""
|
|
145
|
-
|
|
119
|
+
|
|
146
120
|
# Add alita_client if available
|
|
147
121
|
if self.alita_client:
|
|
148
122
|
try:
|
|
@@ -158,7 +132,7 @@ class PyodideSandboxTool(BaseTool):
|
|
|
158
132
|
f"auth_token='{self.alita_client.auth_token}')\n")
|
|
159
133
|
except FileNotFoundError:
|
|
160
134
|
logger.error(f"sandbox_client.py not found. Ensure the file exists.")
|
|
161
|
-
|
|
135
|
+
|
|
162
136
|
return f"#elitea simplified client\n{pyodide_predata}{code}"
|
|
163
137
|
|
|
164
138
|
def _initialize_sandbox(self) -> None:
|
|
@@ -175,9 +149,19 @@ class PyodideSandboxTool(BaseTool):
|
|
|
175
149
|
|
|
176
150
|
from langchain_sandbox import PyodideSandbox
|
|
177
151
|
|
|
152
|
+
# Air-gapped settings
|
|
153
|
+
sandbox_base = os.environ.get("SANDBOX_BASE", os.path.expanduser('~/.cache/pyodide'))
|
|
154
|
+
sandbox_tmp = os.path.join(sandbox_base, "tmp")
|
|
155
|
+
deno_cache = os.environ.get("DENO_DIR", os.path.expanduser('~/.cache/deno'))
|
|
156
|
+
|
|
178
157
|
# Configure sandbox with performance optimizations
|
|
179
158
|
self._sandbox = PyodideSandbox(
|
|
180
159
|
stateful=self.stateful,
|
|
160
|
+
#
|
|
161
|
+
allow_env=["SANDBOX_BASE"],
|
|
162
|
+
allow_read=[sandbox_base, sandbox_tmp, deno_cache],
|
|
163
|
+
allow_write=[sandbox_tmp, deno_cache],
|
|
164
|
+
#
|
|
181
165
|
allow_net=self.allow_net,
|
|
182
166
|
# Use auto node_modules_dir for better caching
|
|
183
167
|
node_modules_dir="auto"
|
|
@@ -225,10 +225,18 @@ def process_document_by_type(content, extension_source: str, document: Document
|
|
|
225
225
|
metadata={**document.metadata, 'chunk_id': 1}
|
|
226
226
|
)
|
|
227
227
|
return
|
|
228
|
+
#
|
|
229
|
+
chunks_counter = 0
|
|
228
230
|
for chunk in chunks:
|
|
231
|
+
chunks_counter += 1
|
|
232
|
+
metadata = {**document.metadata, **chunk.metadata}
|
|
233
|
+
#
|
|
234
|
+
# ensure each chunk has a unique chunk_id
|
|
235
|
+
metadata['chunk_id'] = chunks_counter
|
|
236
|
+
#
|
|
229
237
|
yield Document(
|
|
230
238
|
page_content=sanitize_for_postgres(chunk.page_content),
|
|
231
|
-
metadata=
|
|
239
|
+
metadata=metadata
|
|
232
240
|
)
|
|
233
241
|
|
|
234
242
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alita_sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.416
|
|
4
4
|
Summary: SDK for building langchain agents using resources from Alita
|
|
5
5
|
Author-email: Artem Rozumenko <artyom.rozumenko@gmail.com>, Mikalai Biazruchka <mikalai_biazruchka@epam.com>, Roman Mitusov <roman_mitusov@epam.com>, Ivan Krakhmaliuk <lifedj27@gmail.com>, Artem Dubrovskiy <ad13box@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -121,7 +121,7 @@ alita_sdk/runtime/tools/mcp_server_tool.py,sha256=MhLxZJ44LYrB_0GrojmkyqKoDRaqIH
|
|
|
121
121
|
alita_sdk/runtime/tools/pgvector_search.py,sha256=NN2BGAnq4SsDHIhUcFZ8d_dbEOM8QwB0UwpsWCYruXU,11692
|
|
122
122
|
alita_sdk/runtime/tools/prompt.py,sha256=nJafb_e5aOM1Rr3qGFCR-SKziU9uCsiP2okIMs9PppM,741
|
|
123
123
|
alita_sdk/runtime/tools/router.py,sha256=p7e0tX6YAWw2M2Nq0A_xqw1E2P-Xz1DaJvhUstfoZn4,1584
|
|
124
|
-
alita_sdk/runtime/tools/sandbox.py,sha256=
|
|
124
|
+
alita_sdk/runtime/tools/sandbox.py,sha256=LTCHC9xnuYThWX30PCTVEtjeg50FX7w2c29KU5E68W0,15251
|
|
125
125
|
alita_sdk/runtime/tools/tool.py,sha256=lE1hGi6qOAXG7qxtqxarD_XMQqTghdywf261DZawwno,5631
|
|
126
126
|
alita_sdk/runtime/tools/vectorstore.py,sha256=0SzfY1dYrGr7YUapJzXY01JFyzLv36dPjwHzs1XZIM4,34392
|
|
127
127
|
alita_sdk/runtime/tools/vectorstore_base.py,sha256=k_6LAhhBJEs5SXCQJI3bBvJLQli6_3pHjqF6SCQGJGc,28312
|
|
@@ -331,7 +331,7 @@ alita_sdk/tools/testrail/__init__.py,sha256=Xg4nVjULL_D8JpIXLYXppnwUfGF4-lguFwKH
|
|
|
331
331
|
alita_sdk/tools/testrail/api_wrapper.py,sha256=tQcGlFJmftvs5ZiO4tsP19fCo4CrJeq_UEvQR1liVfE,39891
|
|
332
332
|
alita_sdk/tools/utils/__init__.py,sha256=xB9OQgW65DftadrSpoAAitnEIbIXZKBOCji0NDe7FRM,3923
|
|
333
333
|
alita_sdk/tools/utils/available_tools_decorator.py,sha256=IbrdfeQkswxUFgvvN7-dyLMZMyXLiwvX7kgi3phciCk,273
|
|
334
|
-
alita_sdk/tools/utils/content_parser.py,sha256
|
|
334
|
+
alita_sdk/tools/utils/content_parser.py,sha256=KqiZzsurLspxCLemf9eqYhgW266FgWP4r-xElcK8a38,15881
|
|
335
335
|
alita_sdk/tools/vector_adapters/VectorStoreAdapter.py,sha256=-9ByRh8bVRraTcJPS7SE-2l3en6A4UkKGS9iAd9fa3w,19722
|
|
336
336
|
alita_sdk/tools/vector_adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
337
337
|
alita_sdk/tools/xray/__init__.py,sha256=eOMWP8VamFbbJgt1xrGpGPqB9ByOTA0Cd3LCaETzGk4,4376
|
|
@@ -353,8 +353,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
|
|
|
353
353
|
alita_sdk/tools/zephyr_squad/__init__.py,sha256=0ne8XLJEQSLOWfzd2HdnqOYmQlUliKHbBED5kW_Vias,2895
|
|
354
354
|
alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
|
|
355
355
|
alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
|
|
356
|
-
alita_sdk-0.3.
|
|
357
|
-
alita_sdk-0.3.
|
|
358
|
-
alita_sdk-0.3.
|
|
359
|
-
alita_sdk-0.3.
|
|
360
|
-
alita_sdk-0.3.
|
|
356
|
+
alita_sdk-0.3.416.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
357
|
+
alita_sdk-0.3.416.dist-info/METADATA,sha256=xpHzYFIm96DkXmUsu_JoplbDNalxbdA0xipgUA8GyNI,19071
|
|
358
|
+
alita_sdk-0.3.416.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
359
|
+
alita_sdk-0.3.416.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
|
360
|
+
alita_sdk-0.3.416.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|