alita-sdk 0.3.191__py3-none-any.whl → 0.3.193__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.
@@ -85,7 +85,11 @@ class AzureDevOpsReposToolkit(BaseToolkit):
85
85
  },
86
86
  "categories": ["code repositories"],
87
87
  "extra_categories": ["code", "repository", "version control"],
88
- "configuration_group": "ado_repos",
88
+ "configuration_group": {
89
+ "name": "ado_repos",
90
+ "label": "Azure DevOps Repositories",
91
+ "icon_url": "ado-repos-icon.svg",
92
+ }
89
93
  }}}
90
94
  )
91
95
 
@@ -51,7 +51,13 @@ class AzureDevOpsPlansToolkit(BaseToolkit):
51
51
  ]
52
52
  }
53
53
  },
54
- "configuration_group": "ado",
54
+ # connect different toolkits under the same configuration group with the same name,
55
+ # label and icon
56
+ "configuration_group": {
57
+ "name": "ado",
58
+ "label": "Azure DevOps",
59
+ "icon_url": "azure-icon.svg",
60
+ }
55
61
  }
56
62
  }
57
63
  }
@@ -26,9 +26,17 @@ class AzureDevOpsWikiToolkit(BaseToolkit):
26
26
  'max_toolkit_length': AzureDevOpsWikiToolkit.toolkit_max_length})
27
27
  ),
28
28
  organization_url=(str, Field(title="Organization URL",
29
- description="ADO organization url")),
30
- project=(str, Field(description="ADO project")),
31
- token=(SecretStr, Field(description="ADO token", json_schema_extra={'secret': True})),
29
+ description="ADO organization url", json_schema_extra={
30
+ 'configuration': True,
31
+ })),
32
+ project=(str, Field(description="ADO project",
33
+ json_schema_extra={
34
+ 'configuration': True
35
+ })),
36
+ token=(SecretStr,
37
+ Field(description="ADO token",
38
+ json_schema_extra={'secret': True, 'configuration': True }
39
+ )),
32
40
  selected_tools=(List[Literal[tuple(selected_tools)]],
33
41
  Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
34
42
  __config__={
@@ -49,7 +57,9 @@ class AzureDevOpsWikiToolkit(BaseToolkit):
49
57
  ]
50
58
  }
51
59
  },
52
- "configuration_group": "ado",
60
+ "configuration_group": {
61
+ "name": "ado",
62
+ }
53
63
  }
54
64
  }
55
65
  }
@@ -25,9 +25,16 @@ class AzureDevOpsWorkItemsToolkit(BaseToolkit):
25
25
  'max_toolkit_length': AzureDevOpsWorkItemsToolkit.toolkit_max_length})
26
26
  ),
27
27
  organization_url=(str, Field(title="Organization URL",
28
- description="ADO organization url")),
29
- project=(str, Field(description="ADO project")),
30
- token=(SecretStr, Field(description="ADO token", json_schema_extra={'secret': True})),
28
+ description="ADO organization url",
29
+ json_schema_extra={
30
+ 'configuration': True
31
+ })),
32
+ project=(str, Field(description="ADO project",
33
+ json_schema_extra={
34
+ 'configuration': True
35
+ }
36
+ )),
37
+ token=(SecretStr, Field(description="ADO token", json_schema_extra={'secret': True, 'configuration': True})),
31
38
  limit=(Optional[int], Field(description="ADO plans limit used for limitation of the list with results", default=5)),
32
39
  selected_tools=(List[Literal[tuple(selected_tools)]], Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
33
40
  __config__={
@@ -48,7 +55,9 @@ class AzureDevOpsWorkItemsToolkit(BaseToolkit):
48
55
  ]
49
56
  }
50
57
  },
51
- "configuration_group": "ado",
58
+ "configuration_group": {
59
+ "name": "ado",
60
+ }
52
61
  }
53
62
  }
54
63
  }
@@ -40,6 +40,7 @@ class MemoryToolkit(BaseToolkit):
40
40
  'metadata': {
41
41
  "label": "Memory",
42
42
  "icon_url": "memory.svg",
43
+ "hidden": True,
43
44
  "categories": ["other"],
44
45
  "extra_categories": ["long-term memory", "langmem"],
45
46
  }
@@ -1,11 +1,17 @@
1
- from typing import List, Optional
1
+ from typing import List, Optional, Literal
2
+
3
+ import logging
4
+
5
+ logger = logging.getLogger(__name__)
2
6
 
3
7
  from langchain_core.tools import BaseToolkit, BaseTool
4
8
  from pydantic import create_model, BaseModel, Field, SecretStr
