alita-sdk 0.3.131__py3-none-any.whl → 0.3.133__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.
@@ -8,6 +8,7 @@ from langchain_core.messages import (
8
8
  AIMessage, HumanMessage,
9
9
  SystemMessage, BaseMessage,
10
10
  )
11
+ from langchain_core.tools import ToolException
11
12
 
12
13
  from ..langchain.assistant import Assistant as LangChainAssistant
13
14
  # from ..llamaindex.assistant import Assistant as LLamaAssistant
@@ -174,7 +175,12 @@ class AlitaClient:
174
175
  tools = []
175
176
  if chat_history is None:
176
177
  chat_history = []
177
- data = self.get_app_version_details(application_id, application_version_id)
178
+ try:
179
+ data = self.get_app_version_details(application_id, application_version_id)
180
+ except ApiDetailsRequestError as e:
181
+ error_msg = f"Failed to fetch application version details for {application_id}/{application_version_id}\nDetails: {e}"
182
+ logger.error(error_msg)
183
+ raise ToolException(error_msg)
178
184
 
179
185
  if application_variables:
180
186
  for var in data.get('variables', {}):
@@ -17,7 +17,7 @@ from elitea_analyse.ado.main import (
17
17
 
18
18
  from alita_tools.elitea_base import BaseToolApiWrapper
19
19
 
20
- from src.alita_sdk.utils.save_dataframe import save_dataframe_to_artifact
20
+ from ....utils.save_dataframe import save_dataframe_to_artifact
21
21
  from ....tools.artifact import ArtifactWrapper
22
22
  from ....utils.logging import with_streamlit_logs
23
23
 
@@ -12,7 +12,7 @@ from elitea_analyse.github.main_github import (
12
12
  )
13
13
 
14
14
  from alita_tools.elitea_base import BaseToolApiWrapper
15
- from src.alita_sdk.utils.save_dataframe import save_dataframe_to_artifact
15
+ from ....utils.save_dataframe import save_dataframe_to_artifact
16
16
  from ....tools.artifact import ArtifactWrapper
17
17
  from ....utils.logging import with_streamlit_logs
18
18
 
@@ -13,7 +13,7 @@ from elitea_analyse.git.git_search import GitLabV4Search
13
13
 
14
14
 
15
15
  from alita_tools.elitea_base import BaseToolApiWrapper
16
- from src.alita_sdk.utils.save_dataframe import save_dataframe_to_artifact
16
+ from ....utils.save_dataframe import save_dataframe_to_artifact
17
17
  from ....tools.artifact import ArtifactWrapper
18
18
 
19
19
 
@@ -16,7 +16,7 @@ from .constants import REACT_ADDON, REACT_VARS, XML_ADDON
16
16
  from .chat_message_template import Jinja2TemplatedChatMessagesTemplate
17
17
  from ..tools.echo import EchoTool
18
18
  from ..toolkits.tools import get_tools
19
- from langchain_core.tools import BaseTool
19
+ from langchain_core.tools import BaseTool, ToolException
20
20
 
21
21
  logger = logging.getLogger(__name__)
22
22
 
@@ -53,6 +53,11 @@ class Assistant:
53
53
  target_name
54
54
  )
55
55
  self.client = target_cls(**model_params)
56
+ # validate agents compatibility: non-pipeline agents cannot have pipelines as toolkits
57
+ if app_type != "pipeline" and any(tool['agent_type'] == 'pipeline' for tool in data['tools']):
58
+ raise ToolException("Non-pipeline agents cannot have pipelines as a toolkits. "
59
+ "Review toolkits configuration or use pipeline as master agent.")
60
+
56
61
  self.tools = get_tools(data['tools'], alita_client=alita, llm=self.client)
57
62
  if app_type == "pipeline":
58
63
  self.prompt = data['instructions']
alita_sdk/tools/llm.py CHANGED
@@ -3,7 +3,7 @@ from traceback import format_exc
3
3
  from typing import Any, Optional, Dict, List
4
4
 
