alita-sdk 0.3.516__py3-none-any.whl → 0.3.522__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.

Potentially problematic release.


This version of alita-sdk might be problematic. Click here for more details.

@@ -278,6 +278,7 @@ class Assistant:
278
278
  prompt_instructions = self.prompt
279
279
 
280
280
  # Add tool binding only if tools are present
281
+ tool_names = []
281
282
  if simple_tools:
282
283
  tool_names = [tool.name for tool in simple_tools]
283
284
  logger.info("Binding tools: %s", tool_names)
@@ -290,8 +291,8 @@ class Assistant:
290
291
  plan_addon = PLAN_ADDON if 'update_plan' in tool_names else ""
291
292
  pyodite_addon = PYODITE_ADDON if 'pyodide_sandbox' in tool_names else ""
292
293
  escaped_prompt = DEFAULT_ASSISTANT.format(
293
- user_addon=user_addon,
294
- plan_addon=plan_addon,
294
+ users_instructions=user_addon,
295
+ planning_instructions=plan_addon,
295
296
  pyodite_addon=pyodite_addon
296
297
  )
297
298
 
@@ -345,14 +345,136 @@ PYODITE_ADDON = """
345
345
 
346
346
  ## Using the Python (Pyodide) sandbox
347
347
 
348
- Python sandbox is available, it runs in a **Pyodide (browser-based) environment** with limitations:
348
+ Python sandbox available via `pyodide_sandbox` (stateless) or `stateful_pyodide_sandbox` tools.
349
+
350
+ ### Use for:
351
+ - Lightweight data analysis, parsing, validation
352
+ - Testing algorithms and calculations
353
+ - Processing standard library modules
354
+
355
+ ### Limitations:
356
+ - No local filesystem access (beyond sandbox cache)
357
+ - No OS commands or subprocess operations
358
+ - No native C extensions
359
+ - No background processes
360
+
361
+ ### CRITICAL: How to return results
362
+
363
+ The sandbox returns a dict with these keys:
364
+ - **`result`**: The last evaluated expression (final line without assignment)
365
+ - **`output`**: Anything printed via `print()`
366
+ - **`error`**: Any stderr output
367
+ - **`execution_info`**: Timing and package info
368
+
369
+ **Two valid patterns to return data:**
370
+
371
+ ✅ Option 1 - Last expression (returned in `result` key):
372
+ ```python
373
+ import json
374
+ data = {"result": 42, "status": "complete"}
375
+ data # Auto-captured as result
376
+ ```
377
+
378
+ ✅ Option 2 - Print output (returned in `output` key):
379
+ ```python
380
+ import json
381
+ data = {"result": 42, "status": "complete"}
382
+ print(json.dumps(data)) # Captured as output
383
+ ```
384
+
385
+ Both work! Choose based on preference. For structured data, JSON format is recommended.
386
+
387
+ ### Using alita_client (auto-injected)
388
+
389
+ The `alita_client` object is automatically available in sandbox code. It provides access to Alita platform APIs.
390
+
391
+ **Key capabilities:**
392
+
393
+ **Artifacts** - Store/retrieve files in buckets:
394
+ ```python
395
+ # Get artifact from bucket and decode
396
+ csv_data = alita_client.artifact('my_bucket').get('file.csv').decode('utf-8')
397
+
398
+ # Create/overwrite artifact
399
+ alita_client.artifact('my_bucket').create('output.txt', 'data content')
400
+
401
+ # List artifacts in bucket
402
+ files = alita_client.artifact('my_bucket').list()
403
+
404
+ # Append to artifact
405
+ alita_client.artifact('my_bucket').append('log.txt', 'new line\\n')
406
+
407
+ # Delete artifact
408
+ alita_client.artifact('my_bucket').delete('old_file.txt')
409
+ ```
410
+
411
+ **Secrets** - Access stored credentials:
412
+ ```python
413
+ api_key = alita_client.unsecret('my_api_key')
414
+ ```
415
+
416
+ **MCP Tools** - Call Model Context Protocol tools:
417
+ ```python
418
+ # List available tools
419
+ tools = alita_client.get_mcp_toolkits()
420
+
421
+ # Call a tool
422
+ result = alita_client.mcp_tool_call({
423
+ 'server_name': 'my_server',
424
+ 'params': {
425
+ 'name': 'tool_name',
426
+ 'arguments': {'arg1': 'value1'}
427
+ }
428
+ })
429
+ ```
430
+
431
+ **Toolkits** - Instantiate and use toolkits:
432
+ ```python
433
+ toolkit = alita_client.toolkit(toolkit_id=123)
434
+ ```
435
+
436
+ **Applications** - Get app details:
437
+ ```python
438
+ apps = alita_client.get_list_of_apps()
439
+ app_details = alita_client.get_app_details(application_id=456)
440
+ ```
441
+
442
+ **Image Generation**:
443
+ ```python
444
+ result = alita_client.generate_image(
445
+ prompt="A sunset over mountains",
446
+ n=1,
447
+ size="1024x1024"
448
+ )
449
+ ```
450
+
451
+ **Common pattern - Load CSV from artifacts:**
452
+ ```python
453
+ import csv
454
+ from io import StringIO
455
+
456
+ # Load CSV from artifact
457
+ csv_text = alita_client.artifact('tests').get('data.csv').decode('utf-8')
458
+
459
+ # Parse CSV
460
+ reader = csv.DictReader(StringIO(csv_text))
461
+ data = list(reader)
462
+
463
+ # Return result
464
+ data
465
+ ```
466
+
467
+ ### Execution modes:
468
+ - **Stateless** (default): Faster, each run starts fresh
469
+ - **Stateful**: Preserves variables/imports between calls
349
470
 
350
- - Use it only for lightweight data analysis, parsing, transformation, or validation
351
- - Do not assume access to the local filesystem, network, OS commands, or background processes
352
- - Do not attempt `pip install` or rely on unavailable native extensions
353
- - Treat all inputs as in-memory data provided by the harness or previous tool outputs
354
- - For large datasets, long-running tasks, or environment-dependent execution, request an external tool or user-provided artifacts instead
471
+ ### Code requirements:
472
+ 1. Always include necessary imports
473
+ 2. Either end with an expression OR use `print()` for output
474
+ 3. Work with in-memory data only
475
+ 4. Include error handling with try-except
355
476
 
356
- If a task cannot be reliably executed in Pyodide, explicitly state the limitation and propose an alternative approach.
477
+ ### When NOT to use:
478
+ For large datasets, long-running tasks, or native system access, request alternative tools instead.
357
479
 
358
480
  """
