alita-sdk 0.3.173__py3-none-any.whl → 0.3.174__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.
- alita_sdk/tools/azure_ai/search/__init__.py +15 -4
- alita_sdk/tools/bitbucket/__init__.py +23 -7
- {alita_sdk-0.3.173.dist-info → alita_sdk-0.3.174.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.173.dist-info → alita_sdk-0.3.174.dist-info}/RECORD +7 -7
- {alita_sdk-0.3.173.dist-info → alita_sdk-0.3.174.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.173.dist-info → alita_sdk-0.3.174.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.173.dist-info → alita_sdk-0.3.174.dist-info}/top_level.txt +0 -0
@@ -4,7 +4,8 @@ from .api_wrapper import AzureSearchApiWrapper
|
|
4
4
|
from ...base.tool import BaseAction
|
5
5
|
from langchain_core.tools import BaseToolkit, BaseTool
|
6
6
|
from pydantic import create_model, BaseModel, ConfigDict, Field, SecretStr
|
7
|
-
from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
|
7
|
+
from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length, check_connection_response
|
8
|
+
import requests
|
8
9
|
|
9
10
|
logger = getLogger(__name__)
|
10
11
|
|
@@ -35,12 +36,12 @@ class AzureSearchToolkit(BaseToolkit):
|
|
35
36
|
def toolkit_config_schema() -> BaseModel:
|
36
37
|
selected_tools = {x['name']: x['args_schema'].schema() for x in AzureSearchApiWrapper.model_construct().get_available_tools()}
|
37
38
|
AzureSearchToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
38
|
-
|
39
|
+
m = create_model(
|
39
40
|
name,
|
40
|
-
api_key=(SecretStr, Field(description="API key", json_schema_extra={'secret': True})),
|
41
|
+
api_key=(SecretStr, Field(description="API key", json_schema_extra={'secret': True, 'configuration': True})),
|
41
42
|
endpoint=(str, Field(description="Azure Search endpoint")),
|
42
43
|
index_name=(str, Field(description="Azure Search index name")),
|
43
|
-
api_base=(Optional[str], Field(description="Azure OpenAI base URL", default=None, json_schema_extra={'toolkit_name': True, 'max_toolkit_length': AzureSearchToolkit.toolkit_max_length})),
|
44
|
+
api_base=(Optional[str], Field(description="Azure OpenAI base URL", default=None, json_schema_extra={'toolkit_name': True, 'max_toolkit_length': AzureSearchToolkit.toolkit_max_length, 'configuration': True})),
|
44
45
|
api_version=(Optional[str], Field(description="API version", default=None)),
|
45
46
|
openai_api_key=(Optional[str], Field(description="Azure OpenAI API Key", default=None, json_schema_extra={'secret': True})),
|
46
47
|
model_name=(str, Field(description="Model name for Embeddings model", default=None)),
|
@@ -54,6 +55,16 @@ class AzureSearchToolkit(BaseToolkit):
|
|
54
55
|
})
|
55
56
|
)
|
56
57
|
|
58
|
+
@check_connection_response
|
59
|
+
def check_connection(self):
|
60
|
+
response = requests.get(f"{self.api_base}/openai/deployments", headers={
|
61
|
+
"api-key": self.api_key
|
62
|
+
})
|
63
|
+
return response
|
64
|
+
|
65
|
+
m.check_connection = check_connection
|
66
|
+
return m
|
67
|
+
|
57
68
|
@classmethod
|
58
69
|
def get_toolkit(cls, selected_tools: list[str] | None = None, toolkit_name: Optional[str] = None, **kwargs):
|
59
70
|
if selected_tools is None:
|
@@ -1,10 +1,14 @@
|
|
1
1
|
from typing import Dict, List, Literal, Optional
|
2
|
+
|
3
|
+
from requests.auth import HTTPBasicAuth
|
4
|
+
|
2
5
|
from .api_wrapper import BitbucketAPIWrapper
|
3
6
|
from .tools import __all__
|
4
7
|
from langchain_core.tools import BaseToolkit
|
5
8
|
from langchain_core.tools import BaseTool
|
6
9
|
from pydantic import BaseModel, Field, ConfigDict, create_model, SecretStr
|
7
|
-
from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
|
10
|
+
from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length, check_connection_response
|
11
|
+
import requests
|
8
12
|
|
9
13
|
|
10
14
|
name = "bitbucket"
|
@@ -35,14 +39,14 @@ class AlitaBitbucketToolkit(BaseToolkit):
|
|
35
39
|
default = t['tool'].__pydantic_fields__['args_schema'].default
|
36
40
|
selected_tools[t['name']] = default.schema() if default else default
|
37
41
|
AlitaBitbucketToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
38
|
-
|
42
|
+
m = create_model(
|
39
43
|
name,
|
40
|
-
url=(str, Field(description="Bitbucket URL")),
|
41
|
-
project=(str, Field(description="Project/Workspace")),
|
42
|
-
repository=(str, Field(description="Repository", json_schema_extra={'toolkit_name': True, 'max_toolkit_length': AlitaBitbucketToolkit.toolkit_max_length})),
|
44
|
+
url=(str, Field(description="Bitbucket URL", json_schema_extra={'configuration': True})),
|
45
|
+
project=(str, Field(description="Project/Workspace", json_schema_extra={'configuration': True})),
|
46
|
+
repository=(str, Field(description="Repository", json_schema_extra={'toolkit_name': True, 'max_toolkit_length': AlitaBitbucketToolkit.toolkit_max_length, 'configuration': True})),
|
43
47
|
branch=(str, Field(description="Main branch", default="main")),
|
44
|
-
username=(str, Field(description="Username")),
|
45
|
-
password=(SecretStr, Field(description="GitLab private token", json_schema_extra={'secret': True})),
|
48
|
+
username=(str, Field(description="Username", json_schema_extra={'configuration': True})),
|
49
|
+
password=(SecretStr, Field(description="GitLab private token", json_schema_extra={'secret': True, 'configuration': True})),
|
46
50
|
cloud=(Optional[bool], Field(description="Hosting Option", default=None)),
|
47
51
|
selected_tools=(List[Literal[tuple(selected_tools)]], Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
48
52
|
__config__=ConfigDict(json_schema_extra=
|
@@ -56,6 +60,18 @@ class AlitaBitbucketToolkit(BaseToolkit):
|
|
56
60
|
})
|
57
61
|
)
|
58
62
|
|
63
|
+
@check_connection_response
|
64
|
+
def check_connection(self):
|
65
|
+
if self.cloud:
|
66
|
+
request_url = f"{self.url}/2.0/repositories/{self.project}/{self.repository}"
|
67
|
+
else:
|
68
|
+
request_url = f"{self.url}/rest/api/1.0/projects/{self.project}/repos/{self.repository}"
|
69
|
+
response = requests.get(request_url, auth=HTTPBasicAuth(self.username, self.password))
|
70
|
+
return response
|
71
|
+
|
72
|
+
m.check_connection = check_connection
|
73
|
+
return m
|
74
|
+
|
59
75
|
@classmethod
|
60
76
|
def get_toolkit(cls, selected_tools: list[str] | None = None, toolkit_name: Optional[str] = None, **kwargs):
|
61
77
|
if selected_tools is None:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: alita_sdk
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.174
|
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
|
@@ -144,11 +144,11 @@ alita_sdk/tools/ado/work_item/ado_wrapper.py,sha256=t0D9xubU0yy_JmRJ_zEtRCxwFLya
|
|
144
144
|
alita_sdk/tools/advanced_jira_mining/__init__.py,sha256=pUTzECqGvYaR5qWY3JPUhrImrZgc7pCXuqSe5eWIE80,4604
|
145
145
|
alita_sdk/tools/advanced_jira_mining/data_mining_wrapper.py,sha256=nZPtuwVWp8VeHw1B8q9kdwf-6ZvHnlXTOGdcIMDkKpw,44211
|
146
146
|
alita_sdk/tools/azure_ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
147
|
-
alita_sdk/tools/azure_ai/search/__init__.py,sha256=
|
147
|
+
alita_sdk/tools/azure_ai/search/__init__.py,sha256=CYqGc6jPkXb94_dNve1xY3rI8WTm4Gw5aEJlkMYV3U8,4198
|
148
148
|
alita_sdk/tools/azure_ai/search/api_wrapper.py,sha256=E4p6HPDlwgxfT_i6cvg9rN4Vn_47CVAyNBAKLIGq3mU,7265
|
149
149
|
alita_sdk/tools/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
150
150
|
alita_sdk/tools/base/tool.py,sha256=-N27AodZS49vdPCgFkU-bFS9bxoPopZBnNrmwInx3d0,864
|
151
|
-
alita_sdk/tools/bitbucket/__init__.py,sha256=
|
151
|
+
alita_sdk/tools/bitbucket/__init__.py,sha256=pYwgq-74AwZWeTIzdUKn-7tnuUgCqpOmz_2p-dBgEDs,4326
|
152
152
|
alita_sdk/tools/bitbucket/api_wrapper.py,sha256=HAmxY43VwfI08u0J6Z3ViBvADGNKM6LKAj1Iq5DNvMU,7133
|
153
153
|
alita_sdk/tools/bitbucket/bitbucket_constants.py,sha256=UsbhQ1iEvrKoxceTFPWTYhaXS1zSxbmjs1TwY0-P4gw,462
|
154
154
|
alita_sdk/tools/bitbucket/cloud_api_wrapper.py,sha256=9pvU--c02EB2JVkXuMI4cehWU657HsFpywAmtLC3yVs,7731
|
@@ -326,8 +326,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=UHVQUVqcBc3SZvDfO78HSuBzwAsRw
|
|
326
326
|
alita_sdk/tools/zephyr_squad/__init__.py,sha256=rq4jOb3lRW2GXvAguk4H1KinO5f-zpygzhBJf-E1Ucw,2773
|
327
327
|
alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=iOMxyE7vOc_LwFB_nBMiSFXkNtvbptA4i-BrTlo7M0A,5854
|
328
328
|
alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=IYUJoMFOMA70knLhLtAnuGoy3OK80RuqeQZ710oyIxE,3631
|
329
|
-
alita_sdk-0.3.
|
330
|
-
alita_sdk-0.3.
|
331
|
-
alita_sdk-0.3.
|
332
|
-
alita_sdk-0.3.
|
333
|
-
alita_sdk-0.3.
|
329
|
+
alita_sdk-0.3.174.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
330
|
+
alita_sdk-0.3.174.dist-info/METADATA,sha256=tbM4oo5f1XOezac1kgzmW98CVraz5Yky6q6N82k_vKg,18757
|
331
|
+
alita_sdk-0.3.174.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
332
|
+
alita_sdk-0.3.174.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
333
|
+
alita_sdk-0.3.174.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|