5
5
  from langchain_core.messages import HumanMessage, BaseMessage
6
- from langchain_core.tools import BaseTool
6
+ from langchain_core.tools import BaseTool, ToolException
7
7
 
8
8
  from ..langchain.utils import _extract_json, create_pydantic_model, create_params
9
9
 
@@ -13,7 +13,12 @@ logger = logging.getLogger(__name__)
13
13
  def create_llm_input(prompt: Dict[str, str], params: Dict[str, Any], kwargs: Dict[str, Any]) -> list[BaseMessage]:
14
14
  logger.info(f"Creating LLM input with prompt: {prompt}, params: {params}, kwargs: {kwargs}")
15
15
  if prompt.get('type') == 'fstring' and params:
16
- return [HumanMessage(content=prompt['value'].format(**params))]
16
+ try:
17
+ return [HumanMessage(content=prompt['value'].format(**params))]
18
+ except KeyError as e:
19
+ error_msg = f"KeyError in input formatting - make sure you have added all required state variables as input to the node: {e}"
20
+ logger.error(error_msg)
21
+ raise ToolException(error_msg)
17
22
  else:
18
23
  return kwargs.get("messages") + [HumanMessage(prompt['value'])]
19
24
 
@@ -6,7 +6,7 @@ from typing import Any, Dict, Optional
6
6
  from langchain_core.tools import ToolException
7
7
  import pandas as pd
8
8
 
9
- from src.alita_sdk.tools.artifact import ArtifactWrapper
9
+ from ..tools.artifact import ArtifactWrapper
10
10
 
11
11
  logger = logging.getLogger(__name__)
12
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.131
3
+ Version: 0.3.133
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 <lifedjik@gmail.com>
6
6
  Project-URL: Homepage, https://projectalita.ai
@@ -70,7 +70,7 @@ Requires-Dist: rlpycairo==0.3.0
70
70
  Requires-Dist: cairocffi==1.7.1
71
71
  Requires-Dist: docx2txt==0.8
72
72
  Requires-Dist: mammoth==1.9.0
73
- Requires-Dist: elitea-analyse==0.1.1
73
+ Requires-Dist: elitea-analyse==0.1.2
74
74
  Requires-Dist: opentelemetry-exporter-otlp-proto-grpc==1.25.0
75
75
  Dynamic: license-file
76
76
 
@@ -4,24 +4,24 @@ alita_sdk/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
4
4
  alita_sdk/agents/llamaAgentParser.py,sha256=N_Nw6WJ8xrNX3fr_JFwjUIg_Urai9lLU3poMgZz0Cyk,1701
5
5
  alita_sdk/clients/__init__.py,sha256=5O_7WsZmvg5z5uZf_Jkx-f8j5C6yKIuSwQR6AQ-TM84,31
6
6
  alita_sdk/clients/artifact.py,sha256=W6oLlthtsUHfUWjhihaDdhLZdRVqj1D2j7oHHELxJfs,2639
7
- alita_sdk/clients/client.py,sha256=egrBkmuNh79WTaCLO2sBiTHA1YBT6R4pif-nWZbnSNw,18475
7
+ alita_sdk/clients/client.py,sha256=_-2S7wNZYkr6JgOtJJkUQbFWT_XFYdOt1iAi9BivNEE,18793
8
8
  alita_sdk/clients/datasource.py,sha256=HAZovoQN9jBg0_-lIlGBQzb4FJdczPhkHehAiVG3Wx0,1020
9
9
  alita_sdk/clients/prompt.py,sha256=li1RG9eBwgNK_Qf0qUaZ8QNTmsncFrAL2pv3kbxZRZg,1447
10
10
  alita_sdk/community/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  alita_sdk/community/utils.py,sha256=lvuCJaNqVPHOORJV6kIPcXJcdprVW_TJvERtYAEgpjM,249
12
12
  alita_sdk/community/analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  alita_sdk/community/analysis/ado_analyse/__init__.py,sha256=JU-WsNdLp6GyhgftwW0COE37bAH3mciOFYYw58FawwQ,4056