@@ -22,7 +22,8 @@ class ApplicationToolkit(BaseToolkit):
22
22
 
23
23
  @classmethod
24
24
  def get_toolkit(cls, client: 'AlitaClient', application_id: int, application_version_id: int,
25
- selected_tools: list[str] = [], store: Optional[BaseStore] = None):
25
+ selected_tools: list[str] = [], store: Optional[BaseStore] = None,
26
+ ignored_mcp_servers: Optional[list] = None):
26
27
 
27
28
  app_details = client.get_app_details(application_id)
28
29
  version_details = client.get_app_version_details(application_id, application_version_id)
@@ -34,7 +35,8 @@ class ApplicationToolkit(BaseToolkit):
34
35
 
35
36
  app = client.application(application_id, application_version_id, store=store,
36
37
  llm=client.get_llm(version_details['llm_settings']['model_name'],
37
- model_settings))
38
+ model_settings),
39
+ ignored_mcp_servers=ignored_mcp_servers)
38
40
  return cls(tools=[Application(name=app_details.get("name"),
39
41
  description=app_details.get("description"),
40
42
  application=app,
@@ -46,6 +48,7 @@ class ApplicationToolkit(BaseToolkit):
46
48
  "application_version_id": application_version_id,
47
49
  "store": store,
48
50
  "llm": client.get_llm(version_details['llm_settings']['model_name'], model_settings),
51
+ "ignored_mcp_servers": ignored_mcp_servers,
49
52
  })])
50
53
 
51
54
  def get_tools(self):
@@ -59,7 +59,8 @@ def get_tools(tools_list: list, alita_client=None, llm=None, memory_store: BaseS
59
59
  alita_client,
60
60
  application_id=int(tool['settings']['application_id']),
61
61
  application_version_id=int(tool['settings']['application_version_id']),
62
- selected_tools=[]
62
+ selected_tools=[],
63
+ ignored_mcp_servers=ignored_mcp_servers
63
64
  ).get_tools())
64
65
  # backward compatibility for pipeline application type as subgraph node
65
66
  if tool.get('agent_type', '') == 'pipeline':
@@ -697,7 +697,7 @@ class TestrailAPIWrapper(NonCodeIndexerToolkit):
697
697
  'id': str(case.get('id', '')),
698
698
  IndexerKeywords.UPDATED_ON.value: case.get('updated_on') or -1,
