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

@@ -793,7 +793,7 @@ class LangGraphAgentRunnable(CompiledStateGraph):
793
793
  # output = result['messages'][-1].content
794
794
  # else:
795
795
  # output = result['messages'][-1].content
796
- output = result['messages'][-1].content
796
+ output = next((msg.content for msg in reversed(result['messages']) if not isinstance(msg, HumanMessage)), result['messages'][-1].content)
797
797
  except:
798
798
  output = list(result.values())[-1]
799
799
  config_state = self.get_state(config)
@@ -340,7 +340,7 @@ class PostmanApiWrapper(BaseToolApiWrapper):
340
340
  raise ToolException(
341
341
  f"Invalid JSON response from Postman API: {str(e)}")
342
342
 
343
- def _apply_authentication(self, headers, params, all_variables, resolve_variables):
343
+ def _apply_authentication(self, headers, params, all_variables, native_auth, resolve_variables):
344
344
  """Apply authentication based on environment_config auth settings.
345
345
 
346
346
  Supports multiple authentication types:
@@ -363,14 +363,15 @@ class PostmanApiWrapper(BaseToolApiWrapper):
363
363
  import base64
364
364
 
365
365
  # Handle structured auth configuration only - no backward compatibility
366
- auth_config = self.environment_config.get('auth')
366
+ auth_config = self.environment_config.get('auth', native_auth)
367
367
  if auth_config and isinstance(auth_config, dict):
368
368
  auth_type = auth_config.get('type', '').lower()
369
369
  auth_params = auth_config.get('params', {})
370
370
 
371
371
  if auth_type == 'bearer':
372
372
  # Bearer token authentication
373
- token = resolve_variables(str(auth_params.get('token', '')))
373
+ tokent_raw = auth_config.get('bearer', [{}])[0].get('value', '')
374
+ token = resolve_variables(str(tokent_raw))
374
375
  if token:
375
376
  headers['Authorization'] = f'Bearer {token}'
376
377
 
@@ -739,7 +740,7 @@ class PostmanApiWrapper(BaseToolApiWrapper):
739
740
  all_variables = {}
740
741
 
741
742
  # 1. Start with environment_config variables (lowest priority)
742
- all_variables.update(self.environment_config)
743
+ all_variables.update(self._get_variables_from_env_config())
743
744
 
744
745
  # 2. Add collection variables
745
746
  collection_variables = collection_data.get('variable', [])
@@ -760,8 +761,8 @@ class PostmanApiWrapper(BaseToolApiWrapper):
760
761
  import re
761
762
  def replace_var(match):
762
763
  var_name = match.group(1)
763
- value = all_variables.get(var_name, match.group(0))
764
- return resolve_variables(value) if isinstance(value, str) else value
764
+ value = all_variables.get(var_name, None)
765
+ return resolve_variables(str(value)) if value else match.group(0)
765
766
 
766
767
  return re.sub(r'\{\{([^}]+)\}\}', replace_var, text)
767
768
 
@@ -792,7 +793,7 @@ class PostmanApiWrapper(BaseToolApiWrapper):
792
793
  headers = {}
793
794
 
794
795
  # Handle authentication from environment_config
795
- self._apply_authentication(headers, params, all_variables, resolve_variables)
796
+ self._apply_authentication(headers, params, all_variables, request_data.get('auth', None), resolve_variables)
796
797
 
797
798
  # Add headers from request
798
799
  request_headers = request_data.get('header', [])
@@ -1641,7 +1642,7 @@ class PostmanApiWrapper(BaseToolApiWrapper):
1641
1642
 
1642
1643
  # Find the request
1643
1644
  request_item = self.analyzer.find_request_by_path(
1644
- collection_data["item"], request_path)
1645
+ collection_data["item"], request_path, collection_data.get("auth", None))
1645
1646
  if not request_item:
1646
1647
  raise ToolException(f"Request '{request_path}' not found")
1647
1648
 
@@ -2162,3 +2163,12 @@ class PostmanApiWrapper(BaseToolApiWrapper):
2162
2163
  parse_items(items)
2163
2164
 
2164
2165
  return result
2166
+
2167
+ def _get_variables_from_env_config(self):
2168
+ """Extracts all enabled variables from the 'values' field in environment_config."""
2169
+ result = {}
2170
+ values = self.environment_config.get("values", [])
2171
+ for var in values:
2172
+ if var.get("enabled", True) and "key" in var and "value" in var:
2173
+ result[var["key"]] = var["value"]
2174
+ return result
@@ -1049,13 +1049,14 @@ class PostmanAnalyzer:
1049
1049
  find_in_items(items, path_parts)
1050
1050
  return results
1051
1051
 
1052
- def find_request_by_path(self, items: List[Dict], request_path: str) -> Optional[Dict]:
1052
+ def find_request_by_path(self, items: List[Dict], request_path: str, auth = None) -> Optional[Dict]:
1053
1053
  """Find a request by its path."""
1054
1054
  path_parts = [part.strip() for part in request_path.split('/') if part.strip()]
1055
1055
  if not path_parts:
1056
1056
  return None
1057
1057
 
1058
1058
  current_items = items
1059
+ current_auth = auth
1059
1060
 
1060
1061
  # Navigate through folders to the request
1061
1062
  for i, part in enumerate(path_parts):
@@ -1065,6 +1066,9 @@ class PostmanAnalyzer:
1065
1066
  if i == len(path_parts) - 1:
1066
1067
  # This should be the request
1067
1068
  if item.get('request'):
1069
+ # if request has no auth, inherit from parent
1070
+ if not item['request'].get('auth') and current_auth:
1071
+ item['request']['auth'] = current_auth
1068
1072
  return item
1069
1073
  else:
1070
1074
  return None
@@ -1072,6 +1076,9 @@ class PostmanAnalyzer:
1072
1076
  # This should be a folder
1073
1077
  if item.get('item'):
1074
1078
  current_items = item['item']
1079
+ # Update current_auth if folder has auth
1080
+ if item.get('auth'):
1081
+ current_auth = item['auth']
1075
1082
  found = True
1076
1083
  break
1077
1084
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.367
3
+ Version: 0.3.368
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
@@ -44,7 +44,7 @@ alita_sdk/runtime/langchain/assistant.py,sha256=2tH8je9uKegIIIZUuiGU4zqRVg7jyQas
44
44
  alita_sdk/runtime/langchain/chat_message_template.py,sha256=kPz8W2BG6IMyITFDA5oeb5BxVRkHEVZhuiGl4MBZKdc,2176
45
45
  alita_sdk/runtime/langchain/constants.py,sha256=eHVJ_beJNTf1WJo4yq7KMK64fxsRvs3lKc34QCXSbpk,3319
46
46
  alita_sdk/runtime/langchain/indexer.py,sha256=0ENHy5EOhThnAiYFc7QAsaTNp9rr8hDV_hTK8ahbatk,37592
47
- alita_sdk/runtime/langchain/langraph_agent.py,sha256=n7zhgMSB5p2OwaWu4sZGcJR4RpZNvAO9uNLxN2ImgQA,48109
47
+ alita_sdk/runtime/langchain/langraph_agent.py,sha256=NvoaAZLgb-gcRv14LnZHBFajWHTbimx6QJ9EyOaomoE,48207
48
48
  alita_sdk/runtime/langchain/mixedAgentParser.py,sha256=M256lvtsL3YtYflBCEp-rWKrKtcY1dJIyRGVv7KW9ME,2611
49
49
  alita_sdk/runtime/langchain/mixedAgentRenderes.py,sha256=asBtKqm88QhZRILditjYICwFVKF5KfO38hu2O-WrSWE,5964
50
50
  alita_sdk/runtime/langchain/store_manager.py,sha256=i8Fl11IXJhrBXq1F1ukEVln57B1IBe-tqSUvfUmBV4A,2218
@@ -297,8 +297,8 @@ alita_sdk/tools/pandas/statsmodels/descriptive.py,sha256=APdofBnEiRhMrn6tLKwH076
297
297
  alita_sdk/tools/pandas/statsmodels/hypothesis_testing.py,sha256=fdNAayMB3W7avMfKJCcbf2_P54vUXbq8KVebOB48348,10508
298
298
  alita_sdk/tools/pandas/statsmodels/regression.py,sha256=Y1pWK4u_qzrfA740K-FX0nZ5FREGGPk8mfvykPIYoiI,9164
299
299
  alita_sdk/tools/postman/__init__.py,sha256=2bvyhAqmAwXjswiPiuMaB7caU44k5rAWyeR58pc1ksU,4472
300
- alita_sdk/tools/postman/api_wrapper.py,sha256=TY8ddkrFWTsMWK9Dd0cTXNCmihhfbxFw8EqK-kBPwv4,96458
301
- alita_sdk/tools/postman/postman_analysis.py,sha256=2d-Oi2UORosIePIUyncSONw9hY7dw8Zc7BQvCd4aqpg,45115
300
+ alita_sdk/tools/postman/api_wrapper.py,sha256=bTVDEeezRp9-fhot4MFX3-DOr_soJB5eOMVjNPmg6Fg,97013
301
+ alita_sdk/tools/postman/postman_analysis.py,sha256=ckc2BfKEop0xnmLPksVRE_Y94ixuqOGowaClBzHCSn4,45560
302
302
  alita_sdk/tools/pptx/__init__.py,sha256=vVUrWnj7KWJgEk9oxGSsCAQ2SMSXrp_SFOdUHYQKcAo,3444
303
303
  alita_sdk/tools/pptx/pptx_wrapper.py,sha256=yyCYcTlIY976kJ4VfPo4dyxj4yeii9j9TWP6W8ZIpN8,29195
304
304
  alita_sdk/tools/qtest/__init__.py,sha256=Jf0xo5S_4clXR2TfCbJbB1sFgCbcFQRM-YYX2ltWBzo,4461
@@ -352,8 +352,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
352
352
  alita_sdk/tools/zephyr_squad/__init__.py,sha256=0ne8XLJEQSLOWfzd2HdnqOYmQlUliKHbBED5kW_Vias,2895
353
353
  alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
354
354
  alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
355
- alita_sdk-0.3.367.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
356
- alita_sdk-0.3.367.dist-info/METADATA,sha256=Vl32B-AoI7amFTAWHAv_2TaEthWlRBcuOm5WiG8XaH4,19071
357
- alita_sdk-0.3.367.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
358
- alita_sdk-0.3.367.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
359
- alita_sdk-0.3.367.dist-info/RECORD,,
355
+ alita_sdk-0.3.368.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
356
+ alita_sdk-0.3.368.dist-info/METADATA,sha256=D_3Xrhff7tC9ezLl5uIYNB2gf32WvzqdvJJIJb8KeZ8,19071
357
+ alita_sdk-0.3.368.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
358
+ alita_sdk-0.3.368.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
359
+ alita_sdk-0.3.368.dist-info/RECORD,,