alita-sdk 0.3.320__py3-none-any.whl → 0.3.322__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/assistant.py +1 -1
- alita_sdk/runtime/langchain/langraph_agent.py +23 -8
- alita_sdk/tools/non_code_indexer_toolkit.py +4 -0
- {alita_sdk-0.3.320.dist-info → alita_sdk-0.3.322.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.320.dist-info → alita_sdk-0.3.322.dist-info}/RECORD +8 -8
- {alita_sdk-0.3.320.dist-info → alita_sdk-0.3.322.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.320.dist-info → alita_sdk-0.3.322.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.320.dist-info → alita_sdk-0.3.322.dist-info}/top_level.txt +0 -0
|
@@ -93,7 +93,7 @@ class Assistant:
|
|
|
93
93
|
elif app_type == "xml":
|
|
94
94
|
messages.append(HumanMessage(XML_ADDON))
|
|
95
95
|
elif app_type in ['openai', 'dial']:
|
|
96
|
-
messages.append(
|
|
96
|
+
messages.append(MessagesPlaceholder("input"))
|
|
97
97
|
messages.append(MessagesPlaceholder("agent_scratchpad"))
|
|
98
98
|
variables = {}
|
|
99
99
|
input_variables = []
|
|
@@ -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,4 +1,5 @@
|
|
|
1
1
|
from langchain_core.documents import Document
|
|
2
|
+
from langchain_core.tools import ToolException
|
|
2
3
|
|
|
3
4
|
from alita_sdk.runtime.utils.utils import IndexerKeywords
|
|
4
5
|
from alita_sdk.tools.base_indexer_toolkit import BaseIndexerToolkit
|
|
@@ -6,6 +7,9 @@ from alita_sdk.tools.base_indexer_toolkit import BaseIndexerToolkit
|
|
|
6
7
|
|
|
7
8
|
class NonCodeIndexerToolkit(BaseIndexerToolkit):
|
|
8
9
|
def _get_indexed_data(self, collection_suffix: str):
|
|
10
|
+
if not self.vector_adapter:
|
|
11
|
+
raise ToolException("Vector adapter is not initialized. "
|
|
12
|
+
"Check your configuration: embedding_model and vectorstore_type.")
|
|
9
13
|
return self.vector_adapter.get_indexed_data(self, collection_suffix)
|
|
10
14
|
|
|
11
15
|
def key_fn(self, document: Document):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alita_sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.322
|
|
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
|
|
@@ -40,11 +40,11 @@ alita_sdk/runtime/clients/client.py,sha256=q9dRNrwDQJmb3dlFa6iWp-rB-XsgNLJh7gtrF
|
|
|
40
40
|
alita_sdk/runtime/clients/datasource.py,sha256=HAZovoQN9jBg0_-lIlGBQzb4FJdczPhkHehAiVG3Wx0,1020
|
|
41
41
|
alita_sdk/runtime/clients/prompt.py,sha256=li1RG9eBwgNK_Qf0qUaZ8QNTmsncFrAL2pv3kbxZRZg,1447
|
|
42
42
|
alita_sdk/runtime/langchain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
|
-
alita_sdk/runtime/langchain/assistant.py,sha256=
|
|
43
|
+
alita_sdk/runtime/langchain/assistant.py,sha256=1Eq8BIefp8suhbC9CssoOXtC-plkemoU8WKhLfdMECE,13568
|
|
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
|
|
@@ -135,7 +135,7 @@ alita_sdk/runtime/utils/utils.py,sha256=VXNLsdeTmf6snn9EtUyobv4yL-xzLhUcH8P_ORMi
|
|
|
135
135
|
alita_sdk/tools/__init__.py,sha256=jUj1ztC2FbkIUB-YYmiqaz_rqW7Il5kWzDPn1mJmj5w,10545
|
|
136
136
|
alita_sdk/tools/base_indexer_toolkit.py,sha256=IKtnJVX27yPu8bBWgbl-5YfUQy4pJPnBoRBFLkqagoc,20228
|
|
137
137
|
alita_sdk/tools/elitea_base.py,sha256=up3HshASSDfjlHV_HPrs1aD4JIwwX0Ug26WGTzgIYvY,34724
|
|
138
|
-
alita_sdk/tools/non_code_indexer_toolkit.py,sha256=
|
|
138
|
+
alita_sdk/tools/non_code_indexer_toolkit.py,sha256=B3QvhpT1F9QidkCcsOi3J_QrTOaNlTxqWFwe90VivQQ,1329
|
|
139
139
|
alita_sdk/tools/ado/__init__.py,sha256=NnNYpNFW0_N_v1td_iekYOoQRRB7PIunbpT2f9ZFJM4,1201
|
|
140
140
|
alita_sdk/tools/ado/utils.py,sha256=PTCludvaQmPLakF2EbCGy66Mro4-rjDtavVP-xcB2Wc,1252
|
|
141
141
|
alita_sdk/tools/ado/repos/__init__.py,sha256=rR-c40Pw_WpQeOXtEuS-COvgRUs1_cTkcJfHlK09N88,5339
|
|
@@ -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.322.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
353
|
+
alita_sdk-0.3.322.dist-info/METADATA,sha256=B4mgVK36EvdhTCCHhCGVQEUVdxRdpRuAE_FLC9eXVFQ,18897
|
|
354
|
+
alita_sdk-0.3.322.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
355
|
+
alita_sdk-0.3.322.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
|
356
|
+
alita_sdk-0.3.322.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|