alita-sdk 0.3.486__py3-none-any.whl → 0.3.515__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/agent_loader.py +27 -6
- alita_sdk/cli/agents.py +10 -1
- alita_sdk/cli/inventory.py +12 -195
- alita_sdk/cli/tools/filesystem.py +95 -9
- 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 +64 -40
- alita_sdk/runtime/clients/sandbox_client.py +14 -0
- alita_sdk/runtime/langchain/assistant.py +48 -2
- alita_sdk/runtime/langchain/constants.py +3 -1
- alita_sdk/runtime/langchain/document_loaders/AlitaExcelLoader.py +103 -60
- 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 +12 -7
- alita_sdk/runtime/langchain/langraph_agent.py +10 -10
- 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 +94 -219
- alita_sdk/runtime/toolkits/planning.py +13 -6
- alita_sdk/runtime/toolkits/tools.py +60 -25
- alita_sdk/runtime/toolkits/vectorstore.py +11 -5
- alita_sdk/runtime/tools/artifact.py +185 -23
- alita_sdk/runtime/tools/function.py +2 -1
- alita_sdk/runtime/tools/llm.py +155 -34
- alita_sdk/runtime/tools/mcp_remote_tool.py +25 -10
- alita_sdk/runtime/tools/mcp_server_tool.py +2 -4
- alita_sdk/runtime/tools/vectorstore_base.py +3 -3
- alita_sdk/runtime/utils/AlitaCallback.py +136 -21
- alita_sdk/runtime/utils/mcp_client.py +492 -0
- alita_sdk/runtime/utils/mcp_oauth.py +125 -8
- alita_sdk/runtime/utils/mcp_sse_client.py +35 -6
- alita_sdk/runtime/utils/mcp_tools_discovery.py +124 -0
- alita_sdk/runtime/utils/toolkit_utils.py +7 -13
- 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 +26 -1
- 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/chunkers/sematic/json_chunker.py +1 -0
- alita_sdk/tools/chunkers/sematic/markdown_chunker.py +2 -0
- alita_sdk/tools/chunkers/universal_chunker.py +1 -0
- 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/loaders/codesearcher.py +3 -2
- alita_sdk/tools/code/sonar/__init__.py +9 -7
- alita_sdk/tools/confluence/__init__.py +15 -10
- alita_sdk/tools/confluence/api_wrapper.py +63 -14
- 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/sharepoint/api_wrapper.py +2 -2
- 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/vector_adapters/VectorStoreAdapter.py +16 -18
- 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.486.dist-info → alita_sdk-0.3.515.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.486.dist-info → alita_sdk-0.3.515.dist-info}/RECORD +124 -119
- {alita_sdk-0.3.486.dist-info → alita_sdk-0.3.515.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.486.dist-info → alita_sdk-0.3.515.dist-info}/entry_points.txt +0 -0
- {alita_sdk-0.3.486.dist-info → alita_sdk-0.3.515.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.486.dist-info → alita_sdk-0.3.515.dist-info}/top_level.txt +0 -0
|
@@ -5,7 +5,7 @@ from ..base.tool import BaseAction
|
|
|
5
5
|
from pydantic import create_model, BaseModel, ConfigDict, Field
|
|
6
6
|
|
|
7
7
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
8
|
-
from ..utils import clean_string,
|
|
8
|
+
from ..utils import clean_string, get_max_toolkit_length
|
|
9
9
|
from ...configurations.salesforce import SalesforceConfiguration
|
|
10
10
|
|
|
11
11
|
name = "salesforce"
|
|
@@ -19,11 +19,9 @@ def get_tools(tool):
|
|
|
19
19
|
|
|
20
20
|
class SalesforceToolkit(BaseToolkit):
|
|
21
21
|
tools: List[BaseTool] = []
|
|
22
|
-
toolkit_max_length: int = 0
|
|
23
22
|
@staticmethod
|
|
24
23
|
def toolkit_config_schema() -> BaseModel:
|
|
25
24
|
available_tools = {x['name']: x['args_schema'].schema() for x in SalesforceApiWrapper.model_construct().get_available_tools()}
|
|
26
|
-
SalesforceToolkit.toolkit_max_length = get_max_toolkit_length(available_tools)
|
|
27
25
|
return create_model(
|
|
28
26
|
name,
|
|
29
27
|
api_version=(str, Field(description="Salesforce API Version", default='v59.0')),
|
|
@@ -31,7 +29,6 @@ class SalesforceToolkit(BaseToolkit):
|
|
|
31
29
|
selected_tools=(List[Literal[tuple(available_tools)]], Field(default=[], json_schema_extra={'args_schemas': available_tools})),
|
|
32
30
|
__config__=ConfigDict(json_schema_extra={'metadata': {
|
|
33
31
|
"label": "Salesforce", "icon_url": "salesforce-icon.svg",
|
|
34
|
-
"max_length": SalesforceToolkit.toolkit_max_length,
|
|
35
32
|
"categories": ["other"],
|
|
36
33
|
"extra_categories": ["customer relationship management", "cloud computing", "marketing automation", "salesforce"]
|
|
37
34
|
}})
|
|
@@ -48,18 +45,21 @@ class SalesforceToolkit(BaseToolkit):
|
|
|
48
45
|
**kwargs.get('salesforce_configuration', {}),
|
|
49
46
|
}
|
|
50
47
|
api_wrapper = SalesforceApiWrapper(**wrapper_payload)
|
|
51
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
52
48
|
tools = []
|
|
53
49
|
|
|
54
50
|
for tool in api_wrapper.get_available_tools():
|
|
55
51
|
if selected_tools and tool["name"] not in selected_tools:
|
|
56
52
|
continue
|
|
57
|
-
|
|
53
|
+
description = f"Salesforce Tool: {tool['description']}"
|
|
54
|
+
if toolkit_name:
|
|
55
|
+
description = f"{description}\nToolkit: {toolkit_name}"
|
|
56
|
+
description = description[:1000]
|
|
58
57
|
tools.append(BaseAction(
|
|
59
58
|
api_wrapper=api_wrapper,
|
|
60
|
-
name=
|
|
61
|
-
description=
|
|
62
|
-
args_schema=tool["args_schema"]
|
|
59
|
+
name=tool["name"],
|
|
60
|
+
description=description,
|
|
61
|
+
args_schema=tool["args_schema"],
|
|
62
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
63
63
|
))
|
|
64
64
|
|
|
65
65
|
return cls(tools=tools)
|
|
@@ -7,7 +7,7 @@ from ..base.tool import BaseAction
|
|
|
7
7
|
from pydantic import create_model, BaseModel, ConfigDict, Field
|
|
8
8
|
|
|
9
9
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
10
|
-
from ..utils import clean_string,
|
|
10
|
+
from ..utils import clean_string, get_max_toolkit_length
|
|
11
11
|
from ...configurations.service_now import ServiceNowConfiguration
|
|
12
12
|
|
|
13
13
|
|
|
@@ -26,13 +26,11 @@ def get_tools(tool):
|
|
|
26
26
|
|
|
27
27
|
class ServiceNowToolkit(BaseToolkit):
|
|
28
28
|
tools: List[BaseTool] = []
|
|
29
|
-
toolkit_max_length: int = 0
|
|
30
29
|
|
|
31
30
|
@staticmethod
|
|
32
31
|
def toolkit_config_schema() -> BaseModel:
|
|
33
32
|
selected_tools = {x['name']: x['args_schema'].schema() for x in
|
|
34
33
|
ServiceNowAPIWrapper.model_construct().get_available_tools()}
|
|
35
|
-
ServiceNowToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
36
34
|
return create_model(
|
|
37
35
|
name,
|
|
38
36
|
name=(str, Field(description="Toolkit name")),
|
|
@@ -47,7 +45,6 @@ class ServiceNowToolkit(BaseToolkit):
|
|
|
47
45
|
'metadata': {
|
|
48
46
|
"label": "ServiceNow",
|
|
49
47
|
"icon_url": "service-now.svg",
|
|
50
|
-
"max_length": ServiceNowToolkit.toolkit_max_length,
|
|
51
48
|
"hidden": False,
|
|
52
49
|
"sections": {
|
|
53
50
|
"auth": {
|
|
@@ -79,18 +76,23 @@ class ServiceNowToolkit(BaseToolkit):
|
|
|
79
76
|
**kwargs['servicenow_configuration'],
|
|
80
77
|
}
|
|
81
78
|
servicenow_api_wrapper = ServiceNowAPIWrapper(**wrapper_payload)
|
|
82
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
83
79
|
available_tools = servicenow_api_wrapper.get_available_tools()
|
|
84
80
|
tools = []
|
|
85
81
|
for tool in available_tools:
|
|
86
82
|
if selected_tools:
|
|
87
83
|
if tool["name"] not in selected_tools:
|
|
88
84
|
continue
|
|
85
|
+
description = tool["description"]
|
|
86
|
+
if toolkit_name:
|
|
87
|
+
description = f"Toolkit: {toolkit_name}\n{description}"
|
|
88
|
+
description = f"ServiceNow: {servicenow_api_wrapper.base_url}\n{description}"
|
|
89
|
+
description = description[:1000]
|
|
89
90
|
tools.append(BaseAction(
|
|
90
91
|
api_wrapper=servicenow_api_wrapper,
|
|
91
|
-
name=
|
|
92
|
-
description=
|
|
93
|
-
args_schema=tool["args_schema"]
|
|
92
|
+
name=tool["name"],
|
|
93
|
+
description=description,
|
|
94
|
+
args_schema=tool["args_schema"],
|
|
95
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
94
96
|
))
|
|
95
97
|
return cls(tools=tools)
|
|
96
98
|
|
|
@@ -5,7 +5,7 @@ from pydantic import create_model, BaseModel, ConfigDict, Field
|
|
|
5
5
|
from .api_wrapper import SharepointApiWrapper
|
|
6
6
|
from ..base.tool import BaseAction
|
|
7
7
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
8
|
-
from ..utils import clean_string,
|
|
8
|
+
from ..utils import clean_string, get_max_toolkit_length
|
|
9
9
|
from ...configurations.pgvector import PgVectorConfiguration
|
|
10
10
|
from ...configurations.sharepoint import SharepointConfiguration
|
|
11
11
|
|
|
@@ -29,12 +29,10 @@ def get_tools(tool):
|
|
|
29
29
|
|
|
30
30
|
class SharepointToolkit(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 SharepointApiWrapper.model_construct().get_available_tools()}
|
|
37
|
-
SharepointToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
38
36
|
return create_model(
|
|
39
37
|
name,
|
|
40
38
|
sharepoint_configuration=(SharepointConfiguration, Field(description="SharePoint Configuration", json_schema_extra={'configuration_types': ['sharepoint']})),
|
|
@@ -48,7 +46,6 @@ class SharepointToolkit(BaseToolkit):
|
|
|
48
46
|
__config__=ConfigDict(json_schema_extra={
|
|
49
47
|
'metadata': {
|
|
50
48
|
"label": "Sharepoint", "icon_url": "sharepoint.svg",
|
|
51
|
-
"max_length": SharepointToolkit.toolkit_max_length,
|
|
52
49
|
"categories": ["office"],
|
|
53
50
|
"extra_categories": ["microsoft", "cloud storage", "team collaboration", "content management"]
|
|
54
51
|
}})
|
|
@@ -65,18 +62,22 @@ class SharepointToolkit(BaseToolkit):
|
|
|
65
62
|
**(kwargs.get('pgvector_configuration') or {}),
|
|
66
63
|
}
|
|
67
64
|
sharepoint_api_wrapper = SharepointApiWrapper(**wrapper_payload)
|
|
68
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
69
65
|
available_tools = sharepoint_api_wrapper.get_available_tools()
|
|
70
66
|
tools = []
|
|
71
67
|
for tool in available_tools:
|
|
72
68
|
if selected_tools:
|
|
73
69
|
if tool["name"] not in selected_tools:
|
|
74
70
|
continue
|
|
71
|
+
description = f"Sharepoint {sharepoint_api_wrapper.site_url}\n{tool['description']}"
|
|
72
|
+
if toolkit_name:
|
|
73
|
+
description = f"{description}\nToolkit: {toolkit_name}"
|
|
74
|
+
description = description[:1000]
|
|
75
75
|
tools.append(BaseAction(
|
|
76
76
|
api_wrapper=sharepoint_api_wrapper,
|
|
77
|
-
name=
|
|
78
|
-
description=
|
|
79
|
-
args_schema=tool["args_schema"]
|
|
77
|
+
name=tool["name"],
|
|
78
|
+
description=description,
|
|
79
|
+
args_schema=tool["args_schema"],
|
|
80
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
80
81
|
))
|
|
81
82
|
return cls(tools=tools)
|
|
82
83
|
|
|
@@ -271,13 +271,13 @@ class SharepointApiWrapper(NonCodeIndexerToolkit):
|
|
|
271
271
|
file_name = file.get('Name', '')
|
|
272
272
|
|
|
273
273
|
# Check if file should be skipped based on skip_extensions
|
|
274
|
-
if any(re.match(pattern.replace('
|
|
274
|
+
if any(re.match(re.escape(pattern).replace(r'\*', '.*') + '$', file_name, re.IGNORECASE)
|
|
275
275
|
for pattern in skip_extensions):
|
|
276
276
|
continue
|
|
277
277
|
|
|
278
278
|
# Check if file should be included based on include_extensions
|
|
279
279
|
# If include_extensions is empty, process all files (that weren't skipped)
|
|
280
|
-
if include_extensions and not (any(re.match(pattern.replace('
|
|
280
|
+
if include_extensions and not (any(re.match(re.escape(pattern).replace(r'\*', '.*') + '$', file_name, re.IGNORECASE)
|
|
281
281
|
for pattern in include_extensions)):
|
|
282
282
|
continue
|
|
283
283
|
|
|
@@ -12,7 +12,7 @@ from pydantic import create_model, BaseModel, Field
|
|
|
12
12
|
from ..base.tool import BaseAction
|
|
13
13
|
|
|
14
14
|
from .api_wrapper import SlackApiWrapper
|
|
15
|
-
from ..utils import
|
|
15
|
+
from ..utils import clean_string, get_max_toolkit_length, check_connection_response
|
|
16
16
|
from slack_sdk.errors import SlackApiError
|
|
17
17
|
from slack_sdk import WebClient
|
|
18
18
|
|
|
@@ -28,12 +28,10 @@ def get_tools(tool):
|
|
|
28
28
|
|
|
29
29
|
class SlackToolkit(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 SlackApiWrapper.model_construct().get_available_tools()}
|
|
36
|
-
SlackToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
37
35
|
|
|
38
36
|
@check_connection_response
|
|
39
37
|
def check_connection(self):
|
|
@@ -59,7 +57,6 @@ class SlackToolkit(BaseToolkit):
|
|
|
59
57
|
'metadata': {
|
|
60
58
|
"label": "Slack",
|
|
61
59
|
"icon_url": "slack-icon.svg",
|
|
62
|
-
"max_length": SlackToolkit.toolkit_max_length,
|
|
63
60
|
"categories": ["communication"],
|
|
64
61
|
"extra_categories": ["slack", "chat", "messaging", "collaboration"],
|
|
65
62
|
}
|
|
@@ -79,17 +76,21 @@ class SlackToolkit(BaseToolkit):
|
|
|
79
76
|
**kwargs['slack_configuration'],
|
|
80
77
|
}
|
|
81
78
|
slack_api_wrapper = SlackApiWrapper(**wrapper_payload)
|
|
82
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
83
79
|
available_tools = slack_api_wrapper.get_available_tools()
|
|
84
80
|
tools = []
|
|
85
81
|
for tool in available_tools:
|
|
86
82
|
if selected_tools and tool["name"] not in selected_tools:
|
|
87
83
|
continue
|
|
84
|
+
description = f"Slack Tool: {tool['description']}"
|
|
85
|
+
if toolkit_name:
|
|
86
|
+
description = f"{description}\nToolkit: {toolkit_name}"
|
|
87
|
+
description = description[:1000]
|
|
88
88
|
tools.append(BaseAction(
|
|
89
89
|
api_wrapper=slack_api_wrapper,
|
|
90
|
-
name=
|
|
91
|
-
description=
|
|
90
|
+
name=tool["name"],
|
|
91
|
+
description=description,
|
|
92
92
|
args_schema=tool["args_schema"],
|
|
93
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
93
94
|
))
|
|
94
95
|
return cls(tools=tools)
|
|
95
96
|
|
alita_sdk/tools/sql/__init__.py
CHANGED
|
@@ -7,7 +7,7 @@ from .api_wrapper import SQLApiWrapper
|
|
|
7
7
|
from ..base.tool import BaseAction
|
|
8
8
|
from .models import SQLDialect
|
|
9
9
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
10
|
-
from ..utils import
|
|
10
|
+
from ..utils import clean_string, get_max_toolkit_length
|
|
11
11
|
from ...configurations.sql import SqlConfiguration
|
|
12
12
|
|
|
13
13
|
name = "sql"
|
|
@@ -24,12 +24,10 @@ def get_tools(tool):
|
|
|
24
24
|
|
|
25
25
|
class SQLToolkit(BaseToolkit):
|
|
26
26
|
tools: list[BaseTool] = []
|
|
27
|
-
toolkit_max_length: int = 0
|
|
28
27
|
|
|
29
28
|
@staticmethod
|
|
30
29
|
def toolkit_config_schema() -> BaseModel:
|
|
31
30
|
selected_tools = {x['name']: x['args_schema'].schema() for x in SQLApiWrapper.model_construct().get_available_tools()}
|
|
32
|
-
SQLToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
33
31
|
supported_dialects = (d.value for d in SQLDialect)
|
|
34
32
|
return create_model(
|
|
35
33
|
name,
|
|
@@ -42,7 +40,6 @@ class SQLToolkit(BaseToolkit):
|
|
|
42
40
|
'metadata':
|
|
43
41
|
{
|
|
44
42
|
"label": "SQL", "icon_url": "sql-icon.svg",
|
|
45
|
-
"max_length": SQLToolkit.toolkit_max_length,
|
|
46
43
|
"categories": ["development"],
|
|
47
44
|
"extra_categories": ["sql", "data management", "data analysis"]}})
|
|
48
45
|
)
|
|
@@ -57,17 +54,21 @@ class SQLToolkit(BaseToolkit):
|
|
|
57
54
|
**kwargs.get('sql_configuration', {}),
|
|
58
55
|
}
|
|
59
56
|
sql_api_wrapper = SQLApiWrapper(**wrapper_payload)
|
|
60
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
61
57
|
available_tools = sql_api_wrapper.get_available_tools()
|
|
62
58
|
tools = []
|
|
63
59
|
for tool in available_tools:
|
|
64
60
|
if selected_tools and tool["name"] not in selected_tools:
|
|
65
61
|
continue
|
|
62
|
+
description = f"{tool['description']}\nDatabase: {sql_api_wrapper.database_name}. Host: {sql_api_wrapper.host}"
|
|
63
|
+
if toolkit_name:
|
|
64
|
+
description = f"{description}\nToolkit: {toolkit_name}"
|
|
65
|
+
description = description[:1000]
|
|
66
66
|
tools.append(BaseAction(
|
|
67
67
|
api_wrapper=sql_api_wrapper,
|
|
68
|
-
name=
|
|
69
|
-
description=
|
|
70
|
-
args_schema=tool["args_schema"]
|
|
68
|
+
name=tool["name"],
|
|
69
|
+
description=description,
|
|
70
|
+
args_schema=tool["args_schema"],
|
|
71
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
71
72
|
))
|
|
72
73
|
return cls(tools=tools)
|
|
73
74
|
|
|
@@ -6,7 +6,7 @@ from pydantic import create_model, BaseModel, ConfigDict, Field
|
|
|
6
6
|
from .api_wrapper import TestIOApiWrapper
|
|
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.testio import TestIOConfiguration
|
|
11
11
|
|
|
12
12
|
name = "testio"
|
|
@@ -19,8 +19,6 @@ def get_tools(tool):
|
|
|
19
19
|
).get_tools()
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
TOOLKIT_MAX_LENGTH = 25
|
|
23
|
-
|
|
24
22
|
class TestIOToolkit(BaseToolkit):
|
|
25
23
|
tools: list[BaseTool] = []
|
|
26
24
|
|
|
@@ -33,7 +31,6 @@ class TestIOToolkit(BaseToolkit):
|
|
|
33
31
|
testio_configuration=(TestIOConfiguration, Field(description="TestIO Configuration", json_schema_extra={'configuration_types': ['testio']})),
|
|
34
32
|
selected_tools=(List[Literal[tuple(selected_tools)]], Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
|
35
33
|
__config__=ConfigDict(json_schema_extra={'metadata': {"label": "TestIO", "icon_url": "testio-icon.svg",
|
|
36
|
-
"max_length": TOOLKIT_MAX_LENGTH,
|
|
37
34
|
"categories": ["testing"],
|
|
38
35
|
"extra_categories": ["test automation", "test case management", "test planning"]}})
|
|
39
36
|
)
|
|
@@ -48,17 +45,21 @@ class TestIOToolkit(BaseToolkit):
|
|
|
48
45
|
**kwargs.get('testio_configuration', {}),
|
|
49
46
|
}
|
|
50
47
|
testio_api_wrapper = TestIOApiWrapper(**wrapper_payload)
|
|
51
|
-
prefix = clean_string(toolkit_name, TOOLKIT_MAX_LENGTH) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
52
48
|
available_tools = testio_api_wrapper.get_available_tools()
|
|
53
49
|
tools = []
|
|
54
50
|
for tool in available_tools:
|
|
55
51
|
if selected_tools and tool["name"] not in selected_tools:
|
|
56
52
|
continue
|
|
53
|
+
description = tool["description"]
|
|
54
|
+
if toolkit_name:
|
|
55
|
+
description = f"Toolkit: {toolkit_name}\n{description}"
|
|
56
|
+
description = description[:1000]
|
|
57
57
|
tools.append(BaseAction(
|
|
58
58
|
api_wrapper=testio_api_wrapper,
|
|
59
|
-
name=
|
|
60
|
-
description=
|
|
61
|
-
args_schema=tool["args_schema"]
|
|
59
|
+
name=tool["name"],
|
|
60
|
+
description=description,
|
|
61
|
+
args_schema=tool["args_schema"],
|
|
62
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
62
63
|
))
|
|
63
64
|
return cls(tools=tools)
|
|
64
65
|
|
|
@@ -7,7 +7,7 @@ import requests
|
|
|
7
7
|
from .api_wrapper import TestrailAPIWrapper
|
|
8
8
|
from ..base.tool import BaseAction
|
|
9
9
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
10
|
-
from ..utils import clean_string,
|
|
10
|
+
from ..utils import clean_string, get_max_toolkit_length, check_connection_response
|
|
11
11
|
from ...configurations.testrail import TestRailConfiguration
|
|
12
12
|
from ...configurations.pgvector import PgVectorConfiguration
|
|
13
13
|
|
|
@@ -31,12 +31,10 @@ def get_tools(tool):
|
|
|
31
31
|
|
|
32
32
|
class TestrailToolkit(BaseToolkit):
|
|
33
33
|
tools: List[BaseTool] = []
|
|
34
|
-
toolkit_max_length: int = 0
|
|
35
34
|
|
|
36
35
|
@staticmethod
|
|
37
36
|
def toolkit_config_schema() -> BaseModel:
|
|
38
37
|
selected_tools = {x['name']: x['args_schema'].schema() for x in TestrailAPIWrapper.model_construct().get_available_tools()}
|
|
39
|
-
TestrailToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
40
38
|
m = create_model(
|
|
41
39
|
name,
|
|
42
40
|
testrail_configuration=(Optional[TestRailConfiguration], Field(description="TestRail Configuration", json_schema_extra={'configuration_types': ['testrail']})),
|
|
@@ -47,7 +45,6 @@ class TestrailToolkit(BaseToolkit):
|
|
|
47
45
|
selected_tools=(List[Literal[tuple(selected_tools)]], Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
|
48
46
|
__config__=ConfigDict(json_schema_extra={'metadata':
|
|
49
47
|
{"label": "Testrail", "icon_url": "testrail-icon.svg",
|
|
50
|
-
"max_length": TestrailToolkit.toolkit_max_length,
|
|
51
48
|
"categories": ["test management"],
|
|
52
49
|
"extra_categories": ["quality assurance", "test case management", "test planning"]
|
|
53
50
|
}})
|
|
@@ -77,18 +74,23 @@ class TestrailToolkit(BaseToolkit):
|
|
|
77
74
|
**(kwargs.get('pgvector_configuration') or {}),
|
|
78
75
|
}
|
|
79
76
|
testrail_api_wrapper = TestrailAPIWrapper(**wrapper_payload)
|
|
80
|
-
prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
|
|
81
77
|
available_tools = testrail_api_wrapper.get_available_tools()
|
|
82
78
|
tools = []
|
|
83
79
|
for tool in available_tools:
|
|
84
80
|
if selected_tools:
|
|
85
81
|
if tool["name"] not in selected_tools:
|
|
86
82
|
continue
|
|
83
|
+
description = tool["description"]
|
|
84
|
+
if toolkit_name:
|
|
85
|
+
description = f"Toolkit: {toolkit_name}\n{description}"
|
|
86
|
+
description = description + "\nTestrail instance: " + testrail_api_wrapper.url
|
|
87
|
+
description = description[:1000]
|
|
87
88
|
tools.append(BaseAction(
|
|
88
89
|
api_wrapper=testrail_api_wrapper,
|
|
89
|
-
name=
|
|
90
|
-
description=
|
|
91
|
-
args_schema=tool["args_schema"]
|
|
90
|
+
name=tool["name"],
|
|
91
|
+
description=description,
|
|
92
|
+
args_schema=tool["args_schema"],
|
|
93
|
+
metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
|
|
92
94
|
))
|
|
93
95
|
return cls(tools=tools)
|
|
94
96
|
|
|
@@ -7,6 +7,8 @@ import requests
|
|
|
7
7
|
from pydantic import create_model, Field
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
# DEPRECATED: Tool names no longer use prefixes
|
|
11
|
+
# Kept for backward compatibility only
|
|
10
12
|
TOOLKIT_SPLITTER = "___"
|
|
11
13
|
TOOL_NAME_LIMIT = 64
|
|
12
14
|
|
|
@@ -22,10 +24,13 @@ def clean_string(s: str, max_length: int = 0):
|
|
|
22
24
|
|
|
23
25
|
|
|
24
26
|
def get_max_toolkit_length(selected_tools: Any):
|
|
25
|
-
"""Calculates the maximum length of the toolkit name
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
"""DEPRECATED: Calculates the maximum length of the toolkit name.
|
|
28
|
+
|
|
29
|
+
This function is deprecated as tool names no longer use prefixes.
|
|
30
|
+
Returns a fixed value for backward compatibility.
|
|
31
|
+
"""
|
|
32
|
+
# Return a reasonable default since we no longer use prefixes
|
|
33
|
+
return 50
|
|
29
34
|
|
|
30
35
|
|
|
31
36
|
def parse_list(list_str: str = None) -> List[str]:
|