alita-sdk 0.3.409__py3-none-any.whl → 0.3.411__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 +5 -2
- alita_sdk/runtime/langchain/langraph_agent.py +4 -2
- alita_sdk/runtime/tools/llm.py +6 -6
- alita_sdk/tools/jira/api_wrapper.py +1 -1
- {alita_sdk-0.3.409.dist-info → alita_sdk-0.3.411.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.409.dist-info → alita_sdk-0.3.411.dist-info}/RECORD +9 -9
- {alita_sdk-0.3.409.dist-info → alita_sdk-0.3.411.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.409.dist-info → alita_sdk-0.3.411.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.409.dist-info → alita_sdk-0.3.411.dist-info}/top_level.txt +0 -0
|
@@ -290,6 +290,7 @@ class Assistant:
|
|
|
290
290
|
'value': 'messages'
|
|
291
291
|
}
|
|
292
292
|
},
|
|
293
|
+
'step_limit': self.max_iterations,
|
|
293
294
|
'input': ['messages'],
|
|
294
295
|
'output': ['messages'],
|
|
295
296
|
'transition': 'END'
|
|
@@ -315,7 +316,8 @@ class Assistant:
|
|
|
315
316
|
store=self.store,
|
|
316
317
|
debug=False,
|
|
317
318
|
for_subgraph=False,
|
|
318
|
-
alita_client=self.alita_client
|
|
319
|
+
alita_client=self.alita_client,
|
|
320
|
+
steps_limit=self.max_iterations
|
|
319
321
|
)
|
|
320
322
|
|
|
321
323
|
return agent
|
|
@@ -330,7 +332,8 @@ class Assistant:
|
|
|
330
332
|
agent = create_graph(
|
|
331
333
|
client=self.client, tools=self.tools,
|
|
332
334
|
yaml_schema=self.prompt, memory=memory,
|
|
333
|
-
alita_client=self.alita_client
|
|
335
|
+
alita_client=self.alita_client,
|
|
336
|
+
steps_limit=self.max_iterations
|
|
334
337
|
)
|
|
335
338
|
#
|
|
336
339
|
return agent
|
|
@@ -596,7 +596,7 @@ def create_graph(
|
|
|
596
596
|
else:
|
|
597
597
|
# Use all available tools
|
|
598
598
|
available_tools = [tool for tool in tools if isinstance(tool, BaseTool)]
|
|
599
|
-
|
|
599
|
+
|
|
600
600
|
lg_builder.add_node(node_id, LLMNode(
|
|
601
601
|
client=client,
|
|
602
602
|
input_mapping=node.get('input_mapping', {'messages': {'type': 'variable', 'value': 'messages'}}),
|
|
@@ -607,7 +607,9 @@ def create_graph(
|
|
|
607
607
|
input_variables=node.get('input', ['messages']),
|
|
608
608
|
structured_output=node.get('structured_output', False),
|
|
609
609
|
available_tools=available_tools,
|
|
610
|
-
tool_names=tool_names
|
|
610
|
+
tool_names=tool_names,
|
|
611
|
+
steps_limit=kwargs.get('steps_limit', 25)
|
|
612
|
+
))
|
|
611
613
|
elif node_type == 'router':
|
|
612
614
|
# Add a RouterNode as an independent node
|
|
613
615
|
lg_builder.add_node(node_id, RouterNode(
|
alita_sdk/runtime/tools/llm.py
CHANGED
|
@@ -30,6 +30,7 @@ class LLMNode(BaseTool):
|
|
|
30
30
|
structured_output: Optional[bool] = Field(default=False, description='Whether to use structured output')
|
|
31
31
|
available_tools: Optional[List[BaseTool]] = Field(default=None, description='Available tools for binding')
|
|
32
32
|
tool_names: Optional[List[str]] = Field(default=None, description='Specific tool names to filter')
|
|
33
|
+
steps_limit: Optional[int] = Field(default=25, description='Maximum steps for tool execution')
|
|
33
34
|
|
|
34
35
|
def get_filtered_tools(self) -> List[BaseTool]:
|
|
35
36
|
"""
|
|
@@ -184,17 +185,16 @@ class LLMNode(BaseTool):
|
|
|
184
185
|
def __perform_tool_calling(self, completion, messages, llm_client, config):
|
|
185
186
|
# Handle iterative tool-calling and execution
|
|
186
187
|
new_messages = messages + [completion]
|
|
187
|
-
max_iterations = 15
|
|
188
188
|
iteration = 0
|
|
189
189
|
|
|
190
190
|
# Continue executing tools until no more tool calls or max iterations reached
|
|
191
191
|
current_completion = completion
|
|
192
192
|
while (hasattr(current_completion, 'tool_calls') and
|
|
193
193
|
current_completion.tool_calls and
|
|
194
|
-
iteration <
|
|
194
|
+
iteration < self.steps_limit):
|
|
195
195
|
|
|
196
196
|
iteration += 1
|
|
197
|
-
logger.info(f"Tool execution iteration {iteration}/{
|
|
197
|
+
logger.info(f"Tool execution iteration {iteration}/{self.steps_limit}")
|
|
198
198
|
|
|
199
199
|
# Execute each tool call in the current completion
|
|
200
200
|
tool_calls = current_completion.tool_calls if hasattr(current_completion.tool_calls,
|
|
@@ -285,10 +285,10 @@ class LLMNode(BaseTool):
|
|
|
285
285
|
break
|
|
286
286
|
|
|
287
287
|
# Log completion status
|
|
288
|
-
if iteration >=
|
|
289
|
-
logger.warning(f"Reached maximum iterations ({
|
|
288
|
+
if iteration >= self.steps_limit:
|
|
289
|
+
logger.warning(f"Reached maximum iterations ({self.steps_limit}) for tool execution")
|
|
290
290
|
# Add a warning message to the chat
|
|
291
|
-
warning_msg = f"Maximum tool execution iterations ({
|
|
291
|
+
warning_msg = f"Maximum tool execution iterations ({self.steps_limit}) reached. Stopping tool execution."
|
|
292
292
|
new_messages.append(AIMessage(content=warning_msg))
|
|
293
293
|
else:
|
|
294
294
|
logger.info(f"Tool execution completed after {iteration} iterations")
|
|
@@ -563,7 +563,7 @@ class JiraApiWrapper(NonCodeIndexerToolkit):
|
|
|
563
563
|
Use the appropriate issue link type (e.g., "Test", "Relates", "Blocks").
|
|
564
564
|
If we use "Test" linktype, the test is inward issue, the story/other issue is outward issue.."""
|
|
565
565
|
|
|
566
|
-
comment = "
|
|
566
|
+
comment = f"Issue {inward_issue_key} was linked to {outward_issue_key}."
|
|
567
567
|
comment_body = {"content": [{"content": [{"text": comment,"type": "text"}],"type": "paragraph"}],"type": "doc","version": 1} if self.api_version == "3" else comment
|
|
568
568
|
link_data = {
|
|
569
569
|
"type": {"name": f"{linktype}"},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alita_sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.411
|
|
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
|
|
@@ -41,11 +41,11 @@ alita_sdk/runtime/clients/datasource.py,sha256=HAZovoQN9jBg0_-lIlGBQzb4FJdczPhkH
|
|
|
41
41
|
alita_sdk/runtime/clients/prompt.py,sha256=li1RG9eBwgNK_Qf0qUaZ8QNTmsncFrAL2pv3kbxZRZg,1447
|
|
42
42
|
alita_sdk/runtime/clients/sandbox_client.py,sha256=OhEasE0MxBBDw4o76xkxVCpNpr3xJ8spQsrsVxMrjUA,16192
|
|
43
43
|
alita_sdk/runtime/langchain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
|
-
alita_sdk/runtime/langchain/assistant.py,sha256=
|
|
44
|
+
alita_sdk/runtime/langchain/assistant.py,sha256=qKoEjbGuUnX-OZDHmSaK3plb1jON9unzEwAjxBT9DY8,16044
|
|
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=SoA7il7_Q9OyJbCDVubVMVNkL1NI0OzIU7FR33R7onI,50185
|
|
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
|
|
@@ -114,7 +114,7 @@ alita_sdk/runtime/tools/function.py,sha256=jk_JrtuYByR9Df5EFOGFheB9HktNPJcOwf4js
|
|
|
114
114
|
alita_sdk/runtime/tools/graph.py,sha256=7jImBBSEdP5Mjnn2keOiyUwdGDFhEXLUrgUiugO3mgA,3503
|
|
115
115
|
alita_sdk/runtime/tools/image_generation.py,sha256=Kls9D_ke_SK7xmVr7I9SlQcAEBJc86gf66haN0qIj9k,7469
|
|
116
116
|
alita_sdk/runtime/tools/indexer_tool.py,sha256=whSLPevB4WD6dhh2JDXEivDmTvbjiMV1MrPl9cz5eLA,4375
|
|
117
|
-
alita_sdk/runtime/tools/llm.py,sha256=
|
|
117
|
+
alita_sdk/runtime/tools/llm.py,sha256=OEhf4_YlZIihIpkuRKbbWJ_Lfk-V_rJHpy2NRm5xuCg,15533
|
|
118
118
|
alita_sdk/runtime/tools/loop.py,sha256=uds0WhZvwMxDVFI6MZHrcmMle637cQfBNg682iLxoJA,8335
|
|
119
119
|
alita_sdk/runtime/tools/loop_output.py,sha256=U4hO9PCQgWlXwOq6jdmCGbegtAxGAPXObSxZQ3z38uk,8069
|
|
120
120
|
alita_sdk/runtime/tools/mcp_server_tool.py,sha256=MhLxZJ44LYrB_0GrojmkyqKoDRaqIHkEQAsg718ipog,4277
|
|
@@ -264,7 +264,7 @@ alita_sdk/tools/google/bigquery/tool.py,sha256=Esf9Hsp8I0e7-5EdkFqQ-bid0cfrg-bfS
|
|
|
264
264
|
alita_sdk/tools/google_places/__init__.py,sha256=QtmBCI0bHDK79u4hsCSWFcUihu-h4EmPSh9Yll7zz3w,3590
|
|
265
265
|
alita_sdk/tools/google_places/api_wrapper.py,sha256=7nZly6nk4f4Tm7s2MVdnnwlb-1_WHRrDhyjDiqoyPjA,4674
|
|
266
266
|
alita_sdk/tools/jira/__init__.py,sha256=G-9qnOYKFWM_adG0QFexh5-2pj_WaxIxxZanB3ARFqI,6339
|
|
267
|
-
alita_sdk/tools/jira/api_wrapper.py,sha256=
|
|
267
|
+
alita_sdk/tools/jira/api_wrapper.py,sha256=xmbZNYL1YkSsVXKuKEVQs1j0Fh7weGj4MdW5CnkXK-o,82611
|
|
268
268
|
alita_sdk/tools/keycloak/__init__.py,sha256=0WB9yXMUUAHQRni1ghDEmd7GYa7aJPsTVlZgMCM9cQ0,3050
|
|
269
269
|
alita_sdk/tools/keycloak/api_wrapper.py,sha256=cOGr0f3S3-c6tRDBWI8wMnetjoNSxiV5rvC_0VHb8uw,3100
|
|
270
270
|
alita_sdk/tools/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -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.411.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
357
|
+
alita_sdk-0.3.411.dist-info/METADATA,sha256=OAQs8F9qR3gpOkt1_JRbaA2m-pOt-JX4v-mOPfxATeE,19071
|
|
358
|
+
alita_sdk-0.3.411.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
359
|
+
alita_sdk-0.3.411.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
|
360
|
+
alita_sdk-0.3.411.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|