alita-sdk 0.3.497__py3-none-any.whl → 0.3.516__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/cli/inventory.py +12 -195
- alita_sdk/community/inventory/__init__.py +12 -0
- alita_sdk/community/inventory/toolkit.py +9 -5
- alita_sdk/community/inventory/toolkit_utils.py +176 -0
- alita_sdk/configurations/ado.py +144 -0
- alita_sdk/configurations/confluence.py +76 -42
- alita_sdk/configurations/figma.py +76 -0
- alita_sdk/configurations/gitlab.py +2 -0
- alita_sdk/configurations/qtest.py +72 -1
- alita_sdk/configurations/report_portal.py +96 -0
- alita_sdk/configurations/sharepoint.py +148 -0
- alita_sdk/configurations/testio.py +83 -0
- alita_sdk/runtime/clients/artifact.py +2 -2
- alita_sdk/runtime/clients/client.py +24 -19
- alita_sdk/runtime/clients/sandbox_client.py +14 -0
- alita_sdk/runtime/langchain/assistant.py +64 -23
- alita_sdk/runtime/langchain/constants.py +270 -1
- alita_sdk/runtime/langchain/document_loaders/AlitaJSONLinesLoader.py +77 -0
- alita_sdk/runtime/langchain/document_loaders/AlitaJSONLoader.py +2 -1
- alita_sdk/runtime/langchain/document_loaders/constants.py +2 -1
- alita_sdk/runtime/langchain/langraph_agent.py +8 -9
- alita_sdk/runtime/langchain/utils.py +6 -1
- alita_sdk/runtime/toolkits/artifact.py +14 -5
- alita_sdk/runtime/toolkits/datasource.py +13 -6
- alita_sdk/runtime/toolkits/mcp.py +26 -157
- alita_sdk/runtime/toolkits/planning.py +10 -5
- alita_sdk/runtime/toolkits/tools.py +23 -7
- alita_sdk/runtime/toolkits/vectorstore.py +11 -5
- alita_sdk/runtime/tools/artifact.py +139 -6
- alita_sdk/runtime/tools/llm.py +20 -10
- alita_sdk/runtime/tools/mcp_remote_tool.py +2 -3
- alita_sdk/runtime/tools/mcp_server_tool.py +2 -4
- alita_sdk/runtime/utils/AlitaCallback.py +30 -1
- alita_sdk/runtime/utils/mcp_client.py +33 -6
- alita_sdk/runtime/utils/mcp_oauth.py +125 -8
- alita_sdk/runtime/utils/mcp_sse_client.py +35 -6
- alita_sdk/runtime/utils/utils.py +2 -0
- alita_sdk/tools/__init__.py +15 -0
- alita_sdk/tools/ado/repos/__init__.py +10 -12
- alita_sdk/tools/ado/test_plan/__init__.py +23 -8
- alita_sdk/tools/ado/wiki/__init__.py +24 -8
- alita_sdk/tools/ado/wiki/ado_wrapper.py +21 -7
- alita_sdk/tools/ado/work_item/__init__.py +24 -8
- alita_sdk/tools/advanced_jira_mining/__init__.py +10 -8
- alita_sdk/tools/aws/delta_lake/__init__.py +12 -9
- alita_sdk/tools/aws/delta_lake/tool.py +5 -1
- alita_sdk/tools/azure_ai/search/__init__.py +9 -7
- alita_sdk/tools/base/tool.py +5 -1
- alita_sdk/tools/base_indexer_toolkit.py +25 -0
- alita_sdk/tools/bitbucket/__init__.py +14 -10
- alita_sdk/tools/bitbucket/api_wrapper.py +50 -2
- alita_sdk/tools/browser/__init__.py +5 -4
- alita_sdk/tools/carrier/__init__.py +5 -6
- alita_sdk/tools/cloud/aws/__init__.py +9 -7
- alita_sdk/tools/cloud/azure/__init__.py +9 -7
- alita_sdk/tools/cloud/gcp/__init__.py +9 -7
- alita_sdk/tools/cloud/k8s/__init__.py +9 -7
- alita_sdk/tools/code/linter/__init__.py +9 -8
- alita_sdk/tools/code/sonar/__init__.py +9 -7
- alita_sdk/tools/confluence/__init__.py +15 -10
- alita_sdk/tools/custom_open_api/__init__.py +11 -5
- alita_sdk/tools/elastic/__init__.py +10 -8
- alita_sdk/tools/elitea_base.py +387 -9
- alita_sdk/tools/figma/__init__.py +8 -7
- alita_sdk/tools/github/__init__.py +12 -14
- alita_sdk/tools/github/github_client.py +68 -2
- alita_sdk/tools/github/tool.py +5 -1
- alita_sdk/tools/gitlab/__init__.py +14 -11
- alita_sdk/tools/gitlab/api_wrapper.py +81 -1
- alita_sdk/tools/gitlab_org/__init__.py +9 -8
- alita_sdk/tools/google/bigquery/__init__.py +12 -12
- alita_sdk/tools/google/bigquery/tool.py +5 -1
- alita_sdk/tools/google_places/__init__.py +9 -8
- alita_sdk/tools/jira/__init__.py +15 -10
- alita_sdk/tools/keycloak/__init__.py +10 -8
- alita_sdk/tools/localgit/__init__.py +8 -3
- alita_sdk/tools/localgit/local_git.py +62 -54
- alita_sdk/tools/localgit/tool.py +5 -1
- alita_sdk/tools/memory/__init__.py +11 -3
- alita_sdk/tools/ocr/__init__.py +10 -8
- alita_sdk/tools/openapi/__init__.py +6 -2
- alita_sdk/tools/pandas/__init__.py +9 -7
- alita_sdk/tools/postman/__init__.py +10 -11
- alita_sdk/tools/pptx/__init__.py +9 -9
- alita_sdk/tools/qtest/__init__.py +9 -8
- alita_sdk/tools/rally/__init__.py +9 -8
- alita_sdk/tools/report_portal/__init__.py +11 -9
- alita_sdk/tools/salesforce/__init__.py +9 -9
- alita_sdk/tools/servicenow/__init__.py +10 -8
- alita_sdk/tools/sharepoint/__init__.py +9 -8
- alita_sdk/tools/slack/__init__.py +8 -7
- alita_sdk/tools/sql/__init__.py +9 -8
- alita_sdk/tools/testio/__init__.py +9 -8
- alita_sdk/tools/testrail/__init__.py +10 -8
- alita_sdk/tools/utils/__init__.py +9 -4
- alita_sdk/tools/utils/text_operations.py +254 -0
- alita_sdk/tools/xray/__init__.py +10 -8
- alita_sdk/tools/yagmail/__init__.py +8 -3
- alita_sdk/tools/zephyr/__init__.py +8 -7
- alita_sdk/tools/zephyr_enterprise/__init__.py +10 -8
- alita_sdk/tools/zephyr_essential/__init__.py +9 -8
- alita_sdk/tools/zephyr_scale/__init__.py +9 -8
- alita_sdk/tools/zephyr_squad/__init__.py +9 -8
- {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.516.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.516.dist-info}/RECORD +109 -106
- {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.516.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.516.dist-info}/entry_points.txt +0 -0
- {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.516.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.516.dist-info}/top_level.txt +0 -0
alita_sdk/tools/xray/__init__.py
CHANGED
|
@@ -8,7 +8,7 @@ from pydantic import create_model, BaseModel, Field
|
|
|
8
8
|
from .api_wrapper import XrayApiWrapper
|
|
9
9
|
from ..base.tool import BaseAction
|
|
10
10
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
11
|
-
from ..utils import clean_string, get_max_toolkit_length
|
|
11
|
+
from ..utils import clean_string, get_max_toolkit_length
|
|
12
12
|
from ...configurations.pgvector import PgVectorConfiguration
|
|
13
13
|
from ...configurations.xray import XrayConfiguration
|
|
14
14
|
|
|
@@ -34,12 +34,10 @@ def get_tools(tool):
|
|
|
34
34
|
|
|
35
35
|
class XrayToolkit(BaseToolkit):
|
|
36
36
|
tools: List[BaseTool] = []
|
|
37
|
-
toolkit_max_length: int = 0
|
|
38
37
|
|
|
39
38
|
@staticmethod
|
|
40
39
|
def toolkit_config_schema() -> BaseModel:
|
|
41
40
|
selected_tools = {x['name']: x['args_schema'].schema() for x in XrayApiWrapper.model_construct().get_available_tools()}
|
|
42
|
-
XrayToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
43
41
|
return create_model(
|
|
44
42
|
name,
|
|
45
43
|
limit=(Optional[int], Field(description="Limit", default=100)),
|
|
@@ -56,7 +54,6 @@ class XrayToolkit(BaseToolkit):
|
|
|
56
54
|
{
|
|
57
55
|
'metadata': {
|
|
58
56
|
"label": "XRAY cloud", "icon_url": "xray.svg",
|
|
59
|
-
"max_length": XrayToolkit.toolkit_max_length,
|
|
60
57
|
"categories": ["test management"],
|
|
61
58
|
"extra_categories": ["test automation", "test case management", "test planning"]
|
|
62
59
|
}
|
|
@@ -76,18 +73,23 @@ class XrayToolkit(BaseToolkit):
|
|
|
76
73
|
**(kwargs.get('pgvector_configuration') or {}),
|
|
77
74
|
}
|
|
78
75
|
xray_api_wrapper = XrayApiWrapper(**wrapper_payload)
|
|
79
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
80
76
|
available_tools = xray_api_wrapper.get_available_tools()
|
|
81
77
|
tools = []
|
|
82
78
|
for tool in available_tools:
|
|
83
79
|
if selected_tools:
|
|
84
80
|
if tool["name"] not in selected_tools:
|
|
85
81
|
continue
|
|
82
|
+
description = tool["description"]
|
|
83
|
+
if toolkit_name:
|
|
84
|
+
description = f"Toolkit: {toolkit_name}\n{description}"
|
|
85
|
+
description = description + "\nXray instance: " + xray_api_wrapper.base_url
|
|
86
|
+
description = description[:1000]
|
|
86
87
|
tools.append(BaseAction(
|
|
87
88
|
api_wrapper=xray_api_wrapper,
|
|
88
|
-
name=
|
|
89
|
-
description=
|
|
90
|
-
args_schema=tool["args_schema"]
|
|
89
|
+
name=tool["name"],
|
|
90
|
+
description=description,
|
|
91
|
+
args_schema=tool["args_schema"],
|
|
92
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
91
93
|
))
|
|
92
94
|
return cls(tools=tools)
|
|
93
95
|
|
|
@@ -34,7 +34,7 @@ class AlitaYagmailToolkit(BaseToolkit):
|
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
@classmethod
|
|
37
|
-
def get_toolkit(cls, selected_tools: list[str] | None = None, **kwargs):
|
|
37
|
+
def get_toolkit(cls, selected_tools: list[str] | None = None, toolkit_name: Optional[str] = None, **kwargs):
|
|
38
38
|
if selected_tools is None:
|
|
39
39
|
selected_tools = []
|
|
40
40
|
yagmail_wrapper = YagmailWrapper(**kwargs)
|
|
@@ -44,11 +44,16 @@ class AlitaYagmailToolkit(BaseToolkit):
|
|
|
44
44
|
if selected_tools:
|
|
45
45
|
if tool["name"] not in selected_tools:
|
|
46
46
|
continue
|
|
47
|
+
description = tool["description"]
|
|
48
|
+
if toolkit_name:
|
|
49
|
+
description = f"Toolkit: {toolkit_name}\n{description}"
|
|
50
|
+
description = description[:1000]
|
|
47
51
|
tools.append(BaseAction(
|
|
48
52
|
api_wrapper=yagmail_wrapper,
|
|
49
53
|
name=tool["name"],
|
|
50
|
-
description=
|
|
51
|
-
args_schema=tool["args_schema"]
|
|
54
|
+
description=description,
|
|
55
|
+
args_schema=tool["args_schema"],
|
|
56
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
52
57
|
))
|
|
53
58
|
return cls(tools=tools)
|
|
54
59
|
|
|
@@ -8,7 +8,7 @@ from pydantic import create_model, BaseModel, Field, SecretStr
|
|
|
8
8
|
from ..base.tool import BaseAction
|
|
9
9
|
from .api_wrapper import ZephyrV1ApiWrapper
|
|
10
10
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
11
|
-
from ..utils import clean_string,
|
|
11
|
+
from ..utils import clean_string, get_max_toolkit_length
|
|
12
12
|
|
|
13
13
|
name = "zephyr"
|
|
14
14
|
|
|
@@ -23,12 +23,10 @@ def get_tools(tool):
|
|
|
23
23
|
|
|
24
24
|
class ZephyrToolkit(BaseToolkit):
|
|
25
25
|
tools: List[BaseTool] = []
|
|
26
|
-
toolkit_max_length: int = 0
|
|
27
26
|
|
|
28
27
|
@staticmethod
|
|
29
28
|
def toolkit_config_schema() -> BaseModel:
|
|
30
29
|
selected_tools = {x['name']: x['args_schema'].schema() for x in ZephyrV1ApiWrapper.model_construct().get_available_tools()}
|
|
31
|
-
ZephyrToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
32
30
|
return create_model(
|
|
33
31
|
name,
|
|
34
32
|
base_url=(str, Field(description="Base URL")),
|
|
@@ -40,7 +38,6 @@ class ZephyrToolkit(BaseToolkit):
|
|
|
40
38
|
{
|
|
41
39
|
'metadata': {
|
|
42
40
|
"label": "Zephyr", "icon_url": "zephyr.svg", "hidden": True,
|
|
43
|
-
"max_length": ZephyrToolkit.toolkit_max_length,
|
|
44
41
|
"categories": ["test management"],
|
|
45
42
|
"extra_categories": ["test automation", "test case management", "test planning"]
|
|
46
43
|
}}}
|
|
@@ -50,18 +47,22 @@ class ZephyrToolkit(BaseToolkit):
|
|
|
50
47
|
@filter_missconfigured_index_tools
|
|
51
48
|
def get_toolkit(cls, selected_tools: list[str] | None = None, toolkit_name: Optional[str] = None, **kwargs):
|
|
52
49
|
zephyr_api_wrapper = ZephyrV1ApiWrapper(**kwargs)
|
|
53
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
54
50
|
available_tools = zephyr_api_wrapper.get_available_tools()
|
|
55
51
|
tools = []
|
|
56
52
|
for tool in available_tools:
|
|
57
53
|
if selected_tools:
|
|
58
54
|
if tool["name"] not in selected_tools:
|
|
59
55
|
continue
|
|
56
|
+
description = tool["description"]
|
|
57
|
+
if toolkit_name:
|
|
58
|
+
description = f"Toolkit: {toolkit_name}\n{description}"
|
|
59
|
+
description = description[:1000]
|
|
60
60
|
tools.append(BaseAction(
|
|
61
61
|
api_wrapper=zephyr_api_wrapper,
|
|
62
62
|
name=tool["name"],
|
|
63
|
-
description=
|
|
64
|
-
args_schema=tool["args_schema"]
|
|
63
|
+
description=description,
|
|
64
|
+
args_schema=tool["args_schema"],
|
|
65
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
65
66
|
))
|
|
66
67
|
return cls(tools=tools)
|
|
67
68
|
|
|
@@ -5,7 +5,7 @@ from typing import List, Literal, Optional
|
|
|
5
5
|
from .api_wrapper import ZephyrApiWrapper
|
|
6
6
|
from ..base.tool import BaseAction
|
|
7
7
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
8
|
-
from ..utils import clean_string, get_max_toolkit_length
|
|
8
|
+
from ..utils import clean_string, get_max_toolkit_length
|
|
9
9
|
from ...configurations.pgvector import PgVectorConfiguration
|
|
10
10
|
from ...configurations.zephyr_enterprise import ZephyrEnterpriseConfiguration
|
|
11
11
|
|
|
@@ -28,13 +28,11 @@ def get_tools(tool):
|
|
|
28
28
|
|
|
29
29
|
class ZephyrEnterpriseToolkit(BaseToolkit):
|
|
30
30
|
tools: List[BaseTool] = []
|
|
31
|
-
toolkit_max_length: int = 0
|
|
32
31
|
|
|
33
32
|
@staticmethod
|
|
34
33
|
def toolkit_config_schema() -> BaseModel:
|
|
35
34
|
selected_tools = {x['name']: x['args_schema'].schema() for x in
|
|
36
35
|
ZephyrApiWrapper.model_construct().get_available_tools()}
|
|
37
|
-
ZephyrEnterpriseToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
38
36
|
return create_model(
|
|
39
37
|
name,
|
|
40
38
|
zephyr_configuration=(ZephyrEnterpriseConfiguration, Field(description="Zephyr Configuration", json_schema_extra={'configuration_types': ['zephyr_enterprise']})),
|
|
@@ -49,7 +47,6 @@ class ZephyrEnterpriseToolkit(BaseToolkit):
|
|
|
49
47
|
__config__=ConfigDict(json_schema_extra={
|
|
50
48
|
'metadata': {
|
|
51
49
|
"label": "Zephyr Enterprise", "icon_url": "zephyr.svg",
|
|
52
|
-
"max_length": ZephyrEnterpriseToolkit.toolkit_max_length,
|
|
53
50
|
"categories": ["test management"],
|
|
54
51
|
"extra_categories": ["test automation", "test case management", "test planning"]
|
|
55
52
|
}})
|
|
@@ -68,17 +65,22 @@ class ZephyrEnterpriseToolkit(BaseToolkit):
|
|
|
68
65
|
**(kwargs.get('embedding_configuration') or {}),
|
|
69
66
|
}
|
|
70
67
|
zephyr_api_wrapper = ZephyrApiWrapper(**wrapper_payload)
|
|
71
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
72
68
|
available_tools = zephyr_api_wrapper.get_available_tools()
|
|
73
69
|
tools = []
|
|
74
70
|
for tool in available_tools:
|
|
75
71
|
if selected_tools and tool["name"] not in selected_tools:
|
|
76
72
|
continue
|
|
73
|
+
description = tool["description"]
|
|
74
|
+
if toolkit_name:
|
|
75
|
+
description = f"Toolkit: {toolkit_name}\n{description}"
|
|
76
|
+
description = description + "\nZephyr Enterprise instance: " + zephyr_api_wrapper.base_url
|
|
77
|
+
description = description[:1000]
|
|
77
78
|
tools.append(BaseAction(
|
|
78
79
|
api_wrapper=zephyr_api_wrapper,
|
|
79
|
-
name=
|
|
80
|
-
description=
|
|
81
|
-
args_schema=tool["args_schema"]
|
|
80
|
+
name=tool["name"],
|
|
81
|
+
description=description,
|
|
82
|
+
args_schema=tool["args_schema"],
|
|
83
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
82
84
|
))
|
|
83
85
|
return cls(tools=tools)
|
|
84
86
|
|
|
@@ -6,7 +6,7 @@ from pydantic import create_model, BaseModel, Field
|
|
|
6
6
|
from .api_wrapper import ZephyrEssentialApiWrapper
|
|
7
7
|
from ..base.tool import BaseAction
|
|
8
8
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
9
|
-
from ..utils import clean_string,
|
|
9
|
+
from ..utils import clean_string, get_max_toolkit_length
|
|
10
10
|
from ...configurations.pgvector import PgVectorConfiguration
|
|
11
11
|
from ...configurations.zephyr_essential import ZephyrEssentialConfiguration
|
|
12
12
|
|
|
@@ -29,12 +29,10 @@ def get_tools(tool):
|
|
|
29
29
|
|
|
30
30
|
class ZephyrEssentialToolkit(BaseToolkit):
|
|
31
31
|
tools: List[BaseTool] = []
|
|
32
|
-
toolkit_max_length: int = 0
|
|
33
32
|
|
|
34
33
|
@staticmethod
|
|
35
34
|
def toolkit_config_schema() -> BaseModel:
|
|
36
35
|
selected_tools = {x['name']: x['args_schema'].schema() for x in ZephyrEssentialApiWrapper.model_construct().get_available_tools()}
|
|
37
|
-
ZephyrEssentialToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
38
36
|
return create_model(
|
|
39
37
|
name,
|
|
40
38
|
zephyr_essential_configuration=(ZephyrEssentialConfiguration, Field(description="Zephyr Essential Configuration", json_schema_extra={'configuration_types': ['zephyr_essential']})),
|
|
@@ -46,7 +44,6 @@ class ZephyrEssentialToolkit(BaseToolkit):
|
|
|
46
44
|
# embedder settings
|
|
47
45
|
embedding_model=(Optional[str], Field(default=None, description="Embedding configuration.", json_schema_extra={'configuration_model': 'embedding'})),
|
|
48
46
|
__config__={'json_schema_extra': {'metadata': {"label": "Zephyr Essential", "icon_url": "zephyr.svg",
|
|
49
|
-
"max_length": ZephyrEssentialToolkit.toolkit_max_length,
|
|
50
47
|
"categories": ["test management"],
|
|
51
48
|
"extra_categories": ["test automation", "test case management", "test planning"]
|
|
52
49
|
}}}
|
|
@@ -63,18 +60,22 @@ class ZephyrEssentialToolkit(BaseToolkit):
|
|
|
63
60
|
**(kwargs.get('pgvector_configuration') or {}),
|
|
64
61
|
}
|
|
65
62
|
zephyr_api_wrapper = ZephyrEssentialApiWrapper(**wrapper_payload)
|
|
66
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
67
63
|
available_tools = zephyr_api_wrapper.get_available_tools()
|
|
68
64
|
tools = []
|
|
69
65
|
for tool in available_tools:
|
|
70
66
|
if selected_tools:
|
|
71
67
|
if tool["name"] not in selected_tools:
|
|
72
68
|
continue
|
|
69
|
+
description = tool["description"]
|
|
70
|
+
if toolkit_name:
|
|
71
|
+
description = f"Toolkit: {toolkit_name}\n{description}"
|
|
72
|
+
description = description[:1000]
|
|
73
73
|
tools.append(BaseAction(
|
|
74
74
|
api_wrapper=zephyr_api_wrapper,
|
|
75
|
-
name=
|
|
76
|
-
description=
|
|
77
|
-
args_schema=tool["args_schema"]
|
|
75
|
+
name=tool["name"],
|
|
76
|
+
description=description,
|
|
77
|
+
args_schema=tool["args_schema"],
|
|
78
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
78
79
|
))
|
|
79
80
|
return cls(tools=tools)
|
|
80
81
|
|
|
@@ -7,7 +7,7 @@ from pydantic import create_model, BaseModel, Field
|
|
|
7
7
|
from .api_wrapper import ZephyrScaleApiWrapper
|
|
8
8
|
from ..base.tool import BaseAction
|
|
9
9
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
10
|
-
from ..utils import clean_string, get_max_toolkit_length
|
|
10
|
+
from ..utils import clean_string, get_max_toolkit_length
|
|
11
11
|
from ...configurations.pgvector import PgVectorConfiguration
|
|
12
12
|
from ...configurations.zephyr import ZephyrConfiguration
|
|
13
13
|
|
|
@@ -32,12 +32,10 @@ def get_tools(tool):
|
|
|
32
32
|
|
|
33
33
|
class ZephyrScaleToolkit(BaseToolkit):
|
|
34
34
|
tools: List[BaseTool] = []
|
|
35
|
-
toolkit_max_length: int = 0
|
|
36
35
|
|
|
37
36
|
@staticmethod
|
|
38
37
|
def toolkit_config_schema() -> BaseModel:
|
|
39
38
|
selected_tools = {x['name']: x['args_schema'].schema() for x in ZephyrScaleApiWrapper.model_construct().get_available_tools()}
|
|
40
|
-
ZephyrScaleToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
41
39
|
return create_model(
|
|
42
40
|
name,
|
|
43
41
|
max_results=(int, Field(default=100, description="Results count to show")),
|
|
@@ -56,7 +54,6 @@ class ZephyrScaleToolkit(BaseToolkit):
|
|
|
56
54
|
'metadata': {
|
|
57
55
|
"label": "Zephyr Scale",
|
|
58
56
|
"icon_url": "zephyr.svg",
|
|
59
|
-
"max_length": ZephyrScaleToolkit.toolkit_max_length,
|
|
60
57
|
"categories": ["test management"],
|
|
61
58
|
"extra_categories": ["test automation", "test case management", "test planning"],
|
|
62
59
|
}
|
|
@@ -76,18 +73,22 @@ class ZephyrScaleToolkit(BaseToolkit):
|
|
|
76
73
|
**(kwargs.get('pgvector_configuration') or {}),
|
|
77
74
|
}
|
|
78
75
|
zephyr_wrapper = ZephyrScaleApiWrapper(**wrapper_payload)
|
|
79
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
80
76
|
available_tools = zephyr_wrapper.get_available_tools()
|
|
81
77
|
tools = []
|
|
82
78
|
for tool in available_tools:
|
|
83
79
|
if selected_tools:
|
|
84
80
|
if tool["name"] not in selected_tools:
|
|
85
81
|
continue
|
|
82
|
+
description = tool["description"]
|
|
83
|
+
if toolkit_name:
|
|
84
|
+
description = f"Toolkit: {toolkit_name}\n{description}"
|
|
85
|
+
description = description[:1000]
|
|
86
86
|
tools.append(BaseAction(
|
|
87
87
|
api_wrapper=zephyr_wrapper,
|
|
88
|
-
name=
|
|
89
|
-
description=
|
|
90
|
-
args_schema=tool["args_schema"]
|
|
88
|
+
name=tool["name"],
|
|
89
|
+
description=description,
|
|
90
|
+
args_schema=tool["args_schema"],
|
|
91
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
91
92
|
))
|
|
92
93
|
return cls(tools=tools)
|
|
93
94
|
|
|
@@ -6,7 +6,7 @@ from pydantic import create_model, BaseModel, Field, SecretStr
|
|
|
6
6
|
from .api_wrapper import ZephyrSquadApiWrapper
|
|
7
7
|
from ..base.tool import BaseAction
|
|
8
8
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
9
|
-
from ..utils import clean_string,
|
|
9
|
+
from ..utils import clean_string, get_max_toolkit_length
|
|
10
10
|
|
|
11
11
|
name = "zephyr_squad"
|
|
12
12
|
|
|
@@ -21,12 +21,10 @@ def get_tools(tool):
|
|
|
21
21
|
|
|
22
22
|
class ZephyrSquadToolkit(BaseToolkit):
|
|
23
23
|
tools: List[BaseTool] = []
|
|
24
|
-
toolkit_max_length: int = 0
|
|
25
24
|
|
|
26
25
|
@staticmethod
|
|
27
26
|
def toolkit_config_schema() -> BaseModel:
|
|
28
27
|
selected_tools = {x['name']: x['args_schema'].schema() for x in ZephyrSquadApiWrapper.model_construct().get_available_tools()}
|
|
29
|
-
ZephyrSquadToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
30
28
|
return create_model(
|
|
31
29
|
name,
|
|
32
30
|
account_id=(str, Field(description="AccountID for the user that is going to be authenticating")),
|
|
@@ -34,7 +32,6 @@ class ZephyrSquadToolkit(BaseToolkit):
|
|
|
34
32
|
secret_key=(SecretStr, Field(description="Generated secret key", json_schema_extra={'secret': True})),
|
|
35
33
|
selected_tools=(List[Literal[tuple(selected_tools)]], Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
|
36
34
|
__config__={'json_schema_extra': {'metadata': {"label": "Zephyr Squad", "icon_url": "zephyr.svg",
|
|
37
|
-
"max_length": ZephyrSquadToolkit.toolkit_max_length,
|
|
38
35
|
"categories": ["test management"],
|
|
39
36
|
"extra_categories": ["test automation", "test case management", "test planning"]
|
|
40
37
|
}}}
|
|
@@ -44,18 +41,22 @@ class ZephyrSquadToolkit(BaseToolkit):
|
|
|
44
41
|
@filter_missconfigured_index_tools
|
|
45
42
|
def get_toolkit(cls, selected_tools: list[str] | None = None, toolkit_name: Optional[str] = None, **kwargs):
|
|
46
43
|
zephyr_api_wrapper = ZephyrSquadApiWrapper(**kwargs)
|
|
47
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
48
44
|
available_tools = zephyr_api_wrapper.get_available_tools()
|
|
49
45
|
tools = []
|
|
50
46
|
for tool in available_tools:
|
|
51
47
|
if selected_tools:
|
|
52
48
|
if tool["name"] not in selected_tools:
|
|
53
49
|
continue
|
|
50
|
+
description = tool["description"]
|
|
51
|
+
if toolkit_name:
|
|
52
|
+
description = f"Toolkit: {toolkit_name}\n{description}"
|
|
53
|
+
description = description[:1000]
|
|
54
54
|
tools.append(BaseAction(
|
|
55
55
|
api_wrapper=zephyr_api_wrapper,
|
|
56
|
-
name=
|
|
57
|
-
description=
|
|
58
|
-
args_schema=tool["args_schema"]
|
|
56
|
+
name=tool["name"],
|
|
57
|
+
description=description,
|
|
58
|
+
args_schema=tool["args_schema"],
|
|
59
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
59
60
|
))
|
|
60
61
|
return cls(tools=tools)
|
|
61
62
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alita_sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.516
|
|
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
|