699
699
  'labels': [lbl['title'] for lbl in case.get('labels', [])],
700
- 'type': case.get('type_id') or -1,
700
+ 'type': "testrail_test_case",
701
701
  'priority': case.get('priority_id') or -1,
702
702
  'milestone': case.get('milestone_id') or -1,
703
703
  'estimate': case.get('estimate') or '',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.516
3
+ Version: 0.3.522
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
@@ -100,9 +100,9 @@ alita_sdk/runtime/clients/mcp_manager.py,sha256=DRbqiO761l7UgOdv_keHbD2g0oZodtPH
100
100
  alita_sdk/runtime/clients/prompt.py,sha256=li1RG9eBwgNK_Qf0qUaZ8QNTmsncFrAL2pv3kbxZRZg,1447
101
101
  alita_sdk/runtime/clients/sandbox_client.py,sha256=4GLoCFZXtTYKM3SFMJAfFO7QNE38c1V7DI1b88uOySY,17227
102
102
  alita_sdk/runtime/langchain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
103
- alita_sdk/runtime/langchain/assistant.py,sha256=-w7gfBlpW27q4O8jF1ba9qaQnprPGynNRcsnAYynOYc,18404
103
+ alita_sdk/runtime/langchain/assistant.py,sha256=yVTosONjQYUHbzhtTWG53odpXbWCQLLe18oaqniqvx8,18447
104
104
  alita_sdk/runtime/langchain/chat_message_template.py,sha256=kPz8W2BG6IMyITFDA5oeb5BxVRkHEVZhuiGl4MBZKdc,2176
105
- alita_sdk/runtime/langchain/constants.py,sha256=h6FBMOLT-vDuDI-s49sd4LUi5qwFJwYq1Ysptltiy8Y,14427
105
+ alita_sdk/runtime/langchain/constants.py,sha256=tbVA-OPRDzEMspO9raOj_jb57Yt-TUYulG6FOXCmu78,17150
106
106
  alita_sdk/runtime/langchain/indexer.py,sha256=0ENHy5EOhThnAiYFc7QAsaTNp9rr8hDV_hTK8ahbatk,37592
107
107
  alita_sdk/runtime/langchain/langraph_agent.py,sha256=4rWJ6tQXIzVHgF9zzDL3kiR67rvBAxrJxpglJ6Z_2w0,59364
108
108
  alita_sdk/runtime/langchain/mixedAgentParser.py,sha256=M256lvtsL3YtYflBCEp-rWKrKtcY1dJIyRGVv7KW9ME,2611
@@ -157,7 +157,7 @@ alita_sdk/runtime/llms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
157
157
  alita_sdk/runtime/llms/preloaded.py,sha256=tZ_-nIV91cjgdNV5xw5cIlvia9CYUG94PTsoNRmTF-I,11223
158
158
  alita_sdk/runtime/models/mcp_models.py,sha256=rbWCAtF8Jjb7uNgQHhVWyDttXaqPNbRLL087Lf0AjNU,2301
159
159
  alita_sdk/runtime/toolkits/__init__.py,sha256=7bic6YGLiyAwFD3KZvrntWqS57sND72VoGBhuAx75yI,692
160
- alita_sdk/runtime/toolkits/application.py,sha256=EyYdGTJzsqz6pV3XAywy8BR2kYU6QNRar7QcC9-WGSI,2714
160
+ alita_sdk/runtime/toolkits/application.py,sha256=iHs6PzNIbwalDtSP2LuIsqiWGxQSFI2pubKXIFGPB8k,2938
161
161
  alita_sdk/runtime/toolkits/artifact.py,sha256=_m7Ppwc04cpL0RPU_5ZHXFjBIWLeylv1if-H16OvF-o,3737
162
162
  alita_sdk/runtime/toolkits/configurations.py,sha256=kIDAlnryPQfbZyFxV-9SzN2-Vefzx06TX1BBdIIpN90,141
163
163
  alita_sdk/runtime/toolkits/datasource.py,sha256=ZNPCAAZKy90u_5CKkr6fi7gaLuao2KOIV8spGjb-AbA,2926
@@ -165,7 +165,7 @@ alita_sdk/runtime/toolkits/mcp.py,sha256=4KOobcuCUsZGza1CJ0EUdYRTL9v4pJwM2Joswxi
165
165
  alita_sdk/runtime/toolkits/planning.py,sha256=6i83WDkjRs-b8UNlDub44NHzUFUgTVuxQ_IHSuHI85U,7433
