alita-sdk 0.3.228__py3-none-any.whl → 0.3.229__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/configurations/__init__.py +66 -0
- alita_sdk/configurations/ado.py +41 -0
- alita_sdk/configurations/azure_search.py +21 -0
- alita_sdk/configurations/bigquery.py +23 -0
- alita_sdk/configurations/bitbucket.py +31 -0
- alita_sdk/configurations/confluence.py +36 -0
- alita_sdk/configurations/delta_lake.py +24 -0
- alita_sdk/configurations/github.py +45 -0
- alita_sdk/configurations/gitlab.py +31 -0
- alita_sdk/configurations/jira.py +36 -0
- alita_sdk/configurations/pgvector.py +18 -0
- alita_sdk/configurations/postman.py +30 -0
- alita_sdk/configurations/qtest.py +20 -0
- alita_sdk/configurations/service_now.py +31 -0
- alita_sdk/configurations/slack.py +35 -0
- alita_sdk/configurations/testrail.py +20 -0
- alita_sdk/runtime/toolkits/configurations.py +4 -0
- alita_sdk/tools/ado/repos/__init__.py +21 -30
- alita_sdk/tools/aws/delta_lake/__init__.py +9 -13
- alita_sdk/tools/azure_ai/search/__init__.py +9 -15
- alita_sdk/tools/bitbucket/__init__.py +8 -11
- alita_sdk/tools/confluence/__init__.py +20 -20
- alita_sdk/tools/github/__init__.py +22 -45
- alita_sdk/tools/gitlab/__init__.py +8 -8
- alita_sdk/tools/google/bigquery/__init__.py +5 -26
- alita_sdk/tools/jira/__init__.py +18 -18
- alita_sdk/tools/postman/__init__.py +5 -5
- alita_sdk/tools/qtest/__init__.py +3 -2
- alita_sdk/tools/servicenow/__init__.py +7 -5
- alita_sdk/tools/slack/__init__.py +6 -7
- alita_sdk/tools/testrail/__init__.py +8 -11
- {alita_sdk-0.3.228.dist-info → alita_sdk-0.3.229.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.228.dist-info → alita_sdk-0.3.229.dist-info}/RECORD +36 -19
- {alita_sdk-0.3.228.dist-info → alita_sdk-0.3.229.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.228.dist-info → alita_sdk-0.3.229.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.228.dist-info → alita_sdk-0.3.229.dist-info}/top_level.txt +0 -0
@@ -5,6 +5,7 @@ from typing import List, Optional, Type
|
|
5
5
|
from langchain_core.tools import BaseTool, BaseToolkit
|
6
6
|
from pydantic import BaseModel, Field, SecretStr, computed_field, field_validator
|
7
7
|
|
8
|
+
from alita_sdk.configurations.delta_lake import DeltaLakeConfiguration
|
8
9
|
from ...utils import TOOLKIT_SPLITTER, clean_string, get_max_toolkit_length
|
9
10
|
from .api_wrapper import DeltaLakeApiWrapper
|
10
11
|
from .tool import DeltaLakeAction
|
@@ -53,12 +54,7 @@ class DeltaLakeToolkitConfig(BaseModel):
|
|
53
54
|
}
|
54
55
|
}
|
55
56
|
|
56
|
-
|
57
|
-
aws_secret_access_key: Optional[SecretStr] = Field(default=None, description="AWS secret access key", json_schema_extra={"secret": True, "configuration": True})
|
58
|
-
aws_session_token: Optional[SecretStr] = Field(default=None, description="AWS session token (optional)", json_schema_extra={"secret": True, "configuration": True})
|
59
|
-
aws_region: Optional[str] = Field(default=None, description="AWS region for Delta Lake storage", json_schema_extra={"configuration": True})
|
60
|
-
s3_path: Optional[str] = Field(default=None, description="S3 path to Delta Lake data (e.g., s3://bucket/path)", json_schema_extra={"configuration": True, "configuration_title": True})
|
61
|
-
table_path: Optional[str] = Field(default=None, description="Delta Lake table path (if not using s3_path)", json_schema_extra={"configuration": True})
|
57
|
+
delta_lake_configuration: Optional[DeltaLakeConfiguration] = Field(description="Delta Lake Configuration", json_schema_extra={"configuration_types": ["delta_lake"]})
|
62
58
|
selected_tools: List[str] = Field(default=[], description="Selected tools", json_schema_extra={"args_schemas": get_available_tools()})
|
63
59
|
|
64
60
|
@field_validator("selected_tools", mode="before", check_fields=False)
|
@@ -69,12 +65,12 @@ class DeltaLakeToolkitConfig(BaseModel):
|
|
69
65
|
def _get_toolkit(tool) -> BaseToolkit:
|
70
66
|
return DeltaLakeToolkit().get_toolkit(
|
71
67
|
selected_tools=tool["settings"].get("selected_tools", []),
|
72
|
-
aws_access_key_id=tool["settings"].get("aws_access_key_id", None),
|
73
|
-
aws_secret_access_key=tool["settings"].get("aws_secret_access_key", None),
|
74
|
-
aws_session_token=tool["settings"].get("aws_session_token", None),
|
75
|
-
aws_region=tool["settings"].get("aws_region", None),
|
76
|
-
s3_path=tool["settings"].get("s3_path", None),
|
77
|
-
table_path=tool["settings"].get("table_path", None),
|
68
|
+
aws_access_key_id=tool["settings"].get("delta_lake_configuration").get("aws_access_key_id", None),
|
69
|
+
aws_secret_access_key=tool["settings"].get("delta_lake_configuration").get("aws_secret_access_key", None),
|
70
|
+
aws_session_token=tool["settings"].get("delta_lake_configuration").get("aws_session_token", None),
|
71
|
+
aws_region=tool["settings"].get("delta_lake_configuration").get("aws_region", None),
|
72
|
+
s3_path=tool["settings"].get("delta_lake_configuration").get("s3_path", None),
|
73
|
+
table_path=tool["settings"].get("delta_lake_configuration").get("table_path", None),
|
78
74
|
toolkit_name=tool.get("toolkit_name"),
|
79
75
|
)
|
80
76
|
|
@@ -103,9 +99,9 @@ class DeltaLakeToolkit(BaseToolkit):
|
|
103
99
|
def available_tools(self) -> List[dict]:
|
104
100
|
return self.api_wrapper.get_available_tools()
|
105
101
|
|
106
|
-
@staticmethod
|
107
102
|
def toolkit_config_schema() -> Type[BaseModel]:
|
108
103
|
return DeltaLakeToolkitConfig
|
104
|
+
return m
|
109
105
|
|
110
106
|
@classmethod
|
111
107
|
def get_toolkit(
|
@@ -3,8 +3,9 @@ from typing import List, Optional, Literal
|
|
3
3
|
from .api_wrapper import AzureSearchApiWrapper
|
4
4
|
from ...base.tool import BaseAction
|
5
5
|
from langchain_core.tools import BaseToolkit, BaseTool
|
6
|
-
from pydantic import create_model, BaseModel, ConfigDict, Field
|
6
|
+
from pydantic import create_model, BaseModel, ConfigDict, Field
|
7
7
|
from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length, check_connection_response
|
8
|
+
from ....configurations.azure_search import AzureSearchConfiguration
|
8
9
|
import requests
|
9
10
|
|
10
11
|
logger = getLogger(__name__)
|
@@ -14,10 +15,10 @@ name = "azure_search"
|
|
14
15
|
def get_tools(tool):
|
15
16
|
return AzureSearchToolkit().get_toolkit(
|
16
17
|
selected_tools=tool['settings'].get('selected_tools', []),
|
17
|
-
api_key=tool['settings'].get('api_key', None),
|
18
|
-
endpoint=tool['settings'].get('endpoint', None),
|
18
|
+
api_key=tool['settings'].get('azure_search_configuration', {}).get('api_key', None),
|
19
|
+
endpoint=tool['settings'].get('azure_search_configuration', {}).get('endpoint', None),
|
19
20
|
index_name=tool['settings'].get('index_name', None),
|
20
|
-
api_base=tool['settings'].get('api_base', None),
|
21
|
+
api_base=tool['settings'].get('azure_search_configuration', {}).get('api_base', None),
|
21
22
|
api_version=tool['settings'].get('api_version', None),
|
22
23
|
openai_api_key=tool['settings'].get('access_token', None),
|
23
24
|
model_name=tool['settings'].get('model_name', None),
|
@@ -38,18 +39,11 @@ class AzureSearchToolkit(BaseToolkit):
|
|
38
39
|
AzureSearchToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
39
40
|
m = create_model(
|
40
41
|
name,
|
41
|
-
api_key=(SecretStr, Field(description="API key", json_schema_extra={'secret': True, 'configuration': True})),
|
42
|
-
endpoint=(str, Field(title="Azure Search endpoint",
|
43
|
-
description="Azure Search endpoint",
|
44
|
-
json_schema_extra={
|
45
|
-
'configuration': True,
|
46
|
-
"configuration_title": True
|
47
|
-
})),
|
48
42
|
index_name=(str, Field(description="Azure Search index name")),
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
43
|
+
azure_search_configuration=(
|
44
|
+
Optional[AzureSearchConfiguration],
|
45
|
+
Field(description="Azure Search Configuration", json_schema_extra={'configuration_types': ['azure_search']})
|
46
|
+
),
|
53
47
|
api_version=(Optional[str], Field(description="API version", default=None)),
|
54
48
|
openai_api_key=(Optional[str], Field(description="Azure OpenAI API Key", default=None, json_schema_extra={'secret': True})),
|
55
49
|
model_name=(str, Field(description="Model name for Embeddings model", default=None)),
|
@@ -6,8 +6,10 @@ from .api_wrapper import BitbucketAPIWrapper
|
|
6
6
|
from .tools import __all__
|
7
7
|
from langchain_core.tools import BaseToolkit
|
8
8
|
from langchain_core.tools import BaseTool
|
9
|
-
from pydantic import BaseModel, Field, ConfigDict, create_model
|
9
|
+
from pydantic import BaseModel, Field, ConfigDict, create_model
|
10
10
|
from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length, check_connection_response
|
11
|
+
from ...configurations.bitbucket import BitbucketConfiguration
|
12
|
+
from ...configurations.pgvector import PgVectorConfiguration
|
11
13
|
import requests
|
12
14
|
|
13
15
|
|
@@ -20,13 +22,13 @@ def get_tools(tool):
|
|
20
22
|
url=tool['settings']['url'],
|
21
23
|
project=tool['settings']['project'],
|
22
24
|
repository=tool['settings']['repository'],
|
23
|
-
username=tool['settings']
|
24
|
-
password=tool['settings']
|
25
|
+
username=tool['settings'].get('bitbucket_configuration', {}).get('username', ''),
|
26
|
+
password=tool['settings'].get('bitbucket_configuration', {}).get('password', ''),
|
25
27
|
branch=tool['settings']['branch'],
|
26
28
|
cloud=tool['settings'].get('cloud'),
|
27
29
|
llm=tool['settings'].get('llm', None),
|
28
30
|
alita=tool['settings'].get('alita', None),
|
29
|
-
connection_string=tool['settings'].get('connection_string', None),
|
31
|
+
connection_string=tool['settings'].get('pgvector_configuration', {}).get('connection_string', None),
|
30
32
|
collection_name=str(tool['toolkit_name']),
|
31
33
|
doctype='code',
|
32
34
|
embedding_model="HuggingFaceEmbeddings",
|
@@ -53,14 +55,9 @@ class AlitaBitbucketToolkit(BaseToolkit):
|
|
53
55
|
project=(str, Field(description="Project/Workspace", json_schema_extra={'configuration': True})),
|
54
56
|
repository=(str, Field(description="Repository", json_schema_extra={'max_toolkit_length': AlitaBitbucketToolkit.toolkit_max_length, 'configuration': True})),
|
55
57
|
branch=(str, Field(description="Main branch", default="main")),
|
56
|
-
username=(str, Field(description="Username", json_schema_extra={'configuration': True})),
|
57
|
-
password=(SecretStr, Field(description="GitLab private token", json_schema_extra={'secret': True, 'configuration': True})),
|
58
58
|
cloud=(Optional[bool], Field(description="Hosting Option", default=None)),
|
59
|
-
|
60
|
-
|
61
|
-
default=None,
|
62
|
-
json_schema_extra={'secret': True})),
|
63
|
-
|
59
|
+
bitbucket_configuration=(Optional[BitbucketConfiguration], Field(description="Bitbucket Configuration", json_schema_extra={'configuration_types': ['bitbucket']})),
|
60
|
+
pgvector_configuration=(Optional[PgVectorConfiguration], Field(description="PgVector Configuration", default={'configuration_types': ['pgvector']})),
|
64
61
|
# embedder settings
|
65
62
|
embedding_model=(str, Field(description="Embedding model: i.e. 'HuggingFaceEmbeddings', etc.", default="HuggingFaceEmbeddings")),
|
66
63
|
embedding_model_params=(dict, Field(description="Embedding model parameters: i.e. `{'model_name': 'sentence-transformers/all-MiniLM-L6-v2'}", default={"model_name": "sentence-transformers/all-MiniLM-L6-v2"})),
|
@@ -3,8 +3,10 @@ from langchain_community.agent_toolkits.base import BaseToolkit
|
|
3
3
|
from .api_wrapper import ConfluenceAPIWrapper
|
4
4
|
from langchain_core.tools import BaseTool
|
5
5
|
from ..base.tool import BaseAction
|
6
|
-
from pydantic import create_model, BaseModel, ConfigDict, Field
|
6
|
+
from pydantic import create_model, BaseModel, ConfigDict, Field
|
7
7
|
from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length, parse_list, check_connection_response
|
8
|
+
from ...configurations.confluence import ConfluenceConfiguration
|
9
|
+
from ...configurations.pgvector import PgVectorConfiguration
|
8
10
|
import requests
|
9
11
|
|
10
12
|
name = "confluence"
|
@@ -15,9 +17,9 @@ def get_tools(tool):
|
|
15
17
|
base_url=tool['settings']['base_url'],
|
16
18
|
space=tool['settings'].get('space', None),
|
17
19
|
cloud=tool['settings'].get('cloud', True),
|
18
|
-
api_key=tool['settings'].get('api_key', None),
|
19
|
-
username=tool['settings'].get('username', None),
|
20
|
-
token=tool['settings'].get('token', None),
|
20
|
+
api_key=tool['settings'].get('confluence_configuration', {}).get('api_key', None),
|
21
|
+
username=tool['settings'].get('confluence_configuration', {}).get('username', None),
|
22
|
+
token=tool['settings'].get('confluence_configuration', {}).get('token', None),
|
21
23
|
limit=tool['settings'].get('limit', 5),
|
22
24
|
labels=parse_list(tool['settings'].get('labels', None)),
|
23
25
|
additional_fields=tool['settings'].get('additional_fields', []),
|
@@ -26,7 +28,7 @@ def get_tools(tool):
|
|
26
28
|
llm=tool['settings'].get('llm', None),
|
27
29
|
toolkit_name=tool.get('toolkit_name'),
|
28
30
|
# indexer settings
|
29
|
-
connection_string = tool['settings'].get('connection_string', None),
|
31
|
+
connection_string = tool['settings'].get('pgvector_configuration', {}).get('connection_string', None),
|
30
32
|
collection_name=str(tool['toolkit_name']),
|
31
33
|
doctype='doc',
|
32
34
|
embedding_model="HuggingFaceEmbeddings",
|
@@ -50,10 +52,15 @@ class ConfluenceToolkit(BaseToolkit):
|
|
50
52
|
url = self.base_url.rstrip('/') + '/wiki/rest/api/space'
|
51
53
|
headers = {'Accept': 'application/json'}
|
52
54
|
auth = None
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
confluence_config = self.confluence_configuration or {}
|
56
|
+
token = confluence_config.get('token')
|
57
|
+
username = confluence_config.get('username')
|
58
|
+
api_key = confluence_config.get('api_key')
|
59
|
+
|
60
|
+
if token:
|
61
|
+
headers['Authorization'] = f'Bearer {token}'
|
62
|
+
elif username and api_key:
|
63
|
+
auth = (username, api_key)
|
57
64
|
else:
|
58
65
|
raise ValueError('Confluence connection requires either token or username+api_key')
|
59
66
|
response = requests.get(url, headers=headers, auth=auth, timeout=5, verify=getattr(self, 'verify_ssl', True))
|
@@ -62,9 +69,6 @@ class ConfluenceToolkit(BaseToolkit):
|
|
62
69
|
model = create_model(
|
63
70
|
name,
|
64
71
|
base_url=(str, Field(description="Confluence URL", json_schema_extra={'configuration': True, 'configuration_title': True})),
|
65
|
-
token=(SecretStr, Field(description="Token", default=None, json_schema_extra={'secret': True, 'configuration': True})),
|
66
|
-
api_key=(SecretStr, Field(description="API key", default=None, json_schema_extra={'secret': True, 'configuration': True})),
|
67
|
-
username=(str, Field(description="Username", default=None, json_schema_extra={'configuration': True})),
|
68
72
|
space=(str, Field(description="Space", json_schema_extra={'toolkit_name': True,
|
69
73
|
'max_toolkit_length': ConfluenceToolkit.toolkit_max_length})),
|
70
74
|
cloud=(bool, Field(description="Hosting Option", json_schema_extra={'configuration': True})),
|
@@ -78,17 +82,13 @@ class ConfluenceToolkit(BaseToolkit):
|
|
78
82
|
number_of_retries=(int, Field(description="Number of retries", default=2)),
|
79
83
|
min_retry_seconds=(int, Field(description="Min retry, sec", default=10)),
|
80
84
|
max_retry_seconds=(int, Field(description="Max retry, sec", default=60)),
|
81
|
-
|
82
|
-
|
83
|
-
# indexer settings
|
84
|
-
connection_string = (Optional[SecretStr], Field(description="Connection string for vectorstore",
|
85
|
-
default=None,
|
86
|
-
json_schema_extra={'secret': True})),
|
87
|
-
|
88
|
-
# embedder settings
|
85
|
+
confluence_configuration=(Optional[ConfluenceConfiguration], Field(description="Confluence Configuration", json_schema_extra={'configuration_types': ['confluence']})),
|
86
|
+
pgvector_configuration=(Optional[PgVectorConfiguration], Field(description="PgVector Configuration", json_schema_extra={'configuration_types': ['pgvector']})),
|
89
87
|
embedding_model=(str, Field(description="Embedding model: i.e. 'HuggingFaceEmbeddings', etc.", default="HuggingFaceEmbeddings")),
|
90
88
|
embedding_model_params=(dict, Field(description="Embedding model parameters: i.e. `{'model_name': 'sentence-transformers/all-MiniLM-L6-v2'}", default={"model_name": "sentence-transformers/all-MiniLM-L6-v2"})),
|
91
89
|
|
90
|
+
selected_tools=(List[Literal[tuple(selected_tools)]],
|
91
|
+
Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
92
92
|
__config__=ConfigDict(json_schema_extra={
|
93
93
|
'metadata': {
|
94
94
|
"label": "Confluence",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Dict, List, Optional, Literal
|
1
|
+
from typing import Dict, List, Optional, Literal
|
2
2
|
|
3
3
|
from langchain_core.tools import BaseTool, BaseToolkit
|
4
4
|
from pydantic import create_model, BaseModel, ConfigDict, Field, SecretStr
|
@@ -7,6 +7,8 @@ from .api_wrapper import AlitaGitHubAPIWrapper
|
|
7
7
|
from .tool import GitHubAction
|
8
8
|
|
9
9
|
from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
|
10
|
+
from ...configurations.github import GithubConfiguration
|
11
|
+
from ...configurations.pgvector import PgVectorConfiguration
|
10
12
|
|
11
13
|
name = "github"
|
12
14
|
|
@@ -17,14 +19,14 @@ def _get_toolkit(tool) -> BaseToolkit:
|
|
17
19
|
github_repository=tool['settings']['repository'],
|
18
20
|
active_branch=tool['settings']['active_branch'],
|
19
21
|
github_base_branch=tool['settings']['base_branch'],
|
20
|
-
github_access_token=tool['settings'].get('access_token', ''),
|
21
|
-
github_username=tool['settings'].get('username', ''),
|
22
|
-
github_password=tool['settings'].get('password', ''),
|
23
|
-
github_app_id=tool['settings'].get('app_id', None),
|
24
|
-
github_app_private_key=tool['settings'].get('app_private_key', None),
|
22
|
+
github_access_token=tool['settings'].get('github_configuration', {}).get('access_token', ''),
|
23
|
+
github_username=tool['settings'].get('github_configuration', {}).get('username', ''),
|
24
|
+
github_password=tool['settings'].get('github_configuration', {}).get('password', ''),
|
25
|
+
github_app_id=tool['settings'].get('github_configuration', {}).get('app_id', None),
|
26
|
+
github_app_private_key=tool['settings'].get('github_configuration', {}).get('app_private_key', None),
|
25
27
|
llm=tool['settings'].get('llm', None),
|
26
28
|
alita=tool['settings'].get('alita', None),
|
27
|
-
connection_string=tool['settings'].get('connection_string', None),
|
29
|
+
connection_string=tool['settings'].get('pgvector_configuration', {}).get('connection_string', None),
|
28
30
|
collection_name=str(tool['toolkit_name']),
|
29
31
|
doctype='code',
|
30
32
|
embedding_model="HuggingFaceEmbeddings",
|
@@ -45,7 +47,8 @@ class AlitaGitHubToolkit(BaseToolkit):
|
|
45
47
|
|
46
48
|
@staticmethod
|
47
49
|
def toolkit_config_schema() -> BaseModel:
|
48
|
-
selected_tools = {x['name']: x['args_schema'].schema() for x in
|
50
|
+
selected_tools = {x['name']: x['args_schema'].schema() for x in
|
51
|
+
AlitaGitHubAPIWrapper.model_construct().get_available_tools()}
|
49
52
|
AlitaGitHubToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
|
50
53
|
return create_model(
|
51
54
|
name,
|
@@ -54,53 +57,27 @@ class AlitaGitHubToolkit(BaseToolkit):
|
|
54
57
|
'metadata': {
|
55
58
|
"label": "GitHub",
|
56
59
|
"icon_url": None,
|
57
|
-
"sections": {
|
58
|
-
"auth": {
|
59
|
-
"required": False,
|
60
|
-
"subsections": [
|
61
|
-
{
|
62
|
-
"name": "Token",
|
63
|
-
"fields": ["access_token"]
|
64
|
-
},
|
65
|
-
{
|
66
|
-
"name": "Password",
|
67
|
-
"fields": ["username", "password"]
|
68
|
-
},
|
69
|
-
{
|
70
|
-
"name": "App private key",
|
71
|
-
"fields": ["app_id", "app_private_key"]
|
72
|
-
}
|
73
|
-
]
|
74
|
-
},
|
75
|
-
},
|
76
60
|
"categories": ["code repositories"],
|
77
61
|
"extra_categories": ["github", "git", "repository", "code", "version control"],
|
78
62
|
},
|
79
63
|
}
|
80
64
|
),
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
username=(Optional[str], Field(description="Github Username", default=None, json_schema_extra={'configuration': True})),
|
88
|
-
password=(Optional[SecretStr], Field(description="Github Password", default=None, json_schema_extra={'secret': True, 'configuration': True})),
|
89
|
-
|
90
|
-
repository=(str, Field(description="Github repository", json_schema_extra={'toolkit_name': True, 'max_toolkit_length': AlitaGitHubToolkit.toolkit_max_length})),
|
65
|
+
github_configuration=(Optional[GithubConfiguration], Field(description="Github configuration", default=None,
|
66
|
+
json_schema_extra={'configuration_types': ['github']})),
|
67
|
+
pgvector_configuration=(Optional[PgVectorConfiguration], Field(description="PgVector configuration", default=None,
|
68
|
+
json_schema_extra={'configuration_types': ['pgvector']})),
|
69
|
+
repository=(str, Field(description="Github repository", json_schema_extra={'toolkit_name': True,
|
70
|
+
'max_toolkit_length': AlitaGitHubToolkit.toolkit_max_length})),
|
91
71
|
active_branch=(Optional[str], Field(description="Active branch", default="main")),
|
92
72
|
base_branch=(Optional[str], Field(description="Github Base branch", default="main")),
|
93
|
-
|
94
73
|
# indexer settings
|
95
|
-
connection_string
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
# embedder settings
|
74
|
+
connection_string=(Optional[SecretStr], Field(description="Connection string for vectorstore",
|
75
|
+
default=None,
|
76
|
+
json_schema_extra={'secret': True})),
|
100
77
|
embedding_model=(str, Field(description="Embedding model: i.e. 'HuggingFaceEmbeddings', etc.", default="HuggingFaceEmbeddings")),
|
101
78
|
embedding_model_params=(dict, Field(description="Embedding model parameters: i.e. `{'model_name': 'sentence-transformers/all-MiniLM-L6-v2'}", default={"model_name": "sentence-transformers/all-MiniLM-L6-v2"})),
|
102
|
-
|
103
|
-
|
79
|
+
selected_tools=(List[Literal[tuple(selected_tools)]],
|
80
|
+
Field(default=[], json_schema_extra={'args_schemas': selected_tools}))
|
104
81
|
)
|
105
82
|
|
106
83
|
@classmethod
|
@@ -3,11 +3,13 @@ from typing import Dict, List, Literal, Optional
|
|
3
3
|
from alita_sdk.tools.base.tool import BaseAction
|
4
4
|
from langchain_core.tools import BaseTool
|
5
5
|
from langchain_core.tools import BaseToolkit
|
6
|
-
from pydantic import create_model, BaseModel, ConfigDict
|
6
|
+
from pydantic import create_model, BaseModel, ConfigDict
|
7
7
|
from pydantic.fields import Field
|
8
8
|
|
9
9
|
from .api_wrapper import GitLabAPIWrapper
|
10
10
|
from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
|
11
|
+
from ...configurations.gitlab import GitlabConfiguration
|
12
|
+
from ...configurations.pgvector import PgVectorConfiguration
|
11
13
|
|
12
14
|
name = "gitlab"
|
13
15
|
|
@@ -18,11 +20,11 @@ def get_tools(tool):
|
|
18
20
|
url=tool['settings']['url'],
|
19
21
|
repository=tool['settings']['repository'],
|
20
22
|
branch=tool['settings']['branch'],
|
21
|
-
private_token=tool['settings']
|
23
|
+
private_token=tool['settings'].get('gitlab_configuration', {}).get('private_token', ''),
|
22
24
|
|
23
25
|
llm=tool['settings'].get('llm', None),
|
24
26
|
alita=tool['settings'].get('alita', None),
|
25
|
-
connection_string=tool['settings'].get('connection_string', None),
|
27
|
+
connection_string=tool['settings'].get('pgvector_configuration', {}).get('connection_string', None),
|
26
28
|
collection_name=str(tool['toolkit_name']),
|
27
29
|
doctype='code',
|
28
30
|
embedding_model="HuggingFaceEmbeddings",
|
@@ -44,13 +46,11 @@ class AlitaGitlabToolkit(BaseToolkit):
|
|
44
46
|
name,
|
45
47
|
url=(str, Field(description="GitLab URL", json_schema_extra={'configuration': True, 'configuration_title': True})),
|
46
48
|
repository=(str, Field(description="GitLab repository", json_schema_extra={'toolkit_name': True, 'max_toolkit_length': AlitaGitlabToolkit.toolkit_max_length})),
|
47
|
-
|
49
|
+
gitlab_configuration=(Optional[GitlabConfiguration], Field(description="GitLab configuration", json_schema_extra={'configuration_types': ['gitlab']})),
|
48
50
|
branch=(str, Field(description="Main branch", default="main")),
|
49
51
|
# indexer settings
|
50
|
-
|
51
|
-
|
52
|
-
json_schema_extra={'secret': True})),
|
53
|
-
|
52
|
+
pgvector_configuration=(Optional[PgVectorConfiguration], Field(description="PgVector configuration", default=None,
|
53
|
+
json_schema_extra={'configuration_types': ['pgvector']})),
|
54
54
|
# embedder settings
|
55
55
|
embedding_model=(str, Field(description="Embedding model: i.e. 'HuggingFaceEmbeddings', etc.", default="HuggingFaceEmbeddings")),
|
56
56
|
embedding_model_params=(dict, Field(description="Embedding model parameters: i.e. `{'model_name': 'sentence-transformers/all-MiniLM-L6-v2'}", default={"model_name": "sentence-transformers/all-MiniLM-L6-v2"})),
|
@@ -2,8 +2,9 @@ from functools import lru_cache
|
|
2
2
|
from typing import List, Optional, Type
|
3
3
|
|
4
4
|
from langchain_core.tools import BaseTool, BaseToolkit
|
5
|
-
from pydantic import BaseModel, Field,
|
5
|
+
from pydantic import BaseModel, Field, computed_field, field_validator
|
6
6
|
|
7
|
+
from ....configurations.bigquery import BigQueryConfiguration
|
7
8
|
from ...utils import TOOLKIT_SPLITTER, clean_string, get_max_toolkit_length
|
8
9
|
from .api_wrapper import BigQueryApiWrapper
|
9
10
|
from .tool import BigQueryAction
|
@@ -45,30 +46,8 @@ class BigQueryToolkitConfig(BaseModel):
|
|
45
46
|
}
|
46
47
|
}
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
description="GCP API key",
|
51
|
-
json_schema_extra={"secret": True, "configuration": True},
|
52
|
-
)
|
53
|
-
project: Optional[str] = Field(
|
54
|
-
default=None,
|
55
|
-
description="BigQuery project ID",
|
56
|
-
json_schema_extra={"configuration": True},
|
57
|
-
)
|
58
|
-
location: Optional[str] = Field(
|
59
|
-
default=None,
|
60
|
-
description="BigQuery location",
|
61
|
-
json_schema_extra={"configuration": True},
|
62
|
-
)
|
63
|
-
dataset: Optional[str] = Field(
|
64
|
-
default=None,
|
65
|
-
description="BigQuery dataset name",
|
66
|
-
json_schema_extra={"configuration": True, "configuration_title": True},
|
67
|
-
)
|
68
|
-
table: Optional[str] = Field(
|
69
|
-
default=None,
|
70
|
-
description="BigQuery table name",
|
71
|
-
json_schema_extra={"configuration": True},
|
49
|
+
bigquery_configuration: Optional[BigQueryConfiguration] = Field(
|
50
|
+
description="BigQuery configuration", json_schema_extra={"configuration_types": ["bigquery"]}
|
72
51
|
)
|
73
52
|
selected_tools: List[str] = Field(
|
74
53
|
default=[],
|
@@ -85,7 +64,7 @@ class BigQueryToolkitConfig(BaseModel):
|
|
85
64
|
def _get_toolkit(tool) -> BaseToolkit:
|
86
65
|
return BigQueryToolkit().get_toolkit(
|
87
66
|
selected_tools=tool["settings"].get("selected_tools", []),
|
88
|
-
api_key=tool["settings"].get("api_key", ""),
|
67
|
+
api_key=tool["settings"].get('bigquery_configuration').get("api_key", ""),
|
89
68
|
toolkit_name=tool.get("toolkit_name"),
|
90
69
|
)
|
91
70
|
|
alita_sdk/tools/jira/__init__.py
CHANGED
@@ -2,10 +2,12 @@ from typing import List, Optional, Literal
|
|
2
2
|
from .api_wrapper import JiraApiWrapper
|
3
3
|
from langchain_core.tools import BaseTool, BaseToolkit
|
4
4
|
from ..base.tool import BaseAction
|
5
|
-
from pydantic import create_model, BaseModel, ConfigDict, Field
|
5
|
+
from pydantic import create_model, BaseModel, ConfigDict, Field
|
6
6
|
import requests
|
7
7
|
|
8
8
|
from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length, parse_list, check_connection_response
|
9
|
+
from ...configurations.jira import JiraConfiguration
|
10
|
+
from ...configurations.pgvector import PgVectorConfiguration
|
9
11
|
|
10
12
|
name = "jira"
|
11
13
|
|
@@ -14,9 +16,9 @@ def get_tools(tool):
|
|
14
16
|
selected_tools=tool['settings'].get('selected_tools', []),
|
15
17
|
base_url=tool['settings'].get('base_url'),
|
16
18
|
cloud=tool['settings'].get('cloud', True),
|
17
|
-
api_key=tool['settings'].get('api_key', None),
|
18
|
-
username=tool['settings'].get('username', None),
|
19
|
-
token=tool['settings'].get('token', None),
|
19
|
+
api_key=tool['settings'].get('jira_configuration', {}).get('api_key', None),
|
20
|
+
username=tool['settings'].get('jira_configuration', {}).get('username', None),
|
21
|
+
token=tool['settings'].get('jira_configuration', {}).get('token', None),
|
20
22
|
limit=tool['settings'].get('limit', 5),
|
21
23
|
labels=parse_list(tool['settings'].get('labels', [])),
|
22
24
|
additional_fields=tool['settings'].get('additional_fields', []),
|
@@ -24,7 +26,7 @@ def get_tools(tool):
|
|
24
26
|
# indexer settings
|
25
27
|
llm=tool['settings'].get('llm', None),
|
26
28
|
alita=tool['settings'].get('alita', None),
|
27
|
-
connection_string=tool['settings'].get('connection_string', None),
|
29
|
+
connection_string=tool['settings'].get('pgvector_configuration', {}).get('connection_string', None),
|
28
30
|
collection_name=str(tool['toolkit_name']),
|
29
31
|
embedding_model="HuggingFaceEmbeddings",
|
30
32
|
embedding_model_params={"model_name": "sentence-transformers/all-MiniLM-L6-v2"},
|
@@ -47,10 +49,15 @@ class JiraToolkit(BaseToolkit):
|
|
47
49
|
url = self.base_url.rstrip('/') + '/rest/api/2/myself'
|
48
50
|
headers = {'Accept': 'application/json'}
|
49
51
|
auth = None
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
52
|
+
jira_config = self.jira_configuration or {}
|
53
|
+
token = jira_config.get('token')
|
54
|
+
username = jira_config.get('username')
|
55
|
+
api_key = jira_config.get('api_key')
|
56
|
+
|
57
|
+
if token:
|
58
|
+
headers['Authorization'] = f'Bearer {token}'
|
59
|
+
elif username and api_key:
|
60
|
+
auth = (username, api_key)
|
54
61
|
else:
|
55
62
|
raise ValueError('Jira connection requires either token or username+api_key')
|
56
63
|
response = requests.get(url, headers=headers, auth=auth, timeout=5, verify=getattr(self, 'verify_ssl', True))
|
@@ -70,9 +77,6 @@ class JiraToolkit(BaseToolkit):
|
|
70
77
|
)
|
71
78
|
),
|
72
79
|
cloud=(bool, Field(description="Hosting Option", json_schema_extra={'configuration': True})),
|
73
|
-
api_key=(Optional[SecretStr], Field(description="API key", default=None, json_schema_extra={'secret': True, 'configuration': True})),
|
74
|
-
username=(Optional[str], Field(description="Jira Username", default=None, json_schema_extra={'configuration': True})),
|
75
|
-
token=(Optional[SecretStr], Field(description="Jira token", default=None, json_schema_extra={'secret': True, 'configuration': True})),
|
76
80
|
limit=(int, Field(description="Limit issues")),
|
77
81
|
labels=(Optional[str], Field(
|
78
82
|
description="List of comma separated labels used for labeling of agent's created or updated entities",
|
@@ -81,12 +85,8 @@ class JiraToolkit(BaseToolkit):
|
|
81
85
|
)),
|
82
86
|
verify_ssl=(bool, Field(description="Verify SSL", default=True)),
|
83
87
|
additional_fields=(Optional[str], Field(description="Additional fields", default="")),
|
84
|
-
|
85
|
-
|
86
|
-
connection_string=(Optional[SecretStr], Field(description="Connection string for vectorstore",
|
87
|
-
default=None,
|
88
|
-
json_schema_extra={'secret': True})),
|
89
|
-
|
88
|
+
jira_configuration=(Optional[JiraConfiguration], Field(description="Jira Configuration", json_schema_extra={'configuration_types': ['jira']})),
|
89
|
+
pgvector_configuration=(Optional[PgVectorConfiguration], Field(description="PgVector Configuration", json_schema_extra={'configuration_types': ['pgvector']})),
|
90
90
|
# embedder settings
|
91
91
|
embedding_model=(str, Field(description="Embedding model: i.e. 'HuggingFaceEmbeddings', etc.", default="HuggingFaceEmbeddings")),
|
92
92
|
embedding_model_params=(dict, Field(description="Embedding model parameters: i.e. `{'model_name': 'sentence-transformers/all-MiniLM-L6-v2'}", default={"model_name": "sentence-transformers/all-MiniLM-L6-v2"})),
|
@@ -1,13 +1,13 @@
|
|
1
1
|
from typing import List, Literal, Optional, Type
|
2
|
-
import json
|
3
2
|
|
4
3
|
import requests
|
5
4
|
from langchain_core.tools import BaseToolkit, BaseTool
|
6
|
-
from pydantic import create_model, BaseModel, ConfigDict, Field,
|
5
|
+
from pydantic import create_model, BaseModel, ConfigDict, Field, field_validator
|
7
6
|
from ..base.tool import BaseAction
|
8
7
|
|
9
8
|
from .api_wrapper import PostmanApiWrapper
|
10
9
|
from ..utils import clean_string, get_max_toolkit_length, TOOLKIT_SPLITTER, check_connection_response
|
10
|
+
from ...configurations.postman import PostmanConfiguration
|
11
11
|
|
12
12
|
name = "postman"
|
13
13
|
|
@@ -30,7 +30,7 @@ def get_tools(tool):
|
|
30
30
|
environment_config = tool['settings'].get('environment_config', {})
|
31
31
|
toolkit = PostmanToolkit.get_toolkit(
|
32
32
|
selected_tools=tool['settings'].get('selected_tools', []),
|
33
|
-
api_key=tool['settings'].get('api_key', None),
|
33
|
+
api_key=tool['settings'].get('postman_configuration', {}).get('api_key', None),
|
34
34
|
base_url=tool['settings'].get(
|
35
35
|
'base_url', 'https://api.getpostman.com'),
|
36
36
|
collection_id=tool['settings'].get('collection_id', None),
|
@@ -53,8 +53,8 @@ class PostmanToolkit(BaseToolkit):
|
|
53
53
|
selected_tools)
|
54
54
|
m = create_model(
|
55
55
|
name,
|
56
|
-
|
57
|
-
|
56
|
+
postman_configuration=(Optional[PostmanConfiguration], Field(description="Postman Configuration",
|
57
|
+
json_schema_extra={'configuration_types': ['postman']})),
|
58
58
|
base_url=(str, Field(description="Postman API base URL",
|
59
59
|
default="https://api.getpostman.com", json_schema_extra={'configuration': True})),
|
60
60
|
collection_id=(str, Field(description="Default collection ID", json_schema_extra={
|
@@ -7,6 +7,7 @@ from pydantic import create_model, BaseModel, ConfigDict, Field, SecretStr
|
|
7
7
|
from .api_wrapper import QtestApiWrapper
|
8
8
|
from .tool import QtestAction
|
9
9
|
from ..utils import clean_string, get_max_toolkit_length, TOOLKIT_SPLITTER, check_connection_response
|
10
|
+
from ...configurations.qtest import QtestConfiguration
|
10
11
|
|
11
12
|
name = "qtest"
|
12
13
|
|
@@ -16,7 +17,7 @@ def get_tools(tool):
|
|
16
17
|
selected_tools=tool['settings'].get('selected_tools', []),
|
17
18
|
base_url=tool['settings'].get('base_url', None),
|
18
19
|
qtest_project_id=tool['settings'].get('qtest_project_id', tool['settings'].get('project_id', None)),
|
19
|
-
qtest_api_token=tool['settings'].get('qtest_api_token', None),
|
20
|
+
qtest_api_token=tool['settings'].get('qtest_configuration', {}).get('qtest_api_token', None),
|
20
21
|
toolkit_name=tool.get('toolkit_name')
|
21
22
|
)
|
22
23
|
return toolkit.tools
|
@@ -34,7 +35,7 @@ class QtestToolkit(BaseToolkit):
|
|
34
35
|
name,
|
35
36
|
base_url=(str, Field(description="QTest base url", json_schema_extra={'configuration': True, 'configuration_title': True})),
|
36
37
|
qtest_project_id=(int, Field(description="QTest project id", json_schema_extra={'toolkit_name': True, 'max_toolkit_length': QtestToolkit.toolkit_max_length})),
|
37
|
-
|
38
|
+
qtest_configuration=(Optional[QtestConfiguration], Field(description="QTest API token", json_schema_extra={'configuration_types': ['qtest']})),
|
38
39
|
selected_tools=(List[Literal[tuple(selected_tools)]], Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
39
40
|
__config__=ConfigDict(json_schema_extra={'metadata': {"label": "QTest", "icon_url": "qtest.svg",
|
40
41
|
"categories": ["test management"],
|
@@ -4,8 +4,10 @@ from langchain_community.agent_toolkits.base import BaseToolkit
|
|
4
4
|
from .api_wrapper import ServiceNowAPIWrapper
|
5
5
|
from langchain_core.tools import BaseTool
|
6
6
|
from ..base.tool import BaseAction
|
7
|
-
from pydantic import create_model, BaseModel, ConfigDict, Field
|
7
|
+
from pydantic import create_model, BaseModel, ConfigDict, Field
|
8
8
|
from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
|
9
|
+
from ...configurations.service_now import ServiceNowConfiguration
|
10
|
+
|
9
11
|
|
10
12
|
name = "service_now"
|
11
13
|
|
@@ -14,8 +16,8 @@ def get_tools(tool):
|
|
14
16
|
selected_tools=tool['settings'].get('selected_tools', []),
|
15
17
|
instance_alias=tool['settings'].get('instance_alias', None),
|
16
18
|
base_url=tool['settings']['base_url'],
|
17
|
-
password=tool['settings'].get('password', None),
|
18
|
-
username=tool['settings'].get('username', None),
|
19
|
+
password=tool['settings'].get('servicenow_configuration', {}).get('password', None),
|
20
|
+
username=tool['settings'].get('servicenow_configuration', {}).get('username', None),
|
19
21
|
response_fields=tool['settings'].get('response_fields', None),
|
20
22
|
toolkit_name=tool.get('toolkit_name')
|
21
23
|
).get_tools()
|
@@ -37,9 +39,9 @@ class ServiceNowToolkit(BaseToolkit):
|
|
37
39
|
'configuration': True,
|
38
40
|
'configuration_title': True
|
39
41
|
})),
|
40
|
-
username=(str, Field(description="Username", default=None, json_schema_extra={'configuration': True})),
|
41
|
-
password=(SecretStr, Field(description="Password", default=None, json_schema_extra={'secret': True, 'configuration': True})),
|
42
42
|
response_fields=(Optional[str], Field(description="Response fields", default=None)),
|
43
|
+
servicenow_configuration=(Optional[ServiceNowConfiguration], Field(description="ServiceNow Configuration",
|
44
|
+
json_schema_extra={'configuration_types': ['service_now']})),
|
43
45
|
selected_tools=(List[Literal[tuple(selected_tools)]],
|
44
46
|
Field(default=[], json_schema_extra={'args_schemas': selected_tools})),
|
45
47
|
__config__=ConfigDict(json_schema_extra={
|