14
- alita_sdk/community/analysis/ado_analyse/api_wrapper.py,sha256=qLkpm4XPmhuDC0nJwXAaDOcuI3XURVjYLufpKZ9NJnY,8649
14
+ alita_sdk/community/analysis/ado_analyse/api_wrapper.py,sha256=efuFvIVlB2sLaViBW0mqCXFozeYPM4jlC6l7-FaR91A,8639
15
15
  alita_sdk/community/analysis/github_analyse/__init__.py,sha256=QHVuYoTw6r89smShN3Iurhz_XLicPk1G8s2HeOMEk1s,3550
16
- alita_sdk/community/analysis/github_analyse/api_wrapper.py,sha256=pDZlpufTWSCtD0m-TI9aIgctFe62uJ7diX3LTsPdWjY,6836
16
+ alita_sdk/community/analysis/github_analyse/api_wrapper.py,sha256=Otx1kbDqn0O1phz3qNJ5-0soO9_uU4zZ_YnB0tN6l9w,6826
17
17
  alita_sdk/community/analysis/gitlab_analyse/__init__.py,sha256=J_HwgZGfiQPxEqFD0IOulgettTI_fvpuqYdR_ciKRFw,4131
18
- alita_sdk/community/analysis/gitlab_analyse/api_wrapper.py,sha256=GDP_cW8Faa695357M9YXPsQ12WBP33JZQy5CGcCAS1A,6343
18
+ alita_sdk/community/analysis/gitlab_analyse/api_wrapper.py,sha256=FZ2StzLH0MtO26guL51wV-ar457ygJtuPEvhqg-IXGM,6333
19
19
  alita_sdk/community/analysis/jira_analyse/__init__.py,sha256=Rm-HKEi_HIxrgHdq9mZ-XzxMKLXm8-81eJwJT2lar-c,5945
20
20
  alita_sdk/community/analysis/jira_analyse/api_wrapper.py,sha256=naEgBSdwNonNleUtHCb1UOkWiYdM64ZJ9dfsyszmeX8,9668
21
21
  alita_sdk/community/browseruse/__init__.py,sha256=uAxPZEX7ihpt8HtcGDFrzTNv9WcklT1wG1ItTwUO8y4,3601
22
22
  alita_sdk/community/browseruse/api_wrapper.py,sha256=Y05NKWfTROPmBxe8ZFIELSGBX5v3RTNP30OTO2Tj8uI,10838
23
23
  alita_sdk/langchain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- alita_sdk/langchain/assistant.py,sha256=J_xhwbNl934BgDKSpAMC9a1u6v03DZQcTYaamCztEPk,6272
24
+ alita_sdk/langchain/assistant.py,sha256=Wq4_XtlFKKkrkelvTa4qzkI3BBTHy5zwRmk3v1i22lQ,6676
25
25
  alita_sdk/langchain/chat_message_template.py,sha256=kPz8W2BG6IMyITFDA5oeb5BxVRkHEVZhuiGl4MBZKdc,2176
26
26
  alita_sdk/langchain/constants.py,sha256=eHVJ_beJNTf1WJo4yq7KMK64fxsRvs3lKc34QCXSbpk,3319
27
27
  alita_sdk/langchain/indexer.py,sha256=0ENHy5EOhThnAiYFc7QAsaTNp9rr8hDV_hTK8ahbatk,37592
@@ -85,7 +85,7 @@ alita_sdk/tools/datasource.py,sha256=pvbaSfI-ThQQnjHG-QhYNSTYRnZB0rYtZFpjCfpzxYI
85
85
  alita_sdk/tools/echo.py,sha256=spw9eCweXzixJqHnZofHE1yWiSUa04L4VKycf3KCEaM,486
86
86
  alita_sdk/tools/function.py,sha256=wzPS5Y8ScmsXspmn73MQnkCcAghsllAg7BLh61ZNuVw,2543
87
87
  alita_sdk/tools/indexer_tool.py,sha256=P9S_omk5TZkizb6UXyxMO87Pzj4UCaye0CuXBgCnhTU,4258
