alita-sdk 0.3.159__py3-none-any.whl → 0.3.161__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.
@@ -61,8 +61,8 @@ class Assistant:
61
61
  "Review toolkits configuration or use pipeline as master agent.")
62
62
 
63
63
  # configure memory store if memory tool is defined
64
- memory_tool = next((tool for tool in data['tools'] if tool['type'] == 'memory'), None)
65
- self._configure_store(memory_tool)
64
+ # memory_tool = next((tool for tool in data['tools'] if tool['type'] == 'memory'), None)
65
+ # self._configure_store(memory_tool)
66
66
 
67
67
  # Lazy import to avoid circular dependency
68
68
  from ..toolkits.tools import get_tools
@@ -67,6 +67,7 @@ def get_tools(tools_list: list, alita_client, llm, memory_store: BaseStore = Non
67
67
  selected_tools=[],
68
68
  llm=llm
69
69
  ))
70
+ # move on tools level
70
71
  # elif tool['type'] == 'memory':
71
72
  # if memory_store is None:
72
73
  # raise ToolException(f"Memory store is not provided for memory tool: {tool['name']}")
@@ -94,7 +95,7 @@ def get_tools(tools_list: list, alita_client, llm, memory_store: BaseStore = Non
94
95
  # Add community tools
95
96
  tools += community_tools(tools_list, alita_client, llm)
96
97
  # Add alita tools
97
- tools += alita_tools(tools_list, alita_client, llm, memory_store)
98
+ tools += alita_tools(tools_list, alita_client, llm)
98
99
  # Add MCP tools
99
100
  tools += _mcp_tools(tools_list, alita_client)
100
101
 
@@ -1,8 +1,5 @@
1
1
  import logging
2
2
  from importlib import import_module
3
- from typing import Optional
4
-
5
- from langgraph.store.base import BaseStore
6
3
 
7
4
  logger = logging.getLogger(__name__)
8
5
 
@@ -77,14 +74,13 @@ _safe_import_tool('carrier', 'carrier', 'get_tools', 'AlitaCarrierToolkit')
77
74
  _safe_import_tool('ocr', 'ocr', 'get_tools', 'OCRToolkit')
78
75
  _safe_import_tool('pptx', 'pptx', 'get_tools', 'PPTXToolkit')
79
76
  _safe_import_tool('postman', 'postman', 'get_tools', 'PostmanToolkit')
80
- _safe_import_tool('memory', 'memory', 'get_tools', 'MemoryToolkit')
81
77
 
82
78
  # Log import summary
83
79
  available_count = len(AVAILABLE_TOOLS)
84
80
  total_attempted = len(AVAILABLE_TOOLS) + len(FAILED_IMPORTS)
85
81
  logger.info(f"Tool imports completed: {available_count}/{total_attempted} successful")
86
82
 
87
- def get_tools(tools_list, alita, llm, store: Optional[BaseStore] = None, *args, **kwargs):
83
+ def get_tools(tools_list, alita, llm, *args, **kwargs):
88
84
  tools = []
89
85
  for tool in tools_list:
90
86
  # validate tool name syntax - it cannot be started with _
@@ -94,7 +90,6 @@ def get_tools(tools_list, alita, llm, store: Optional[BaseStore] = None, *args,
94
90
 
95
91
  tool['settings']['alita'] = alita
96
92
  tool['settings']['llm'] = llm
97
- tool['settings']['store'] = store
98
93
  tool_type = tool['type']
99
94
 
100
95
  # Check if tool is available and has get_tools function
@@ -15,13 +15,6 @@ from pydantic import create_model, BaseModel, ConfigDict, Field, SecretStr
15
15
 
16
16
  name = "memory"
17
17
 
18
- def get_tools(tool):
19
- return MemoryToolkit().get_toolkit(
20
- namespace=tool['settings'].get('namespace', str(tool['id'])),
21
- store=tool['settings'].get('store', None),
22
- toolkit_name=tool.get('toolkit_name', '')
23
- ).get_tools()
24
-
25
18
  class MemoryToolkit(BaseToolkit):
26
19
  tools: List[BaseTool] = []
27
20
 
@@ -1370,33 +1370,30 @@ class PostmanApiWrapper(BaseToolApiWrapper):
1370
1370
  def update_request_tests(self, request_path: str, tests: str, **kwargs) -> str:
1371
1371
  """Update request test scripts."""
1372
1372
  try:
1373
- # Get the request ID
1374
- _, request_id, _ = self._get_request_item_and_id(request_path)
1375
-
1376
- # Get current request to preserve existing data
1377
- current_request = self._make_request('GET', f'/collections/{self.collection_id}/requests/{request_id}')
1378
- request_data = current_request.get("data", {})
1373
+ # Get request item and ID
1374
+ request_item, request_id, _ = self._get_request_item_and_id(request_path)
1379
1375
 
1380
- # Prepare the events array - preserve any non-test events
1381
- events = [event for event in request_data.get("events", []) if event.get("listen") != "test"]
1376
+ # Get existing events and preserve non-test events
1377
+ existing_events = request_item.get("event", [])
1378
+ events = [event for event in existing_events if event.get("listen") != "test"]
1382
1379
 
1383
- # Add the new test script
1380
+ # Add the new test script using the official API format
1384
1381
  events.append({
1385
1382
  "listen": "test",
1386
1383
  "script": {
1387
- "type": "text/javascript",
1388
- "exec": tests.strip().split('\n')
1384
+ "exec": tests.strip().split('\n'),
1385
+ "type": "text/javascript"
1389
1386
  }
1390
1387
  })
1391
1388
 
1392
- # Update the events array in the request data
1393
- request_data["events"] = events
1394
-
1395
- # Update the request using the individual request endpoint
1389
+ # Create update payload using the events array format from official spec
1390
+ request_update = {
1391
+ "events": events
1392
+ }
1393
+
1394
+ # Update using the individual request endpoint with proper events format
1396
1395
  response = self._make_request('PUT', f'/collections/{self.collection_id}/requests/{request_id}',
1397
- json=request_data)
1398
-
1399
- logger.info(f"Test script updated successfully for request '{request_path}'")
1396
+ json=request_update)
1400
1397
  return json.dumps({"success": True, "message": f"Request '{request_path}' tests updated successfully"}, indent=2)
1401
1398
  except Exception as e:
1402
1399
  stacktrace = format_exc()
@@ -1407,33 +1404,30 @@ class PostmanApiWrapper(BaseToolApiWrapper):
1407
1404
  def update_request_pre_script(self, request_path: str, pre_request_script: str, **kwargs) -> str:
1408
1405
  """Update request pre-request scripts."""
1409
1406
  try:
1410
- # Get the request ID
1411
- _, request_id, _ = self._get_request_item_and_id(request_path)
1412
-
1413
- # Get current request to preserve existing data
1414
- current_request = self._make_request('GET', f'/collections/{self.collection_id}/requests/{request_id}')
1415
- request_data = current_request.get("data", {})
1407
+ # Get request item and ID
1408
+ request_item, request_id, _ = self._get_request_item_and_id(request_path)
1416
1409
 
1417
- # Prepare the events array - preserve any non-prerequest events
1418
- events = [event for event in request_data.get("events", []) if event.get("listen") != "prerequest"]
1410
+ # Get existing events and preserve non-prerequest events
1411
+ existing_events = request_item.get("event", [])
1412
+ events = [event for event in existing_events if event.get("listen") != "prerequest"]
1419
1413
 
1420
- # Add the new prerequest script
1414
+ # Add the new prerequest script using the official API format
1421
1415
  events.append({
1422
1416
  "listen": "prerequest",
1423
1417
  "script": {
1424
- "type": "text/javascript",
1425
- "exec": pre_request_script.strip().split('\n')
1418
+ "exec": pre_request_script.strip().split('\n'),
1419
+ "type": "text/javascript"
1426
1420
  }
1427
1421
  })
1428
1422
 
1429
- # Update the events array in the request data
1430
- request_data["events"] = events
1431
-
1432
- # Update the request using the individual request endpoint
1423
+ # Create update payload using the events array format from official spec
1424
+ request_update = {
1425
+ "events": events
1426
+ }
1427
+
1428
+ # Update using the individual request endpoint with proper events format
1433
1429
  response = self._make_request('PUT', f'/collections/{self.collection_id}/requests/{request_id}',
1434
- json=request_data)
1435
-
1436
- logger.info(f"Pre-request script updated successfully for request '{request_path}'")
1430
+ json=request_update)
1437
1431
  return json.dumps({"success": True, "message": f"Request '{request_path}' pre-script updated successfully"}, indent=2)