166
166
  alita_sdk/runtime/toolkits/prompt.py,sha256=WIpTkkVYWqIqOWR_LlSWz3ug8uO9tm5jJ7aZYdiGRn0,1192
167
167
  alita_sdk/runtime/toolkits/subgraph.py,sha256=wwUK8JjPXkGzyVZ3tAukmvST6eGbqx_U11rpnmbrvtg,2105
168
- alita_sdk/runtime/toolkits/tools.py,sha256=MGhyp5K5fRKCa4g2qorIfM_xHngDQZjltHYDtjXH_PI,17586
168
+ alita_sdk/runtime/toolkits/tools.py,sha256=WjoszaL2o-w_8vy0JkulXc02HP_vNdvl-CWwWTkkYO8,17647
169
169
  alita_sdk/runtime/toolkits/vectorstore.py,sha256=H-HQsHhLm-vQWS3kvwkh-OHrOWKuylBXcSH9cQo5jKM,3282
170
170
  alita_sdk/runtime/tools/__init__.py,sha256=Fx7iHqkzA90-KfjdcUUzMUI_7kDarjuTsSpSzOW2pN0,568
171
171
  alita_sdk/runtime/tools/agent.py,sha256=m98QxOHwnCRTT9j18Olbb5UPS8-ZGeQaGiUyZJSyFck,3162
@@ -401,7 +401,7 @@ alita_sdk/tools/sql/models.py,sha256=AKJgSl_kEEz4fZfw3kbvdGHXaRZ-yiaqfJOB6YOj3i0
401
401
  alita_sdk/tools/testio/__init__.py,sha256=KttkGmwKRlY5OG6kr_ZTrMXECpea-61B4w3Z5zlDtB4,2904
402
402
  alita_sdk/tools/testio/api_wrapper.py,sha256=BvmL5h634BzG6p7ajnQLmj-uoAw1gjWnd4FHHu1h--Q,21638
403
403
  alita_sdk/tools/testrail/__init__.py,sha256=oyw1bmITlfb1cusInMpc-Nuh0XwKV7yxjmW6veXr_n4,4561
404
- alita_sdk/tools/testrail/api_wrapper.py,sha256=tQcGlFJmftvs5ZiO4tsP19fCo4CrJeq_UEvQR1liVfE,39891
404
+ alita_sdk/tools/testrail/api_wrapper.py,sha256=XycH0iEH2cCAv7InJotmsGE9lPj6hP45Za1d2jSQ_Lg,39886
405
405
  alita_sdk/tools/utils/__init__.py,sha256=Bt1TsxkQIezgkxCgn5wFIOMsTsW5vEoWdM6KznodktU,4027
406
406
  alita_sdk/tools/utils/available_tools_decorator.py,sha256=IbrdfeQkswxUFgvvN7-dyLMZMyXLiwvX7kgi3phciCk,273
407
407
  alita_sdk/tools/utils/content_parser.py,sha256=KqiZzsurLspxCLemf9eqYhgW266FgWP4r-xElcK8a38,15881
@@ -427,9 +427,9 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
427
427
  alita_sdk/tools/zephyr_squad/__init__.py,sha256=gZTEanHf9pRCiZaKobF4Wbm33wUxxXoIjOr544TcXas,2903
428
428
  alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
429
429
  alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
430
- alita_sdk-0.3.516.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
431
- alita_sdk-0.3.516.dist-info/METADATA,sha256=ig9rddgKLhojWxyfHNUX9PjKHzJLJ9YNJStMSdNiAz4,24266
432
- alita_sdk-0.3.516.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
433
- alita_sdk-0.3.516.dist-info/entry_points.txt,sha256=VijN0h4alp1WXm8tfS3P7vuGxN4a5RZqHjXAoEIBZnI,49
434
- alita_sdk-0.3.516.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
435
- alita_sdk-0.3.516.dist-info/RECORD,,
430
+ alita_sdk-0.3.522.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
431
+ alita_sdk-0.3.522.dist-info/METADATA,sha256=wfMuqtLZNiFVBOEI0aUg4OV61OhqNGmnpp5j4LNKxo8,24266
432
+ alita_sdk-0.3.522.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
433
+ alita_sdk-0.3.522.dist-info/entry_points.txt,sha256=VijN0h4alp1WXm8tfS3P7vuGxN4a5RZqHjXAoEIBZnI,49
434
+ alita_sdk-0.3.522.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
435
+ alita_sdk-0.3.522.dist-info/RECORD,,