88
- alita_sdk/tools/llm.py,sha256=JA0OnSU13CLdkS5NFv6iRk8P7k-B47L-oPjk8xrzk48,3223
88
+ alita_sdk/tools/llm.py,sha256=UUd4U4CuCNImHxVJAF5daYbew-7X9H8k21bUWy2PDvg,3502
89
89
  alita_sdk/tools/loop.py,sha256=uds0WhZvwMxDVFI6MZHrcmMle637cQfBNg682iLxoJA,8335
90
90
  alita_sdk/tools/loop_output.py,sha256=U4hO9PCQgWlXwOq6jdmCGbegtAxGAPXObSxZQ3z38uk,8069
91
91
  alita_sdk/tools/mcp_server_tool.py,sha256=xcH9AiqfR2TYrwJ3Ixw-_A7XDodtJCnwmq1SsikXpYk,1930
@@ -98,16 +98,16 @@ alita_sdk/utils/AlitaCallback.py,sha256=cvpDhR4QLVCNQci6CO6TEUrUVDZU9_CRSwzcHGm3
98
98
  alita_sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
99
  alita_sdk/utils/evaluate.py,sha256=iM1P8gzBLHTuSCe85_Ng_h30m52hFuGuhNXJ7kB1tgI,1872
100
100
  alita_sdk/utils/logging.py,sha256=hBE3qAzmcLMdamMp2YRXwOOK9P4lmNaNhM76kntVljs,3124
101
- alita_sdk/utils/save_dataframe.py,sha256=6aHFr28Ssw2jmsnrCTVfZIE2MCpVkG6GV58gzMN-Eao,1477
101
+ alita_sdk/utils/save_dataframe.py,sha256=tNwnaVCvN4_B0oi3F4Y3Z13elbIRtwKmdKHsMcj658g,1465
102
102
  alita_sdk/utils/streamlit.py,sha256=zp8owZwHI3HZplhcExJf6R3-APtWx-z6s5jznT2hY_k,29124
103
103
  alita_sdk/utils/utils.py,sha256=dM8whOJAuFJFe19qJ69-FLzrUp6d2G-G6L7d4ss2XqM,346
104
- alita_sdk-0.3.131.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
104
+ alita_sdk-0.3.133.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
105
105
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
106
106
  tests/test_ado_analysis.py,sha256=wsxB4B2Ycxoiykthh6YbPQ9hqsDbPFie8D9ZK1i_6kg,3311
107
107
  tests/test_github_analysis.py,sha256=ulR4CEGmiMRPydJuX7aQcglzvhC7kFOAtZRLLBB9F_M,3148
108
108
  tests/test_gitlab_analysis.py,sha256=J7Y2mNi5Sj8-rH2PMRmVbT3uwZ17YeR9pcs0MDIyNW4,3352
109
109
  tests/test_jira_analysis.py,sha256=6F3Elikt02L28N6sS_AKDy9lgqgD81_hr979NcdZeg4,3359
110
- alita_sdk-0.3.131.dist-info/METADATA,sha256=u6rbcQEd9_oXtzErr6KKmk6ZUxEq9XoUmH6Y5Utfjzk,7076
111
- alita_sdk-0.3.131.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
- alita_sdk-0.3.131.dist-info/top_level.txt,sha256=SWRhxB7Et3cOy3RkE5hR7OIRnHoo3K8EXzoiNlkfOmc,25
113
- alita_sdk-0.3.131.dist-info/RECORD,,
110
+ alita_sdk-0.3.133.dist-info/METADATA,sha256=DSI3loS__2aAfwa-Mdbvo5hYY42e3WY0WFxHmQ3FvJ8,7076
111
+ alita_sdk-0.3.133.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
+ alita_sdk-0.3.133.dist-info/top_level.txt,sha256=SWRhxB7Et3cOy3RkE5hR7OIRnHoo3K8EXzoiNlkfOmc,25
113
+ alita_sdk-0.3.133.dist-info/RECORD,,