5
9
  from ..base.tool import BaseAction
6
10
 
7
11
  from .api_wrapper import SlackApiWrapper
8
- from ..utils import TOOLKIT_SPLITTER, clean_string, get_max_toolkit_length
12
+ from ..utils import TOOLKIT_SPLITTER, clean_string, get_max_toolkit_length, check_connection_response
13
+ from slack_sdk.errors import SlackApiError
14
+ from slack_sdk import WebClient
9
15
 
10
16
  name = "slack"
11
17
 
@@ -24,13 +30,30 @@ class SlackToolkit(BaseToolkit):
24
30
  def toolkit_config_schema() -> BaseModel:
25
31
  selected_tools = {x['name']: x['args_schema'].schema() for x in SlackApiWrapper.model_construct().get_available_tools()}
26
32
  SlackToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
27
- return create_model(
33
+
34
+ @check_connection_response
35
+ def check_connection(self):
36
+ """
37
+ Checks the connection to Slack using the provided token.
38
+ Returns the response from Slack's auth.test endpoint.
39
+ """
40
+ try:
41
+ response = WebClient(token=self.slack_token.get_secret_value()).auth_test()
42
+ logger.info("Slack connection successful: %s", response)
43
+ return {"success": True, "response": response}
44
+ except SlackApiError as e:
45
+ logger.error(f"Slack connection failed: {e.response['error']}")
46
+ return {"success": False, "error": e.response['error']}
47
+
48
+ model = create_model(
28
49
  name,
29
- slack_token=(SecretStr, Field( description="Slack Bot/User OAuth Token like XOXB-*****-*****-*****-*****")),
30
- channel_id=(str, Field(title="Channel ID", description="Channel ID, user ID, or conversation ID to send the message to. (like C12345678 for public channels, D12345678 for DMs)")),
31
- selected_tools=(list[str], Field(title="Selected Tools", description="List of tools to enable", default=[])),
32
- __config__={'json_schema_extra': {'metadata': {"label": "slack", "icon_url": None, "hidden": True}}}
50
+ slack_token=(SecretStr, Field(description="Slack Token like XOXB-*****-*****-*****-*****", json_schema_extra={'secret': True, 'configuration': True})),
51
+ channel_id=(str, Field( description="Channel ID", json_schema_extra={'configuration': True})),
52
+ selected_tools=(list[str], Field( description="List of tools to enable", default=[],json_schema_extra={'args_schemas': selected_tools})),
53
+ __config__={'json_schema_extra': {'metadata': {"label": "Slack", "icon_url": None}}}
33
54
  )
55
+ model.check_connection = check_connection
56
+ return model
34
57
 
35
58
  @classmethod
36
59
  def get_toolkit(cls, selected_tools: Optional[List[str]] = None, toolkit_name: Optional[str] = None, **kwargs):
@@ -48,7 +71,6 @@ class SlackToolkit(BaseToolkit):
48
71
  name=prefix + tool["name"],
49
72
  description=tool["description"],
50
73
  args_schema=tool["args_schema"],
51
- func=tool["ref"]
52
74
  ))
53
75
  return cls(tools=tools)
54
76
 
@@ -38,27 +38,19 @@ class SlackApiWrapper(BaseToolApiWrapper):
38
38
  slack_token: Optional[SecretStr] = Field(default=None,description="Slack Bot/User OAuth Token like XOXB-*****-*****-*****-*****")
39
39
  channel_id: Optional[str] = Field(default=None, description="Channel ID, user ID, or conversation ID to send the message to. (like C12345678 for public channels, D12345678 for DMs)")
40
40
 
41
- @model_validator(mode="after")
41
+ @model_validator(mode="before")
42
42
  @classmethod
43
43
  def validate_toolkit(cls, values):
44
- token = values.slack_token.get_secret_value() if values.slack_token else None
44
+ token = values.get("slack_token")
45
45
  if not token:
46
- logging.error("Slack token is required.")
47
- raise ValueError("Slack token is required.")
48
- try:
49
- cls._client = WebClient(token=token)
50
- logging.info("Authenticated with Slack token.")
51
- except Exception as e:
52
- logging.error(f"Failed to authenticate with Slack: {str(e)}")
53
- raise ValueError(f"Failed to authenticate with Slack: {str(e)}")
46
+ logger.error("Slack token is required for authentication.")
47
+ raise ValueError("Slack token is required for authentication.")
54
48
  return values
55
-
56
49
  def _get_client(self):
57
- if not self._client:
50
+ if not hasattr(self, "_client") or self._client is None:
58
51
  self._client = WebClient(token=self.slack_token.get_secret_value())
