alita-sdk 0.3.320__py3-none-any.whl → 0.3.321__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/langchain/langraph_agent.py +23 -8
- {alita_sdk-0.3.320.dist-info → alita_sdk-0.3.321.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.320.dist-info → alita_sdk-0.3.321.dist-info}/RECORD +6 -6
- {alita_sdk-0.3.320.dist-info → alita_sdk-0.3.321.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.320.dist-info → alita_sdk-0.3.321.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.320.dist-info → alita_sdk-0.3.321.dist-info}/top_level.txt +0 -0
@@ -584,14 +584,11 @@ def create_graph(
|
|
584
584
|
entry_point = clean_string(schema['entry_point'])
|
585
585
|
except KeyError:
|
586
586
|
raise ToolException("Entry point is not defined in the schema. Please define 'entry_point' in the schema.")
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
lg_builder.set_entry_point(state_default_node.name)
|
593
|
-
lg_builder.add_conditional_edges(state_default_node.name, TransitionalEdge(entry_point))
|
594
|
-
break
|
587
|
+
if state.items():
|
588
|
+
state_default_node = StateDefaultNode(default_vars=set_defaults(state))
|
589
|
+
lg_builder.add_node(state_default_node.name, state_default_node)
|
590
|
+
lg_builder.set_entry_point(state_default_node.name)
|
591
|
+
lg_builder.add_conditional_edges(state_default_node.name, TransitionalEdge(entry_point))
|
595
592
|
else:
|
596
593
|
# if no state variables are defined, set the entry point directly
|
597
594
|
lg_builder.set_entry_point(entry_point)
|
@@ -633,6 +630,24 @@ def create_graph(
|
|
633
630
|
)
|
634
631
|
return compiled.validate()
|
635
632
|
|
633
|
+
def set_defaults(d):
|
634
|
+
"""Set default values for dictionary entries based on their type."""
|
635
|
+
type_defaults = {
|
636
|
+
'str': '',
|
637
|
+
'list': [],
|
638
|
+
'int': 0,
|
639
|
+
'float': 0.0,
|
640
|
+
'bool': False,
|
641
|
+
# add more types as needed
|
642
|
+
}
|
643
|
+
for k, v in d.items():
|
644
|
+
# Skip 'input' key as it is not a state initial variable
|
645
|
+
if k == 'input':
|
646
|
+
continue
|
647
|
+
# set value or default if type is defined
|
648
|
+
if 'value' not in v:
|
649
|
+
v['value'] = type_defaults.get(v['type'], None)
|
650
|
+
return d
|
636
651
|
|
637
652
|
def convert_dict_to_message(msg_dict):
|
638
653
|
"""Convert a dictionary message to a LangChain message object."""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: alita_sdk
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.321
|
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=0Cv30SJULxlrvD3hzWmTnxZyzqPEaSgp
|
|
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=5fTT2FyRFSLIbQxm8KkxT_-bkoABmZzZA_V3-9nPse0,44296
|
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
|
@@ -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.321.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
353
|
+
alita_sdk-0.3.321.dist-info/METADATA,sha256=NYftgHbUR29AEwXHSYD4vDsVk94-TYbo4ijPAl7FeJQ,18897
|
354
|
+
alita_sdk-0.3.321.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
355
|
+
alita_sdk-0.3.321.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
356
|
+
alita_sdk-0.3.321.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|