alita-sdk 0.3.365__py3-none-any.whl → 0.3.462__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/__init__.py +10 -0
- alita_sdk/cli/__main__.py +17 -0
- alita_sdk/cli/agent_executor.py +144 -0
- alita_sdk/cli/agent_loader.py +197 -0
- alita_sdk/cli/agent_ui.py +166 -0
- alita_sdk/cli/agents.py +1069 -0
- alita_sdk/cli/callbacks.py +576 -0
- alita_sdk/cli/cli.py +159 -0
- alita_sdk/cli/config.py +153 -0
- alita_sdk/cli/formatting.py +182 -0
- alita_sdk/cli/mcp_loader.py +315 -0
- alita_sdk/cli/toolkit.py +330 -0
- alita_sdk/cli/toolkit_loader.py +55 -0
- alita_sdk/cli/tools/__init__.py +9 -0
- alita_sdk/cli/tools/filesystem.py +905 -0
- alita_sdk/configurations/bitbucket.py +95 -0
- alita_sdk/configurations/confluence.py +96 -1
- alita_sdk/configurations/gitlab.py +79 -0
- alita_sdk/configurations/jira.py +103 -0
- alita_sdk/configurations/testrail.py +88 -0
- alita_sdk/configurations/xray.py +93 -0
- alita_sdk/configurations/zephyr_enterprise.py +93 -0
- alita_sdk/configurations/zephyr_essential.py +75 -0
- alita_sdk/runtime/clients/artifact.py +1 -1
- alita_sdk/runtime/clients/client.py +47 -10
- alita_sdk/runtime/clients/mcp_discovery.py +342 -0
- alita_sdk/runtime/clients/mcp_manager.py +262 -0
- alita_sdk/runtime/clients/sandbox_client.py +373 -0
- alita_sdk/runtime/langchain/assistant.py +70 -41
- alita_sdk/runtime/langchain/constants.py +6 -1
- alita_sdk/runtime/langchain/document_loaders/AlitaDocxMammothLoader.py +315 -3
- alita_sdk/runtime/langchain/document_loaders/AlitaJSONLoader.py +4 -1
- alita_sdk/runtime/langchain/document_loaders/constants.py +73 -100
- alita_sdk/runtime/langchain/langraph_agent.py +164 -38
- alita_sdk/runtime/langchain/utils.py +43 -7
- alita_sdk/runtime/models/mcp_models.py +61 -0
- alita_sdk/runtime/toolkits/__init__.py +24 -0
- alita_sdk/runtime/toolkits/application.py +8 -1
- alita_sdk/runtime/toolkits/artifact.py +5 -6
- alita_sdk/runtime/toolkits/mcp.py +895 -0
- alita_sdk/runtime/toolkits/tools.py +140 -50
- alita_sdk/runtime/tools/__init__.py +7 -2
- alita_sdk/runtime/tools/application.py +7 -0
- alita_sdk/runtime/tools/function.py +94 -5
- alita_sdk/runtime/tools/graph.py +10 -4
- alita_sdk/runtime/tools/image_generation.py +104 -8
- alita_sdk/runtime/tools/llm.py +204 -114
- alita_sdk/runtime/tools/mcp_inspect_tool.py +284 -0
- alita_sdk/runtime/tools/mcp_remote_tool.py +166 -0
- alita_sdk/runtime/tools/mcp_server_tool.py +3 -1
- alita_sdk/runtime/tools/sandbox.py +180 -79
- alita_sdk/runtime/tools/vectorstore.py +22 -21
- alita_sdk/runtime/tools/vectorstore_base.py +79 -26
- alita_sdk/runtime/utils/mcp_oauth.py +164 -0
- alita_sdk/runtime/utils/mcp_sse_client.py +405 -0
- alita_sdk/runtime/utils/streamlit.py +34 -3
- alita_sdk/runtime/utils/toolkit_utils.py +14 -4
- alita_sdk/runtime/utils/utils.py +1 -0
- alita_sdk/tools/__init__.py +48 -31
- alita_sdk/tools/ado/repos/__init__.py +1 -0
- alita_sdk/tools/ado/test_plan/__init__.py +1 -1
- alita_sdk/tools/ado/wiki/__init__.py +1 -5
- alita_sdk/tools/ado/work_item/__init__.py +1 -5
- alita_sdk/tools/ado/work_item/ado_wrapper.py +17 -8
- alita_sdk/tools/base_indexer_toolkit.py +194 -112
- alita_sdk/tools/bitbucket/__init__.py +1 -0
- alita_sdk/tools/chunkers/sematic/proposal_chunker.py +1 -1
- alita_sdk/tools/code/sonar/__init__.py +1 -1
- alita_sdk/tools/code_indexer_toolkit.py +15 -5
- alita_sdk/tools/confluence/__init__.py +2 -2
- alita_sdk/tools/confluence/api_wrapper.py +110 -63
- alita_sdk/tools/confluence/loader.py +10 -0
- alita_sdk/tools/elitea_base.py +22 -22
- alita_sdk/tools/github/__init__.py +2 -2
- alita_sdk/tools/gitlab/__init__.py +2 -1
- alita_sdk/tools/gitlab/api_wrapper.py +11 -7
- alita_sdk/tools/gitlab_org/__init__.py +1 -2
- alita_sdk/tools/google_places/__init__.py +2 -1
- alita_sdk/tools/jira/__init__.py +1 -0
- alita_sdk/tools/jira/api_wrapper.py +1 -1
- alita_sdk/tools/memory/__init__.py +1 -1
- alita_sdk/tools/non_code_indexer_toolkit.py +2 -2
- alita_sdk/tools/openapi/__init__.py +10 -1
- alita_sdk/tools/pandas/__init__.py +1 -1
- alita_sdk/tools/postman/__init__.py +2 -1
- alita_sdk/tools/postman/api_wrapper.py +18 -8
- alita_sdk/tools/postman/postman_analysis.py +8 -1
- alita_sdk/tools/pptx/__init__.py +2 -2
- alita_sdk/tools/qtest/__init__.py +3 -3
- alita_sdk/tools/qtest/api_wrapper.py +1708 -76
- alita_sdk/tools/rally/__init__.py +1 -2
- alita_sdk/tools/report_portal/__init__.py +1 -0
- alita_sdk/tools/salesforce/__init__.py +1 -0
- alita_sdk/tools/servicenow/__init__.py +2 -3
- alita_sdk/tools/sharepoint/__init__.py +1 -0
- alita_sdk/tools/sharepoint/api_wrapper.py +125 -34
- alita_sdk/tools/sharepoint/authorization_helper.py +191 -1
- alita_sdk/tools/sharepoint/utils.py +8 -2
- alita_sdk/tools/slack/__init__.py +1 -0
- alita_sdk/tools/sql/__init__.py +2 -1
- alita_sdk/tools/sql/api_wrapper.py +71 -23
- alita_sdk/tools/testio/__init__.py +1 -0
- alita_sdk/tools/testrail/__init__.py +1 -3
- alita_sdk/tools/utils/__init__.py +17 -0
- alita_sdk/tools/utils/content_parser.py +35 -24
- alita_sdk/tools/vector_adapters/VectorStoreAdapter.py +67 -21
- alita_sdk/tools/xray/__init__.py +2 -1
- alita_sdk/tools/zephyr/__init__.py +2 -1
- alita_sdk/tools/zephyr_enterprise/__init__.py +1 -0
- alita_sdk/tools/zephyr_essential/__init__.py +1 -0
- alita_sdk/tools/zephyr_scale/__init__.py +1 -0
- alita_sdk/tools/zephyr_squad/__init__.py +1 -0
- {alita_sdk-0.3.365.dist-info → alita_sdk-0.3.462.dist-info}/METADATA +8 -2
- {alita_sdk-0.3.365.dist-info → alita_sdk-0.3.462.dist-info}/RECORD +118 -93
- alita_sdk-0.3.462.dist-info/entry_points.txt +2 -0
- {alita_sdk-0.3.365.dist-info → alita_sdk-0.3.462.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.365.dist-info → alita_sdk-0.3.462.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.365.dist-info → alita_sdk-0.3.462.dist-info}/top_level.txt +0 -0
|
@@ -6,11 +6,11 @@ from alita_sdk.tools.base_indexer_toolkit import BaseIndexerToolkit
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class NonCodeIndexerToolkit(BaseIndexerToolkit):
|
|
9
|
-
def _get_indexed_data(self,
|
|
9
|
+
def _get_indexed_data(self, index_name: str):
|
|
10
10
|
if not self.vector_adapter:
|
|
11
11
|
raise ToolException("Vector adapter is not initialized. "
|
|
12
12
|
"Check your configuration: embedding_model and vectorstore_type.")
|
|
13
|
-
return self.vector_adapter.get_indexed_data(self,
|
|
13
|
+
return self.vector_adapter.get_indexed_data(self, index_name)
|
|
14
14
|
|
|
15
15
|
def key_fn(self, document: Document):
|
|
16
16
|
return document.metadata.get('id')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import re
|
|
3
3
|
import logging
|
|
4
|
+
import yaml
|
|
4
5
|
from typing import List, Any, Optional, Dict
|
|
5
6
|
from langchain_core.tools import BaseTool, BaseToolkit, ToolException
|
|
6
7
|
from requests_openapi import Operation, Client, Server
|
|
@@ -101,7 +102,15 @@ class AlitaOpenAPIToolkit(BaseToolkit):
|
|
|
101
102
|
else:
|
|
102
103
|
tools_set = {}
|
|
103
104
|
if isinstance(openapi_spec, str):
|
|
104
|
-
|
|
105
|
+
# Try to detect if it's YAML or JSON by attempting to parse as JSON first
|
|
106
|
+
try:
|
|
107
|
+
openapi_spec = json.loads(openapi_spec)
|
|
108
|
+
except json.JSONDecodeError:
|
|
109
|
+
# If JSON parsing fails, try YAML
|
|
110
|
+
try:
|
|
111
|
+
openapi_spec = yaml.safe_load(openapi_spec)
|
|
112
|
+
except yaml.YAMLError as e:
|
|
113
|
+
raise ToolException(f"Failed to parse OpenAPI spec as JSON or YAML: {e}")
|
|
105
114
|
c = Client()
|
|
106
115
|
c.load_spec(openapi_spec)
|
|
107
116
|
if headers:
|
|
@@ -29,7 +29,7 @@ class PandasToolkit(BaseToolkit):
|
|
|
29
29
|
PandasToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
|
30
30
|
return create_model(
|
|
31
31
|
name,
|
|
32
|
-
bucket_name=(str, Field(default=None, title="Bucket name", description="Bucket where the content file is stored"
|
|
32
|
+
bucket_name=(str, Field(default=None, title="Bucket name", description="Bucket where the content file is stored")),
|
|
33
33
|
selected_tools=(List[Literal[tuple(selected_tools)]], Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
|
34
34
|
__config__=ConfigDict(json_schema_extra={'metadata': {"label": "Pandas", "icon_url": "pandas-icon.svg",
|
|
35
35
|
"categories": ["analysis"],
|
|
@@ -62,7 +62,8 @@ class PostmanToolkit(BaseToolkit):
|
|
|
62
62
|
selected_tools=(List[Literal[tuple(selected_tools)]], Field(
|
|
63
63
|
default=[], json_schema_extra={'args_schemas': selected_tools})),
|
|
64
64
|
__config__=ConfigDict(json_schema_extra={'metadata': {
|
|
65
|
-
"label": "Postman", "icon_url": "postman.svg"
|
|
65
|
+
"label": "Postman", "icon_url": "postman.svg",
|
|
66
|
+
"max_length": PostmanToolkit.toolkit_max_length,}})
|
|
66
67
|
)
|
|
67
68
|
|
|
68
69
|
@check_connection_response
|
|
@@ -340,7 +340,7 @@ class PostmanApiWrapper(BaseToolApiWrapper):
|
|
|
340
340
|
raise ToolException(
|
|
341
341
|
f"Invalid JSON response from Postman API: {str(e)}")
|
|
342
342
|
|
|
343
|
-
def _apply_authentication(self, headers, params, all_variables, resolve_variables):
|
|
343
|
+
def _apply_authentication(self, headers, params, all_variables, native_auth, resolve_variables):
|
|
344
344
|
"""Apply authentication based on environment_config auth settings.
|
|
345
345
|
|
|
346
346
|
Supports multiple authentication types:
|
|
@@ -363,14 +363,15 @@ class PostmanApiWrapper(BaseToolApiWrapper):
|
|
|
363
363
|
import base64
|
|
364
364
|
|
|
365
365
|
# Handle structured auth configuration only - no backward compatibility
|
|
366
|
-
auth_config = self.environment_config.get('auth')
|
|
366
|
+
auth_config = self.environment_config.get('auth', native_auth)
|
|
367
367
|
if auth_config and isinstance(auth_config, dict):
|
|
368
368
|
auth_type = auth_config.get('type', '').lower()
|
|
369
369
|
auth_params = auth_config.get('params', {})
|
|
370
370
|
|
|
371
371
|
if auth_type == 'bearer':
|
|
372
372
|
# Bearer token authentication
|
|
373
|
-
|
|
373
|
+
tokent_raw = auth_config.get('bearer', [{}])[0].get('value', '')
|
|
374
|
+
token = resolve_variables(str(tokent_raw))
|
|
374
375
|
if token:
|
|
375
376
|
headers['Authorization'] = f'Bearer {token}'
|
|
376
377
|
|
|
@@ -739,7 +740,7 @@ class PostmanApiWrapper(BaseToolApiWrapper):
|
|
|
739
740
|
all_variables = {}
|
|
740
741
|
|
|
741
742
|
# 1. Start with environment_config variables (lowest priority)
|
|
742
|
-
all_variables.update(self.
|
|
743
|
+
all_variables.update(self._get_variables_from_env_config())
|
|
743
744
|
|
|
744
745
|
# 2. Add collection variables
|
|
745
746
|
collection_variables = collection_data.get('variable', [])
|
|
@@ -760,8 +761,8 @@ class PostmanApiWrapper(BaseToolApiWrapper):
|
|
|
760
761
|
import re
|
|
761
762
|
def replace_var(match):
|
|
762
763
|
var_name = match.group(1)
|
|
763
|
-
value = all_variables.get(var_name,
|
|
764
|
-
return resolve_variables(value) if
|
|
764
|
+
value = all_variables.get(var_name, None)
|
|
765
|
+
return resolve_variables(str(value)) if value else match.group(0)
|
|
765
766
|
|
|
766
767
|
return re.sub(r'\{\{([^}]+)\}\}', replace_var, text)
|
|
767
768
|
|
|
@@ -792,7 +793,7 @@ class PostmanApiWrapper(BaseToolApiWrapper):
|
|
|
792
793
|
headers = {}
|
|
793
794
|
|
|
794
795
|
# Handle authentication from environment_config
|
|
795
|
-
self._apply_authentication(headers, params, all_variables, resolve_variables)
|
|
796
|
+
self._apply_authentication(headers, params, all_variables, request_data.get('auth', None), resolve_variables)
|
|
796
797
|
|
|
797
798
|
# Add headers from request
|
|
798
799
|
request_headers = request_data.get('header', [])
|
|
@@ -1641,7 +1642,7 @@ class PostmanApiWrapper(BaseToolApiWrapper):
|
|
|
1641
1642
|
|
|
1642
1643
|
# Find the request
|
|
1643
1644
|
request_item = self.analyzer.find_request_by_path(
|
|
1644
|
-
collection_data["item"], request_path)
|
|
1645
|
+
collection_data["item"], request_path, collection_data.get("auth", None))
|
|
1645
1646
|
if not request_item:
|
|
1646
1647
|
raise ToolException(f"Request '{request_path}' not found")
|
|
1647
1648
|
|
|
@@ -2162,3 +2163,12 @@ class PostmanApiWrapper(BaseToolApiWrapper):
|
|
|
2162
2163
|
parse_items(items)
|
|
2163
2164
|
|
|
2164
2165
|
return result
|
|
2166
|
+
|
|
2167
|
+
def _get_variables_from_env_config(self):
|
|
2168
|
+
"""Extracts all enabled variables from the 'values' field in environment_config."""
|
|
2169
|
+
result = {}
|
|
2170
|
+
values = self.environment_config.get("values", [])
|
|
2171
|
+
for var in values:
|
|
2172
|
+
if var.get("enabled", True) and "key" in var and "value" in var:
|
|
2173
|
+
result[var["key"]] = var["value"]
|
|
2174
|
+
return result
|
|
@@ -1049,13 +1049,14 @@ class PostmanAnalyzer:
|
|
|
1049
1049
|
find_in_items(items, path_parts)
|
|
1050
1050
|
return results
|
|
1051
1051
|
|
|
1052
|
-
def find_request_by_path(self, items: List[Dict], request_path: str) -> Optional[Dict]:
|
|
1052
|
+
def find_request_by_path(self, items: List[Dict], request_path: str, auth = None) -> Optional[Dict]:
|
|
1053
1053
|
"""Find a request by its path."""
|
|
1054
1054
|
path_parts = [part.strip() for part in request_path.split('/') if part.strip()]
|
|
1055
1055
|
if not path_parts:
|
|
1056
1056
|
return None
|
|
1057
1057
|
|
|
1058
1058
|
current_items = items
|
|
1059
|
+
current_auth = auth
|
|
1059
1060
|
|
|
1060
1061
|
# Navigate through folders to the request
|
|
1061
1062
|
for i, part in enumerate(path_parts):
|
|
@@ -1065,6 +1066,9 @@ class PostmanAnalyzer:
|
|
|
1065
1066
|
if i == len(path_parts) - 1:
|
|
1066
1067
|
# This should be the request
|
|
1067
1068
|
if item.get('request'):
|
|
1069
|
+
# if request has no auth, inherit from parent
|
|
1070
|
+
if not item['request'].get('auth') and current_auth:
|
|
1071
|
+
item['request']['auth'] = current_auth
|
|
1068
1072
|
return item
|
|
1069
1073
|
else:
|
|
1070
1074
|
return None
|
|
@@ -1072,6 +1076,9 @@ class PostmanAnalyzer:
|
|
|
1072
1076
|
# This should be a folder
|
|
1073
1077
|
if item.get('item'):
|
|
1074
1078
|
current_items = item['item']
|
|
1079
|
+
# Update current_auth if folder has auth
|
|
1080
|
+
if item.get('auth'):
|
|
1081
|
+
current_auth = item['auth']
|
|
1075
1082
|
found = True
|
|
1076
1083
|
break
|
|
1077
1084
|
else:
|
alita_sdk/tools/pptx/__init__.py
CHANGED
|
@@ -45,13 +45,13 @@ class PPTXToolkit(BaseToolkit):
|
|
|
45
45
|
|
|
46
46
|
return create_model(
|
|
47
47
|
name,
|
|
48
|
-
bucket_name=(str, Field(description="Bucket name where PPTX files are stored",
|
|
49
|
-
json_schema_extra={'toolkit_name': True, 'max_toolkit_length': TOOLKIT_MAX_LENGTH})),
|
|
48
|
+
bucket_name=(str, Field(description="Bucket name where PPTX files are stored")),
|
|
50
49
|
selected_tools=(List[Literal[tuple(selected_tools)]], Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
|
51
50
|
__config__=ConfigDict(json_schema_extra={
|
|
52
51
|
'metadata': {
|
|
53
52
|
"label": "PPTX",
|
|
54
53
|
"icon_url": "pptx.svg",
|
|
54
|
+
"max_length": TOOLKIT_MAX_LENGTH,
|
|
55
55
|
"categories": ["office"],
|
|
56
56
|
"extra_categories": ["presentation", "office automation", "document"]
|
|
57
57
|
}
|
|
@@ -37,14 +37,14 @@ class QtestToolkit(BaseToolkit):
|
|
|
37
37
|
name,
|
|
38
38
|
qtest_configuration=(QtestConfiguration, Field(description="QTest API token", json_schema_extra={
|
|
39
39
|
'configuration_types': ['qtest']})),
|
|
40
|
-
qtest_project_id=(int, Field(default=None, description="QTest project id",
|
|
41
|
-
'max_toolkit_length': QtestToolkit.toolkit_max_length})),
|
|
40
|
+
qtest_project_id=(int, Field(default=None, description="QTest project id")),
|
|
42
41
|
no_of_tests_shown_in_dql_search=(Optional[int], Field(description="Max number of items returned by dql search",
|
|
43
42
|
default=10)),
|
|
44
43
|
|
|
45
44
|
selected_tools=(List[Literal[tuple(selected_tools)]],
|
|
46
45
|
Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
|
47
46
|
__config__=ConfigDict(json_schema_extra={'metadata': {"label": "QTest", "icon_url": "qtest.svg",
|
|
47
|
+
"max_length": QtestToolkit.toolkit_max_length,
|
|
48
48
|
"categories": ["test management"],
|
|
49
49
|
"extra_categories": ["quality assurance",
|
|
50
50
|
"test case management",
|
|
@@ -93,4 +93,4 @@ class QtestToolkit(BaseToolkit):
|
|
|
93
93
|
return cls(tools=tools)
|
|
94
94
|
|
|
95
95
|
def get_tools(self):
|
|
96
|
-
return self.tools
|
|
96
|
+
return self.tools
|