1438
1432
  except Exception as e:
1439
1433
  stacktrace = format_exc()
@@ -1612,16 +1606,14 @@ class PostmanApiWrapper(BaseToolApiWrapper):
1612
1606
  The script content as JSON string, or an error message if the script doesn't exist
1613
1607
  """
1614
1608
  try:
1615
- # Get the request ID and fetch current request data
1616
- _, request_id, _ = self._get_request_item_and_id(request_path)
1617
-
1618
- # Get current request to have the latest version with updated scripts
1619
- current_request = self._make_request('GET', f'/collections/{self.collection_id}/requests/{request_id}')
1620
- request_data = current_request.get("data", {})
1609
+ # Get the request item from the collection and also try individual endpoint
1610
+ request_item, request_id, _ = self._get_request_item_and_id(request_path)
1621
1611
 
1622
- # Find the script by type
1623
1612
  script_content = None
1624
- for event in request_data.get("events", []):
1613
+
1614
+ # Method 1: Check events array (modern format)
1615
+ events = request_item.get("event", [])
1616
+ for event in events:
1625
1617
  if event.get("listen") == script_type:
1626
1618
  script = event.get("script", {})
1627
1619
  exec_content = script.get("exec", [])
@@ -1631,13 +1623,25 @@ class PostmanApiWrapper(BaseToolApiWrapper):
1631
1623
  script_content = str(exec_content)
1632
1624
  break
1633
1625
 
1626
+ # Method 2: If not found in events, try individual request endpoint for direct fields
1634
1627
  if script_content is None:
1628
+ try:
1629
+ individual_request = self._make_request('GET', f'/collections/{self.collection_id}/requests/{request_id}')
1630
+ if script_type == "test":
1631
+ script_content = individual_request.get("tests", "")
1632
+ elif script_type == "prerequest":
1633
+ script_content = individual_request.get("preRequestScript", "")
1634
+ except:
1635
+ # If individual endpoint fails, that's okay, we'll fall back to not found
1636
+ pass
1637
+
1638
+ if not script_content or script_content.strip() == "":
1635
1639
  return json.dumps({"success": False, "message": f"No {script_type} script found for request '{request_path}'"}, indent=2)
1636
1640
 
1637
1641
  return json.dumps({
1638
1642
  "success": True,
1639
1643
  "script_type": script_type,
1640
- "script_content": script_content,
1644
+ "script_content": script_content.strip(),
1641
1645
  "request_path": request_path
1642
1646
  }, indent=2)
1643
1647
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.159
3
+ Version: 0.3.161
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 <lifedjik@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -31,8 +31,8 @@ Requires-Dist: langchain_community~=0.3.7; extra == "runtime"
31
31
  Requires-Dist: langchain-openai~=0.3.0; extra == "runtime"
32
32
  Requires-Dist: langgraph-checkpoint-sqlite~=2.0.0; extra == "runtime"
33
33
  Requires-Dist: langgraph-checkpoint-postgres~=2.0.1; extra == "runtime"
34
- Requires-Dist: langsmith>=0.3.45; extra == "runtime"
35
- Requires-Dist: langgraph>=0.4.8; extra == "runtime"
34
+ Requires-Dist: langsmith==0.1.144; extra == "runtime"
35
+ Requires-Dist: langgraph~=0.2.53; extra == "runtime"
36
36
  Requires-Dist: langchain_chroma~=0.2.2; extra == "runtime"
37
37
  Requires-Dist: langchain-unstructured~=0.1.6; extra == "runtime"
38
38
  Requires-Dist: langchain-postgres~=0.0.13; extra == "runtime"
@@ -122,7 +122,6 @@ Requires-Dist: yagmail==0.15.293; extra == "tools"
122
122
  Requires-Dist: pysnc==1.1.10; extra == "tools"
123
123
  Requires-Dist: shortuuid==1.0.13; extra == "tools"
124
124
  Requires-Dist: yarl==1.17.1; extra == "tools"
125
- Requires-Dist: langmem==0.0.27; extra == "tools"
126
125
  Provides-Extra: community
127
126
  Requires-Dist: retry-extended==0.2.3; extra == "community"
128
127
  Requires-Dist: browser-use==0.1.43; extra == "community"
@@ -48,7 +48,7 @@ alita_sdk/runtime/clients/client.py,sha256=jbC_M72CybwZgFfMRL6paj-NmICrSuk1vVnVT
48
48
  alita_sdk/runtime/clients/datasource.py,sha256=HAZovoQN9jBg0_-lIlGBQzb4FJdczPhkHehAiVG3Wx0,1020
49
49
  alita_sdk/runtime/clients/prompt.py,sha256=li1RG9eBwgNK_Qf0qUaZ8QNTmsncFrAL2pv3kbxZRZg,1447
50
50
  alita_sdk/runtime/langchain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
- alita_sdk/runtime/langchain/assistant.py,sha256=QJEMiEOrFMJ4GpnK24U2pKFblrvdQpKFdfhZsI2wAUI,7507
51
+ alita_sdk/runtime/langchain/assistant.py,sha256=1G4yBhBc-tXgqerujUVu5Z8T49m_7ov-7zYYsm-jGb4,7511
52
52
  alita_sdk/runtime/langchain/chat_message_template.py,sha256=kPz8W2BG6IMyITFDA5oeb5BxVRkHEVZhuiGl4MBZKdc,2176
53
53
  alita_sdk/runtime/langchain/constants.py,sha256=eHVJ_beJNTf1WJo4yq7KMK64fxsRvs3lKc34QCXSbpk,3319
54
54
  alita_sdk/runtime/langchain/indexer.py,sha256=0ENHy5EOhThnAiYFc7QAsaTNp9rr8hDV_hTK8ahbatk,37592
@@ -102,7 +102,7 @@ alita_sdk/runtime/toolkits/artifact.py,sha256=7fTr9VpGd2zwCB3EwW4aqWa5jVKRTunqV3
102
102
  alita_sdk/runtime/toolkits/datasource.py,sha256=qk78OdPoReYPCWwahfkKLbKc4pfsu-061oXRryFLP6I,2498
103
103
  alita_sdk/runtime/toolkits/prompt.py,sha256=WIpTkkVYWqIqOWR_LlSWz3ug8uO9tm5jJ7aZYdiGRn0,1192
104
104
  alita_sdk/runtime/toolkits/subgraph.py,sha256=ZYqI4yVLbEPAjCR8dpXbjbL2ipX598Hk3fL6AgaqFD4,1758
105
- alita_sdk/runtime/toolkits/tools.py,sha256=iDWnGpEnmiD226osSlMy7l5suUxOl6vDo8BTtzb8oCw,6128
105
+ alita_sdk/runtime/toolkits/tools.py,sha256=gCIEtdeD9u-za-oIZtJ916r9oSR9_0gCWE5FIKynWdU,6148
106
106
  alita_sdk/runtime/toolkits/vectorstore.py,sha256=BGppQADa1ZiLO17fC0uCACTTEvPHlodEDYEzUcBRbAA,2901
107
107
  alita_sdk/runtime/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
108
  alita_sdk/runtime/tools/agent.py,sha256=m98QxOHwnCRTT9j18Olbb5UPS8-ZGeQaGiUyZJSyFck,3162
@@ -129,7 +129,7 @@ alita_sdk/runtime/utils/logging.py,sha256=svPyiW8ztDfhqHFITv5FBCj8UhLxz6hWcqGIY6
129
129
  alita_sdk/runtime/utils/save_dataframe.py,sha256=i-E1wp-t4wb17Zq3nA3xYwgSILjoXNizaQAA9opWvxY,1576
130
130
  alita_sdk/runtime/utils/streamlit.py,sha256=z4J_bdxkA0zMROkvTB4u379YBRFCkKh-h7PD8RlnZWQ,85644
131
131
  alita_sdk/runtime/utils/utils.py,sha256=dM8whOJAuFJFe19qJ69-FLzrUp6d2G-G6L7d4ss2XqM,346
132
- alita_sdk/tools/__init__.py,sha256=F1Mrl8jEUUnmfg_VwrNcVSwJKPBp-xmh9vv9goPRA0o,9933
132
+ alita_sdk/tools/__init__.py,sha256=qsF21SiBa7P5gcWybCLP4K3xqA34LW9TVuM1QKaU-xc,9716
133
133
  alita_sdk/tools/elitea_base.py,sha256=NQaIxPX6DVIerHCb18jwUR6maZxxk73NZaTsFHkBQWE,21119
134
134
  alita_sdk/tools/ado/__init__.py,sha256=mD6GHcYMTtffPJkJvFPe2rzvye_IRmXmWfI7xYuZhO4,912
135
135
  alita_sdk/tools/ado/utils.py,sha256=PTCludvaQmPLakF2EbCGy66Mro4-rjDtavVP-xcB2Wc,1252
@@ -248,7 +248,7 @@ alita_sdk/tools/llm/llm_utils.py,sha256=v3_lWP_Nk6tJLkj0BYohOun0OWNfvzqLjPdPAMl-
248
248
  alita_sdk/tools/localgit/__init__.py,sha256=NScO0Eu-wl-rc63jjD5Qv1RXXB1qukSIJXx-yS_JQLI,2529
249
249
  alita_sdk/tools/localgit/local_git.py,sha256=gsAftNcK7nMCd8VsIkwDLs2SoG0MgpYdkQG5tmoynkA,18074
250
250
  alita_sdk/tools/localgit/tool.py,sha256=It_B24rMvFPurB355Oy5IShg2BsZTASsEoSS8hu2SXw,998
251
- alita_sdk/tools/memory/__init__.py,sha256=SOB5Lhf8v8v0-IDUXUgb1KNdv5je-ooi6oGor8iYPpI,2148
251
+ alita_sdk/tools/memory/__init__.py,sha256=QBzuOQapovmbcFS4nG39p3g-fUPp3kQrjh8EGk6VmBs,1901
252
252
  alita_sdk/tools/ocr/__init__.py,sha256=pvslKVXyJmK0q23FFDNieuc7RBIuzNXTjTNj-GqhGb0,3335
253
253
  alita_sdk/tools/ocr/api_wrapper.py,sha256=08UF8wj1sR8DcW0z16pw19bgLatLkBF8dySW-Ds8iRk,29649
254
254
  alita_sdk/tools/ocr/text_detection.py,sha256=1DBxt54r3_HdEi93QynSIVta3rH3UpIvy799TPtDTtk,23825
@@ -273,7 +273,7 @@ alita_sdk/tools/pandas/statsmodels/descriptive.py,sha256=APdofBnEiRhMrn6tLKwH076
273
273
  alita_sdk/tools/pandas/statsmodels/hypothesis_testing.py,sha256=fdNAayMB3W7avMfKJCcbf2_P54vUXbq8KVebOB48348,10508
274
274
  alita_sdk/tools/pandas/statsmodels/regression.py,sha256=Y1pWK4u_qzrfA740K-FX0nZ5FREGGPk8mfvykPIYoiI,9164
275
275
  alita_sdk/tools/postman/__init__.py,sha256=W0HdtACnTZw6tnzj7_qY_X5RoRyX3czcUSVaZJjBW-Y,4236
276
- alita_sdk/tools/postman/api_wrapper.py,sha256=4Hf_aOvUB1G_BdlKvNaAqnQaoCnKDph-E7v4VEwaw5Y,77933
276
+ alita_sdk/tools/postman/api_wrapper.py,sha256=DvdZtLPpe6LpsGfsF38UmNyDHjORwWWutisd5AVIogg,78094
277
277
  alita_sdk/tools/postman/postman_analysis.py,sha256=2d-Oi2UORosIePIUyncSONw9hY7dw8Zc7BQvCd4aqpg,45115
278
278
  alita_sdk/tools/pptx/__init__.py,sha256=LNSTQk0BncfdWLXAOGX2WXezG3D4qSEuYwLpokmF9iM,3438
279
279
  alita_sdk/tools/pptx/pptx_wrapper.py,sha256=yyCYcTlIY976kJ4VfPo4dyxj4yeii9j9TWP6W8ZIpN8,29195
@@ -317,8 +317,8 @@ alita_sdk/tools/zephyr_enterprise/api_wrapper.py,sha256=Ir3zHljhbZQJRJJQOBzS_GL5
317
317
  alita_sdk/tools/zephyr_enterprise/zephyr_enterprise.py,sha256=hV9LIrYfJT6oYp-ZfQR0YHflqBFPsUw2Oc55HwK0H48,6809
318
318
  alita_sdk/tools/zephyr_scale/__init__.py,sha256=2NTcdrfkx4GSegqyXhsPLsEpc4FlACuDy85b0fk6cAo,4572
319
319
  alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=UHVQUVqcBc3SZvDfO78HSuBzwAsRw2cCDQa-xMOzndE,68663
320
- alita_sdk-0.3.159.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
321
- alita_sdk-0.3.159.dist-info/METADATA,sha256=C4uRfDlRMstPa_EMg1hsUN1lHDkB80Xnme6REnRJ_Yk,18714
322
- alita_sdk-0.3.159.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
323
- alita_sdk-0.3.159.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
324
- alita_sdk-0.3.159.dist-info/RECORD,,
320
+ alita_sdk-0.3.161.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
321
+ alita_sdk-0.3.161.dist-info/METADATA,sha256=ybWYeKeLOJiQcnasyPl7i0jE6OTcqEmuVfmid62TT3A,18667
322
+ alita_sdk-0.3.161.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
323
+ alita_sdk-0.3.161.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
324
+ alita_sdk-0.3.161.dist-info/RECORD,,