alita-sdk 0.3.399__py3-none-any.whl → 0.3.401__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 +7 -1
- alita_sdk/tools/__init__.py +41 -35
- alita_sdk/tools/code_indexer_toolkit.py +3 -3
- {alita_sdk-0.3.399.dist-info → alita_sdk-0.3.401.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.399.dist-info → alita_sdk-0.3.401.dist-info}/RECORD +8 -8
- {alita_sdk-0.3.399.dist-info → alita_sdk-0.3.401.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.399.dist-info → alita_sdk-0.3.401.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.399.dist-info → alita_sdk-0.3.401.dist-info}/top_level.txt +0 -0
|
@@ -794,7 +794,13 @@ class LangGraphAgentRunnable(CompiledStateGraph):
|
|
|
794
794
|
else:
|
|
795
795
|
current_message = input.get('input')[-1]
|
|
796
796
|
# TODO: add handler after we add 2+ inputs (filterByType, etc.)
|
|
797
|
-
|
|
797
|
+
if isinstance(current_message, HumanMessage):
|
|
798
|
+
text_contents = [item['text'] for item in current_message.content if item.get('type') == 'text']
|
|
799
|
+
input['input'] = ". ".join(text_contents)
|
|
800
|
+
elif isinstance(current_message, str):
|
|
801
|
+
input['input'] = current_message
|
|
802
|
+
else:
|
|
803
|
+
input['input'] = str(current_message)
|
|
798
804
|
if input.get('messages'):
|
|
799
805
|
# Ensure existing messages are LangChain objects
|
|
800
806
|
input['messages'] = [convert_dict_to_message(msg) for msg in input['messages']]
|
alita_sdk/tools/__init__.py
CHANGED
|
@@ -90,68 +90,74 @@ available_count = len(AVAILABLE_TOOLS)
|
|
|
90
90
|
total_attempted = len(AVAILABLE_TOOLS) + len(FAILED_IMPORTS)
|
|
91
91
|
logger.info(f"Tool imports completed: {available_count}/{total_attempted} successful")
|
|
92
92
|
|
|
93
|
+
|
|
93
94
|
def get_tools(tools_list, alita, llm, store: Optional[BaseStore] = None, *args, **kwargs):
|
|
94
95
|
tools = []
|
|
96
|
+
|
|
95
97
|
for tool in tools_list:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if not tool.get('settings'):
|
|
98
|
+
settings = tool.get('settings')
|
|
99
|
+
|
|
100
|
+
# Skip tools without settings early
|
|
101
|
+
if not settings:
|
|
101
102
|
logger.warning(f"Tool '{tool.get('type', '')}' has no settings, skipping...")
|
|
102
103
|
continue
|
|
103
|
-
|
|
104
|
-
tool
|
|
105
|
-
|
|
104
|
+
|
|
105
|
+
# Validate tool names once
|
|
106
|
+
selected_tools = settings.get('selected_tools', [])
|
|
107
|
+
invalid_tools = [name for name in selected_tools if isinstance(name, str) and name.startswith('_')]
|
|
108
|
+
if invalid_tools:
|
|
109
|
+
raise ValueError(f"Tool names {invalid_tools} from toolkit '{tool.get('type', '')}' cannot start with '_'")
|
|
110
|
+
|
|
111
|
+
# Cache tool type and add common settings
|
|
106
112
|
tool_type = tool['type']
|
|
113
|
+
settings['alita'] = alita
|
|
114
|
+
settings['llm'] = llm
|
|
115
|
+
settings['store'] = store
|
|
107
116
|
|
|
108
|
-
#
|
|
117
|
+
# Set pgvector collection schema if present
|
|
118
|
+
if settings.get('pgvector_configuration'):
|
|
119
|
+
settings['pgvector_configuration']['collection_schema'] = str(tool['id'])
|
|
120
|
+
|
|
121
|
+
# Handle ADO special cases
|
|
109
122
|
if tool_type in ['ado_boards', 'ado_wiki', 'ado_plans']:
|
|
110
123
|
tools.extend(AVAILABLE_TOOLS['ado']['get_tools'](tool_type, tool))
|
|
124
|
+
continue
|
|
111
125
|
|
|
112
|
-
#
|
|
113
|
-
|
|
126
|
+
# Handle ADO repos aliases
|
|
127
|
+
if tool_type in ['ado_repos', 'azure_devops_repos'] and 'ado_repos' in AVAILABLE_TOOLS:
|
|
114
128
|
try:
|
|
115
|
-
|
|
116
|
-
if tool['settings'].get('pgvector_configuration'):
|
|
117
|
-
# Set collection schema to toolkit_id and put it to pgvector configuration
|
|
118
|
-
# to propagate it to the all toolkits level from single place
|
|
119
|
-
tool['settings']['pgvector_configuration']['collection_schema'] = str(tool['id'])
|
|
120
|
-
tools.extend(get_tools_func(tool))
|
|
121
|
-
|
|
129
|
+
tools.extend(AVAILABLE_TOOLS['ado_repos']['get_tools'](tool))
|
|
122
130
|
except Exception as e:
|
|
123
|
-
logger.error(f"Error getting
|
|
124
|
-
|
|
131
|
+
logger.error(f"Error getting ADO repos tools: {e}")
|
|
132
|
+
continue
|
|
125
133
|
|
|
126
|
-
# Handle
|
|
127
|
-
|
|
134
|
+
# Handle standard tools
|
|
135
|
+
if tool_type in AVAILABLE_TOOLS and 'get_tools' in AVAILABLE_TOOLS[tool_type]:
|
|
128
136
|
try:
|
|
129
|
-
|
|
130
|
-
tools.extend(get_tools_func(tool))
|
|
137
|
+
tools.extend(AVAILABLE_TOOLS[tool_type]['get_tools'](tool))
|
|
131
138
|
except Exception as e:
|
|
132
|
-
logger.error(f"Error getting
|
|
139
|
+
logger.error(f"Error getting tools for {tool_type}: {e}")
|
|
140
|
+
raise ToolException(f"Error getting tools for {tool_type}: {e}")
|
|
141
|
+
continue
|
|
133
142
|
|
|
134
143
|
# Handle custom modules
|
|
135
|
-
|
|
144
|
+
if settings.get("module"):
|
|
136
145
|
try:
|
|
137
|
-
settings = tool.get("settings", {})
|
|
138
146
|
mod = import_module(settings.pop("module"))
|
|
139
147
|
tkitclass = getattr(mod, settings.pop("class"))
|
|
140
|
-
|
|
141
|
-
get_toolkit_params = tool["settings"].copy()
|
|
148
|
+
get_toolkit_params = settings.copy()
|
|
142
149
|
get_toolkit_params["name"] = tool.get("name")
|
|
143
|
-
#
|
|
144
150
|
toolkit = tkitclass.get_toolkit(**get_toolkit_params)
|
|
145
151
|
tools.extend(toolkit.get_tools())
|
|
146
152
|
except Exception as e:
|
|
147
153
|
logger.error(f"Error in getting custom toolkit: {e}")
|
|
154
|
+
continue
|
|
148
155
|
|
|
156
|
+
# Tool not available
|
|
157
|
+
if tool_type in FAILED_IMPORTS:
|
|
158
|
+
logger.warning(f"Tool '{tool_type}' is not available: {FAILED_IMPORTS[tool_type]}")
|
|
149
159
|
else:
|
|
150
|
-
|
|
151
|
-
if tool_type in FAILED_IMPORTS:
|
|
152
|
-
logger.warning(f"Tool '{tool_type}' is not available: {FAILED_IMPORTS[tool_type]}")
|
|
153
|
-
else:
|
|
154
|
-
logger.warning(f"Unknown tool type: {tool_type}")
|
|
160
|
+
logger.warning(f"Unknown tool type: {tool_type}")
|
|
155
161
|
|
|
156
162
|
return tools
|
|
157
163
|
|
|
@@ -21,7 +21,7 @@ class CodeIndexerToolkit(BaseIndexerToolkit):
|
|
|
21
21
|
return self.vector_adapter.get_code_indexed_data(self, index_name)
|
|
22
22
|
|
|
23
23
|
def key_fn(self, document: Document):
|
|
24
|
-
return document.metadata.get(
|
|
24
|
+
return document.metadata.get("filename")
|
|
25
25
|
|
|
26
26
|
def compare_fn(self, document: Document, idx_data):
|
|
27
27
|
return (document.metadata.get('commit_hash') and
|
|
@@ -46,7 +46,7 @@ class CodeIndexerToolkit(BaseIndexerToolkit):
|
|
|
46
46
|
)
|
|
47
47
|
|
|
48
48
|
def _extend_data(self, documents: Generator[Document, None, None]):
|
|
49
|
-
yield from
|
|
49
|
+
yield from documents
|
|
50
50
|
|
|
51
51
|
def _index_tool_params(self):
|
|
52
52
|
"""Return the parameters for indexing data."""
|
|
@@ -127,7 +127,7 @@ class CodeIndexerToolkit(BaseIndexerToolkit):
|
|
|
127
127
|
self._log_tool_event(message=f"{idx} out of {total_files} files have been read", tool_name="loader")
|
|
128
128
|
self._log_tool_event(message=f"{len(_files)} have been read", tool_name="loader")
|
|
129
129
|
|
|
130
|
-
return file_content_generator()
|
|
130
|
+
return parse_code_files_for_db(file_content_generator())
|
|
131
131
|
|
|
132
132
|
def __handle_get_files(self, path: str, branch: str):
|
|
133
133
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alita_sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.401
|
|
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
|
|
@@ -45,7 +45,7 @@ alita_sdk/runtime/langchain/assistant.py,sha256=gppvk4qvPcjgysLHifSm6akBErzgjCsw
|
|
|
45
45
|
alita_sdk/runtime/langchain/chat_message_template.py,sha256=kPz8W2BG6IMyITFDA5oeb5BxVRkHEVZhuiGl4MBZKdc,2176
|
|
46
46
|
alita_sdk/runtime/langchain/constants.py,sha256=eHVJ_beJNTf1WJo4yq7KMK64fxsRvs3lKc34QCXSbpk,3319
|
|
47
47
|
alita_sdk/runtime/langchain/indexer.py,sha256=0ENHy5EOhThnAiYFc7QAsaTNp9rr8hDV_hTK8ahbatk,37592
|
|
48
|
-
alita_sdk/runtime/langchain/langraph_agent.py,sha256=
|
|
48
|
+
alita_sdk/runtime/langchain/langraph_agent.py,sha256=W7PELzR6VyxsBemxxEYnIzLsjBfmQITsQwymoAe0LNQ,49500
|
|
49
49
|
alita_sdk/runtime/langchain/mixedAgentParser.py,sha256=M256lvtsL3YtYflBCEp-rWKrKtcY1dJIyRGVv7KW9ME,2611
|
|
50
50
|
alita_sdk/runtime/langchain/mixedAgentRenderes.py,sha256=asBtKqm88QhZRILditjYICwFVKF5KfO38hu2O-WrSWE,5964
|
|
51
51
|
alita_sdk/runtime/langchain/store_manager.py,sha256=i8Fl11IXJhrBXq1F1ukEVln57B1IBe-tqSUvfUmBV4A,2218
|
|
@@ -135,9 +135,9 @@ alita_sdk/runtime/utils/streamlit.py,sha256=GQ69CsjfRMcGXcCrslL0Uoj24Cl07Jeji0rZ
|
|
|
135
135
|
alita_sdk/runtime/utils/toolkit_runtime.py,sha256=MU63Fpxj0b5_r1IUUc0Q3-PN9VwL7rUxp2MRR4tmYR8,5136
|
|
136
136
|
alita_sdk/runtime/utils/toolkit_utils.py,sha256=I9QFqnaqfVgN26LUr6s3XlBlG6y0CoHURnCzG7XcwVs,5311
|
|
137
137
|
alita_sdk/runtime/utils/utils.py,sha256=PJK8A-JVIzY1IowOjGG8DIqsIiEFe65qDKvFcjJCKWA,1041
|
|
138
|
-
alita_sdk/tools/__init__.py,sha256=
|
|
138
|
+
alita_sdk/tools/__init__.py,sha256=wrcSP0AN6HukZHPXpObCKI58cY0lVpHyzbpq609CMhE,10726
|
|
139
139
|
alita_sdk/tools/base_indexer_toolkit.py,sha256=7UTcrmvGvmIBF3WGKrsEp7zJL-XB1JIgaRkbE1ZSS9A,26439
|
|
140
|
-
alita_sdk/tools/code_indexer_toolkit.py,sha256=
|
|
140
|
+
alita_sdk/tools/code_indexer_toolkit.py,sha256=0vFsNti6lLwXM1Tbv45eAFhv7DAvVFUjWEHFJjCdIrU,7298
|
|
141
141
|
alita_sdk/tools/elitea_base.py,sha256=34fmVdYgd2YXifU5LFNjMQysr4OOIZ6AOZjq4GxLgSw,34417
|
|
142
142
|
alita_sdk/tools/non_code_indexer_toolkit.py,sha256=6Lrqor1VeSLbPLDHAfg_7UAUqKFy1r_n6bdsc4-ak98,1315
|
|
143
143
|
alita_sdk/tools/ado/__init__.py,sha256=NnNYpNFW0_N_v1td_iekYOoQRRB7PIunbpT2f9ZFJM4,1201
|
|
@@ -353,8 +353,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
|
|
|
353
353
|
alita_sdk/tools/zephyr_squad/__init__.py,sha256=0ne8XLJEQSLOWfzd2HdnqOYmQlUliKHbBED5kW_Vias,2895
|
|
354
354
|
alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
|
|
355
355
|
alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
|
|
356
|
-
alita_sdk-0.3.
|
|
357
|
-
alita_sdk-0.3.
|
|
358
|
-
alita_sdk-0.3.
|
|
359
|
-
alita_sdk-0.3.
|
|
360
|
-
alita_sdk-0.3.
|
|
356
|
+
alita_sdk-0.3.401.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
357
|
+
alita_sdk-0.3.401.dist-info/METADATA,sha256=Vz9Al7a47rs_47M7tjtcs_-zNrJFpOj8COfosJKhtlo,19071
|
|
358
|
+
alita_sdk-0.3.401.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
359
|
+
alita_sdk-0.3.401.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
|
360
|
+
alita_sdk-0.3.401.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|