59
52
  return self._client
60
-
61
-
53
+
62
54
  def send_message(self, message: str):
63
55
  """
64
56
  Sends a message to a specified Slack channel, user, or conversation.
@@ -85,6 +77,7 @@ class SlackApiWrapper(BaseToolApiWrapper):
85
77
  try:
86
78
 
87
79
  client = self._get_client()
80
+ logger.info(f"auth test: {client.auth_test()}")
88
81
  # Fetch conversation history
89
82
  response = client.conversations_history(
90
83
  channel=self.channel_id,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.191
3
+ Version: 0.3.193
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>, Artem Dubrovskiy <ad13box@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -102,13 +102,13 @@ alita_sdk/tools/__init__.py,sha256=UztP-wrR-MuJI2V0gcJzNoMhsNJV6mre07TJNPChAtM,1
102
102
  alita_sdk/tools/elitea_base.py,sha256=p1xuAsCe3qUwsmmgp_rdi6QipGeOKXA8wdSwX4MRNk4,21292
103
103
  alita_sdk/tools/ado/__init__.py,sha256=mD6GHcYMTtffPJkJvFPe2rzvye_IRmXmWfI7xYuZhO4,912
104
104
  alita_sdk/tools/ado/utils.py,sha256=PTCludvaQmPLakF2EbCGy66Mro4-rjDtavVP-xcB2Wc,1252
105
- alita_sdk/tools/ado/repos/__init__.py,sha256=bzVSEAPwBoH4sY3cNj5_FNXIC3yY8lkofaonNKhwhRk,6286
105
+ alita_sdk/tools/ado/repos/__init__.py,sha256=saNovhnawWFY3xwKA6FssR7cakPQzTNp_UjkpgCnyF0,6462
106
106
  alita_sdk/tools/ado/repos/repos_wrapper.py,sha256=_OWKAls7VFfFtEPTwqj_DxE1MSvpC0ivxdTIULEz3Tk,48206
107
- alita_sdk/tools/ado/test_plan/__init__.py,sha256=K-jhCT7D7bxXbiat3GCP_qDVg_ipcBlnh9r3JhmAubM,4408
107
+ alita_sdk/tools/ado/test_plan/__init__.py,sha256=bVywTYTvdm1rUeP2krVVMRN-xDCY--ze7NFdTxJP9ow,4708
108
108
  alita_sdk/tools/ado/test_plan/test_plan_wrapper.py,sha256=p1Mptd_1J6bmkyrvf2M-FB79s8THzEesBlfgaOnRXb8,18152
109
- alita_sdk/tools/ado/wiki/__init__.py,sha256=yyqTlzc14TC9w9OapKAmTjrZSuwRpsIdMkV9HUZGRlI,4201
109
+ alita_sdk/tools/ado/wiki/__init__.py,sha256=WCIKOisU2h3E4SNDvGfWCMZ3nRMxfH_ZhIffmSHH3XI,4576
110
110
  alita_sdk/tools/ado/wiki/ado_wrapper.py,sha256=l4bc2QoKSUXg9UqNcx0ylv7YL9JPPQd35Ti5MXyEgC4,12690
111
- alita_sdk/tools/ado/work_item/__init__.py,sha256=0vaynh82-stscb-K9MJsPt1okOZ2h9O5pr7efJx3Kno,4299
111
+ alita_sdk/tools/ado/work_item/__init__.py,sha256=k6gZ6pEE7gvNWvCDoDV05jltzbqxC_NPm06CEr5Wwcs,4726
112
112
  alita_sdk/tools/ado/work_item/ado_wrapper.py,sha256=aLB-aSNQST0FCwP7I01OXanCpZHKVarZZB1u9j2H1LA,26253
113
113
  alita_sdk/tools/advanced_jira_mining/__init__.py,sha256=pUTzECqGvYaR5qWY3JPUhrImrZgc7pCXuqSe5eWIE80,4604
114
114
  alita_sdk/tools/advanced_jira_mining/data_mining_wrapper.py,sha256=nZPtuwVWp8VeHw1B8q9kdwf-6ZvHnlXTOGdcIMDkKpw,44211
@@ -223,7 +223,7 @@ alita_sdk/tools/llm/llm_utils.py,sha256=v3_lWP_Nk6tJLkj0BYohOun0OWNfvzqLjPdPAMl-
223
223
  alita_sdk/tools/localgit/__init__.py,sha256=NScO0Eu-wl-rc63jjD5Qv1RXXB1qukSIJXx-yS_JQLI,2529
224
224
  alita_sdk/tools/localgit/local_git.py,sha256=gsAftNcK7nMCd8VsIkwDLs2SoG0MgpYdkQG5tmoynkA,18074
225
225
  alita_sdk/tools/localgit/tool.py,sha256=It_B24rMvFPurB355Oy5IShg2BsZTASsEoSS8hu2SXw,998
226
- alita_sdk/tools/memory/__init__.py,sha256=kMa3sDe6CF_vq0xMWhadBClCfY_W8BIbIliatenHu7U,2323
226
+ alita_sdk/tools/memory/__init__.py,sha256=8Q02h-PUvIw3bNbWbfklSJZe3qj0zAjfahq9C5XjyzE,2359
227
227
  alita_sdk/tools/ocr/__init__.py,sha256=pvslKVXyJmK0q23FFDNieuc7RBIuzNXTjTNj-GqhGb0,3335
228
228
  alita_sdk/tools/ocr/api_wrapper.py,sha256=08UF8wj1sR8DcW0z16pw19bgLatLkBF8dySW-Ds8iRk,29649
229
229
  alita_sdk/tools/ocr/text_detection.py,sha256=1DBxt54r3_HdEi93QynSIVta3rH3UpIvy799TPtDTtk,23825
@@ -270,8 +270,8 @@ alita_sdk/tools/sharepoint/__init__.py,sha256=HqKQDFboab1AYh20uJvHxs9HFLJSqVfVTj
270
270
  alita_sdk/tools/sharepoint/api_wrapper.py,sha256=qCHCIH4FRDtgdpIK22ewFhZJeOaTv9hT9BVivslxxlE,7119
271
271
  alita_sdk/tools/sharepoint/authorization_helper.py,sha256=n-nL5dlBoLMK70nHu7P2RYCb8C6c9HMA_gEaw8LxuhE,2007
272
272
  alita_sdk/tools/sharepoint/utils.py,sha256=fZ1YzAu5CTjKSZeslowpOPH974902S8vCp1Wu7L44LM,446
273
- alita_sdk/tools/slack/__init__.py,sha256=_s4Ogro3O92AxHdUgWCp0SlrnBChRhCimZLbcDvNzeA,2550
274
- alita_sdk/tools/slack/api_wrapper.py,sha256=yZWrJtXBowhq1fmF7YrrBVyChdnxkYF1XfwHxe8-_D8,7555
273
+ alita_sdk/tools/slack/__init__.py,sha256=Y2sXN1__1923icF8bZbAtKVg3G_EZbCAjnj93yHUwtY,3415
274
+ alita_sdk/tools/slack/api_wrapper.py,sha256=dkMcS3xozEhoJ-A1ycEn6OqbIftxmVHjyYttTy3D2JI,7343
275
275
  alita_sdk/tools/sql/__init__.py,sha256=9Lh8YHKO8zD5eeolpR4O9swTUsjpXj9LVDn8fM-T5IM,3506
276
276
  alita_sdk/tools/sql/api_wrapper.py,sha256=Rky0_CX9HWDQ2mClHGAgP3LHjYVX4iymPuilZMtaDlQ,3687
277
277
  alita_sdk/tools/sql/models.py,sha256=AKJgSl_kEEz4fZfw3kbvdGHXaRZ-yiaqfJOB6YOj3i0,641
@@ -297,8 +297,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=UHVQUVqcBc3SZvDfO78HSuBzwAsRw
297
297
  alita_sdk/tools/zephyr_squad/__init__.py,sha256=rq4jOb3lRW2GXvAguk4H1KinO5f-zpygzhBJf-E1Ucw,2773
298
298
  alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=iOMxyE7vOc_LwFB_nBMiSFXkNtvbptA4i-BrTlo7M0A,5854
299
299
  alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=IYUJoMFOMA70knLhLtAnuGoy3OK80RuqeQZ710oyIxE,3631
300
- alita_sdk-0.3.191.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
301
- alita_sdk-0.3.191.dist-info/METADATA,sha256=7-ulNxjrYbxmdKjgcTMdwamNuNbUTtHq-6Dcqth1WVM,18804
302
- alita_sdk-0.3.191.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
303
- alita_sdk-0.3.191.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
304
- alita_sdk-0.3.191.dist-info/RECORD,,
300
+ alita_sdk-0.3.193.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
301
+ alita_sdk-0.3.193.dist-info/METADATA,sha256=_ciaBDZRw_ISqVr3oVPTmZPfE4mkrHSotJeAHvHPiq4,18804
302
+ alita_sdk-0.3.193.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
303
+ alita_sdk-0.3.193.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
304
+ alita_sdk-0.3.193.dist-info/RECORD,,