alita-sdk 0.3.326__py3-none-any.whl → 0.3.327__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.
- alita_sdk/runtime/langchain/langraph_agent.py +31 -2
- alita_sdk/runtime/langchain/utils.py +3 -0
- alita_sdk/tools/utils/__init__.py +2 -0
- {alita_sdk-0.3.326.dist-info → alita_sdk-0.3.327.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.326.dist-info → alita_sdk-0.3.327.dist-info}/RECORD +8 -8
- {alita_sdk-0.3.326.dist-info → alita_sdk-0.3.327.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.326.dist-info → alita_sdk-0.3.327.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.326.dist-info → alita_sdk-0.3.327.dist-info}/top_level.txt +0 -0
|
@@ -248,10 +248,11 @@ class StateModifierNode(Runnable):
|
|
|
248
248
|
|
|
249
249
|
# Collect input variables from state
|
|
250
250
|
input_data = {}
|
|
251
|
+
|
|
251
252
|
for var in self.input_variables:
|
|
252
253
|
if var in state:
|
|
253
254
|
input_data[var] = state.get(var)
|
|
254
|
-
|
|
255
|
+
type_of_output = type(state.get(self.output_variables[0])) if self.output_variables else None
|
|
255
256
|
# Render the template using Jinja
|
|
256
257
|
import json
|
|
257
258
|
from jinja2 import Environment
|
|
@@ -269,7 +270,35 @@ class StateModifierNode(Runnable):
|
|
|
269
270
|
if len(self.output_variables) > 0:
|
|
270
271
|
# Use the first output variable to store the rendered content
|
|
271
272
|
output_var = self.output_variables[0]
|
|
272
|
-
|
|
273
|
+
|
|
274
|
+
# Convert rendered_message to the appropriate type
|
|
275
|
+
if type_of_output is not None:
|
|
276
|
+
try:
|
|
277
|
+
if type_of_output == dict:
|
|
278
|
+
result[output_var] = json.loads(rendered_message) if isinstance(rendered_message, str) else dict(rendered_message)
|
|
279
|
+
elif type_of_output == list:
|
|
280
|
+
result[output_var] = json.loads(rendered_message) if isinstance(rendered_message, str) else list(rendered_message)
|
|
281
|
+
elif type_of_output == int:
|
|
282
|
+
result[output_var] = int(rendered_message)
|
|
283
|
+
elif type_of_output == float:
|
|
284
|
+
result[output_var] = float(rendered_message)
|
|
285
|
+
elif type_of_output == str:
|
|
286
|
+
result[output_var] = str(rendered_message)
|
|
287
|
+
elif type_of_output == bool:
|
|
288
|
+
if isinstance(rendered_message, str):
|
|
289
|
+
result[output_var] = rendered_message.lower() in ('true', '1', 'yes', 'on')
|
|
290
|
+
else:
|
|
291
|
+
result[output_var] = bool(rendered_message)
|
|
292
|
+
elif type_of_output == type(None):
|
|
293
|
+
result[output_var] = None
|
|
294
|
+
else:
|
|
295
|
+
# Fallback to string if type is not recognized
|
|
296
|
+
result[output_var] = str(rendered_message)
|
|
297
|
+
except (ValueError, TypeError, json.JSONDecodeError) as e:
|
|
298
|
+
logger.warning(f"Failed to convert rendered_message to {type_of_output.__name__}: {e}. Using string fallback.")
|
|
299
|
+
result[output_var] = str(rendered_message)
|
|
300
|
+
else:
|
|
301
|
+
result[output_var] = rendered_message
|
|
273
302
|
|
|
274
303
|
# Clean up specified variables (make them empty, not delete)
|
|
275
304
|
|
|
@@ -121,6 +121,8 @@ def parse_type(type_str):
|
|
|
121
121
|
"""Parse a type string into an actual Python type."""
|
|
122
122
|
try:
|
|
123
123
|
# Evaluate the type string using builtins and imported modules
|
|
124
|
+
if type_str == 'number':
|
|
125
|
+
type_str = 'int'
|
|
124
126
|
return eval(type_str, {**vars(builtins), **globals()})
|
|
125
127
|
except Exception as e:
|
|
126
128
|
print(f"Error parsing type: {e}")
|
|
@@ -138,6 +140,7 @@ def create_state(data: Optional[dict] = None):
|
|
|
138
140
|
state_dict[key] = Annotated[list[AnyMessage], add_messages]
|
|
139
141
|
elif value in ['str', 'int', 'float', 'bool', 'list', 'dict', 'number']:
|
|
140
142
|
state_dict[key] = parse_type(value)
|
|
143
|
+
logger.debug(f"Created state: {state_dict}")
|
|
141
144
|
return TypedDict('State', state_dict)
|
|
142
145
|
|
|
143
146
|
def create_typed_dict_from_yaml(data):
|
|
@@ -55,6 +55,8 @@ def parse_type(type_str):
|
|
|
55
55
|
"""Parse a type string into an actual Python type."""
|
|
56
56
|
try:
|
|
57
57
|
# Evaluate the type string using builtins and imported modules
|
|
58
|
+
if type_str == 'number':
|
|
59
|
+
type_str = 'int'
|
|
58
60
|
return eval(type_str, {**vars(builtins), **globals()})
|
|
59
61
|
except Exception as e:
|
|
60
62
|
print(f"Error parsing type: {e}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alita_sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.327
|
|
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,11 +44,11 @@ alita_sdk/runtime/langchain/assistant.py,sha256=1Eq8BIefp8suhbC9CssoOXtC-plkemoU
|
|
|
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=
|
|
47
|
+
alita_sdk/runtime/langchain/langraph_agent.py,sha256=oCUK2f8YdI96AZU0HmETnq78VWUv0weTltCH2q53qEU,46878
|
|
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
|
|
51
|
-
alita_sdk/runtime/langchain/utils.py,sha256=
|
|
51
|
+
alita_sdk/runtime/langchain/utils.py,sha256=r5X00cgUjx4OwjwxHCnSyO-AbAw2gPVvBx2KfQr87lw,6742
|
|
52
52
|
alita_sdk/runtime/langchain/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
alita_sdk/runtime/langchain/agents/xml_chat.py,sha256=Mx7PK5T97_GrFCwHHZ3JZP42S7MwtUzV0W-_8j6Amt8,6212
|
|
54
54
|
alita_sdk/runtime/langchain/document_loaders/AlitaBDDScenariosLoader.py,sha256=4kFU1ijrM1Jw7cywQv8mUiBHlE6w-uqfzSZP4hUV5P4,3771
|
|
@@ -325,7 +325,7 @@ alita_sdk/tools/testio/__init__.py,sha256=NEvQtzsffqAXryaffVk0GpdcxZQ1AMkfeztnxH
|
|
|
325
325
|
alita_sdk/tools/testio/api_wrapper.py,sha256=BvmL5h634BzG6p7ajnQLmj-uoAw1gjWnd4FHHu1h--Q,21638
|
|
326
326
|
alita_sdk/tools/testrail/__init__.py,sha256=Xg4nVjULL_D8JpIXLYXppnwUfGF4-lguFwKHmP5VwxM,4696
|
|
327
327
|
alita_sdk/tools/testrail/api_wrapper.py,sha256=PKhtf04C6PFDexGCAJm-hjA9Gpu4crx6EXKT5K-b_Pk,32985
|
|
328
|
-
alita_sdk/tools/utils/__init__.py,sha256=
|
|
328
|
+
alita_sdk/tools/utils/__init__.py,sha256=W9rCCUPtHCP5nGAbWp0n5jaNA84572aiRoqKneBnaS4,3330
|
|
329
329
|
alita_sdk/tools/utils/available_tools_decorator.py,sha256=IbrdfeQkswxUFgvvN7-dyLMZMyXLiwvX7kgi3phciCk,273
|
|
330
330
|
alita_sdk/tools/utils/content_parser.py,sha256=7k5Ddv3Nzp3UoocgslwwSXi1G9ZR7sXzj6593IDeOcM,14063
|
|
331
331
|
alita_sdk/tools/vector_adapters/VectorStoreAdapter.py,sha256=ypBEAkFRGHv5edW0N9rdo1yKurNGQ4pRVEWtrN_7SeA,17656
|
|
@@ -349,8 +349,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
|
|
|
349
349
|
alita_sdk/tools/zephyr_squad/__init__.py,sha256=0ne8XLJEQSLOWfzd2HdnqOYmQlUliKHbBED5kW_Vias,2895
|
|
350
350
|
alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
|
|
351
351
|
alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
|
|
352
|
-
alita_sdk-0.3.
|
|
353
|
-
alita_sdk-0.3.
|
|
354
|
-
alita_sdk-0.3.
|
|
355
|
-
alita_sdk-0.3.
|
|
356
|
-
alita_sdk-0.3.
|
|
352
|
+
alita_sdk-0.3.327.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
353
|
+
alita_sdk-0.3.327.dist-info/METADATA,sha256=vGd3pwE273hj9w8I4t8YqRph7n5oird_C76aRf_tjNY,18897
|
|
354
|
+
alita_sdk-0.3.327.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
355
|
+
alita_sdk-0.3.327.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
|
356
|
+
alita_sdk-0.3.327.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|