alita-sdk 0.3.562__py3-none-any.whl → 0.3.585__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/agents.py +358 -165
- alita_sdk/configurations/openapi.py +227 -15
- alita_sdk/runtime/langchain/langraph_agent.py +93 -20
- alita_sdk/runtime/langchain/utils.py +30 -14
- alita_sdk/runtime/toolkits/artifact.py +2 -1
- alita_sdk/runtime/toolkits/mcp.py +4 -2
- alita_sdk/runtime/toolkits/skill_router.py +1 -1
- alita_sdk/runtime/toolkits/vectorstore.py +1 -1
- alita_sdk/runtime/tools/data_analysis.py +1 -1
- alita_sdk/runtime/tools/llm.py +30 -11
- alita_sdk/runtime/utils/constants.py +5 -1
- alita_sdk/tools/ado/repos/__init__.py +2 -1
- alita_sdk/tools/ado/test_plan/__init__.py +2 -1
- alita_sdk/tools/ado/wiki/__init__.py +2 -1
- alita_sdk/tools/ado/work_item/__init__.py +2 -1
- alita_sdk/tools/advanced_jira_mining/__init__.py +2 -1
- alita_sdk/tools/aws/delta_lake/__init__.py +2 -1
- alita_sdk/tools/azure_ai/search/__init__.py +2 -1
- alita_sdk/tools/bitbucket/__init__.py +2 -1
- alita_sdk/tools/browser/__init__.py +1 -1
- alita_sdk/tools/carrier/__init__.py +1 -1
- alita_sdk/tools/cloud/aws/__init__.py +2 -1
- alita_sdk/tools/cloud/azure/__init__.py +2 -1
- alita_sdk/tools/cloud/gcp/__init__.py +2 -1
- alita_sdk/tools/cloud/k8s/__init__.py +2 -1
- alita_sdk/tools/code/linter/__init__.py +2 -1
- alita_sdk/tools/code/sonar/__init__.py +2 -1
- alita_sdk/tools/confluence/__init__.py +2 -1
- alita_sdk/tools/custom_open_api/__init__.py +2 -1
- alita_sdk/tools/elastic/__init__.py +2 -1
- alita_sdk/tools/figma/__init__.py +51 -5
- alita_sdk/tools/figma/api_wrapper.py +1157 -123
- alita_sdk/tools/figma/figma_client.py +73 -0
- alita_sdk/tools/figma/toon_tools.py +2748 -0
- alita_sdk/tools/github/__init__.py +2 -1
- alita_sdk/tools/gitlab/__init__.py +2 -1
- alita_sdk/tools/gitlab/api_wrapper.py +32 -0
- alita_sdk/tools/gitlab_org/__init__.py +2 -1
- alita_sdk/tools/google/bigquery/__init__.py +2 -1
- alita_sdk/tools/google_places/__init__.py +2 -1
- alita_sdk/tools/jira/__init__.py +2 -1
- alita_sdk/tools/keycloak/__init__.py +2 -1
- alita_sdk/tools/localgit/__init__.py +2 -1
- alita_sdk/tools/memory/__init__.py +1 -1
- alita_sdk/tools/ocr/__init__.py +2 -1
- alita_sdk/tools/openapi/__init__.py +227 -15
- alita_sdk/tools/openapi/api_wrapper.py +1287 -802
- alita_sdk/tools/pandas/__init__.py +3 -2
- alita_sdk/tools/postman/__init__.py +2 -1
- alita_sdk/tools/pptx/__init__.py +2 -1
- alita_sdk/tools/qtest/__init__.py +2 -1
- alita_sdk/tools/rally/__init__.py +2 -1
- alita_sdk/tools/report_portal/__init__.py +2 -1
- alita_sdk/tools/salesforce/__init__.py +2 -1
- alita_sdk/tools/servicenow/__init__.py +2 -1
- alita_sdk/tools/sharepoint/__init__.py +2 -1
- alita_sdk/tools/slack/__init__.py +3 -2
- alita_sdk/tools/sql/__init__.py +2 -1
- alita_sdk/tools/testio/__init__.py +2 -1
- alita_sdk/tools/testrail/__init__.py +2 -1
- alita_sdk/tools/utils/content_parser.py +68 -2
- alita_sdk/tools/xray/__init__.py +2 -1
- alita_sdk/tools/yagmail/__init__.py +2 -1
- alita_sdk/tools/zephyr/__init__.py +2 -1
- alita_sdk/tools/zephyr_enterprise/__init__.py +2 -1
- alita_sdk/tools/zephyr_essential/__init__.py +2 -1
- alita_sdk/tools/zephyr_scale/__init__.py +2 -1
- alita_sdk/tools/zephyr_squad/__init__.py +2 -1
- {alita_sdk-0.3.562.dist-info → alita_sdk-0.3.585.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.562.dist-info → alita_sdk-0.3.585.dist-info}/RECORD +74 -72
- {alita_sdk-0.3.562.dist-info → alita_sdk-0.3.585.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.562.dist-info → alita_sdk-0.3.585.dist-info}/entry_points.txt +0 -0
- {alita_sdk-0.3.562.dist-info → alita_sdk-0.3.585.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.562.dist-info → alita_sdk-0.3.585.dist-info}/top_level.txt +0 -0
alita_sdk/runtime/tools/llm.py
CHANGED
|
@@ -81,22 +81,41 @@ class LLMNode(BaseTool):
|
|
|
81
81
|
"""
|
|
82
82
|
Prepare structured output parameters from structured_output_dict.
|
|
83
83
|
|
|
84
|
+
Expected self.structured_output_dict formats:
|
|
85
|
+
- {"field": "str"} / {"field": "list"} / {"field": "list[str]"} / {"field": "any"} ...
|
|
86
|
+
- OR {"field": {"type": "...", "description": "...", "default": ...}} (optional)
|
|
87
|
+
|
|
84
88
|
Returns:
|
|
85
|
-
|
|
89
|
+
Dict[str, Dict] suitable for create_pydantic_model(...)
|
|
86
90
|
"""
|
|
87
|
-
struct_params = {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
struct_params: dict[str, dict] = {}
|
|
92
|
+
|
|
93
|
+
for key, value in (self.structured_output_dict or {}).items():
|
|
94
|
+
# Allow either a plain type string or a dict with details
|
|
95
|
+
if isinstance(value, dict):
|
|
96
|
+
type_str = (value.get("type") or "any")
|
|
97
|
+
desc = value.get("description", "") or ""
|
|
98
|
+
entry: dict = {"type": type_str, "description": desc}
|
|
99
|
+
if "default" in value:
|
|
100
|
+
entry["default"] = value["default"]
|
|
101
|
+
else:
|
|
102
|
+
type_str = (value or "any") if isinstance(value, str) else "any"
|
|
103
|
+
entry = {"type": type_str, "description": ""}
|
|
104
|
+
|
|
105
|
+
# Normalize: only convert the *exact* "list" into "list[str]"
|
|
106
|
+
# (avoid the old bug where "if 'list' in value" also hits "blacklist", etc.)
|
|
107
|
+
if isinstance(entry.get("type"), str) and entry["type"].strip().lower() == "list":
|
|
108
|
+
entry["type"] = "list[str]"
|
|
109
|
+
|
|
110
|
+
struct_params[key] = entry
|
|
111
|
+
|
|
94
112
|
# Add default output field for proper response to user
|
|
95
113
|
struct_params[ELITEA_RS] = {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"default": None
|
|
114
|
+
"description": "final output to user (summarized output from LLM)",
|
|
115
|
+
"type": "str",
|
|
116
|
+
"default": None,
|
|
99
117
|
}
|
|
118
|
+
|
|
100
119
|
return struct_params
|
|
101
120
|
|
|
102
121
|
def _invoke_with_structured_output(self, llm_client: Any, messages: List, struct_model: Any, config: RunnableConfig):
|
|
@@ -11,6 +11,7 @@ from ....configurations.pgvector import PgVectorConfiguration
|
|
|
11
11
|
from ...base.tool import BaseAction
|
|
12
12
|
from .repos_wrapper import ReposApiWrapper
|
|
13
13
|
from ...utils import clean_string, get_max_toolkit_length, check_connection_response
|
|
14
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
14
15
|
|
|
15
16
|
name = "ado_repos"
|
|
16
17
|
|
|
@@ -107,7 +108,7 @@ class AzureDevOpsReposToolkit(BaseToolkit):
|
|
|
107
108
|
name=tool["name"],
|
|
108
109
|
description=description,
|
|
109
110
|
args_schema=tool["args_schema"],
|
|
110
|
-
metadata={
|
|
111
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
111
112
|
)
|
|
112
113
|
)
|
|
113
114
|
return cls(tools=tools)
|
|
@@ -11,6 +11,7 @@ from ....configurations.pgvector import PgVectorConfiguration
|
|
|
11
11
|
from .test_plan_wrapper import TestPlanApiWrapper
|
|
12
12
|
from ...base.tool import BaseAction
|
|
13
13
|
from ...utils import clean_string, get_max_toolkit_length, check_connection_response
|
|
14
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
name = "azure_devops_plans"
|
|
@@ -122,7 +123,7 @@ class AzureDevOpsPlansToolkit(BaseToolkit):
|
|
|
122
123
|
name=tool["name"],
|
|
123
124
|
description=description,
|
|
124
125
|
args_schema=tool["args_schema"],
|
|
125
|
-
metadata={
|
|
126
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
126
127
|
))
|
|
127
128
|
return cls(tools=tools)
|
|
128
129
|
|
|
@@ -10,6 +10,7 @@ from ....configurations.ado import AdoConfiguration
|
|
|
10
10
|
from ....configurations.pgvector import PgVectorConfiguration
|
|
11
11
|
from ...base.tool import BaseAction
|
|
12
12
|
from ...utils import clean_string, get_max_toolkit_length, check_connection_response
|
|
13
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
13
14
|
|
|
14
15
|
name = "azure_devops_wiki"
|
|
15
16
|
name_alias = 'ado_wiki'
|
|
@@ -116,7 +117,7 @@ class AzureDevOpsWikiToolkit(BaseToolkit):
|
|
|
116
117
|
name=tool["name"],
|
|
117
118
|
description=description,
|
|
118
119
|
args_schema=tool["args_schema"],
|
|
119
|
-
metadata={
|
|
120
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
120
121
|
))
|
|
121
122
|
return cls(tools=tools)
|
|
122
123
|
|
|
@@ -10,6 +10,7 @@ from ....configurations.ado import AdoConfiguration
|
|
|
10
10
|
from ....configurations.pgvector import PgVectorConfiguration
|
|
11
11
|
from ...base.tool import BaseAction
|
|
12
12
|
from ...utils import clean_string, get_max_toolkit_length, check_connection_response
|
|
13
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
13
14
|
|
|
14
15
|
name = "ado_boards"
|
|
15
16
|
|
|
@@ -117,7 +118,7 @@ class AzureDevOpsWorkItemsToolkit(BaseToolkit):
|
|
|
117
118
|
name=tool["name"],
|
|
118
119
|
description=description,
|
|
119
120
|
args_schema=tool["args_schema"],
|
|
120
|
-
metadata={
|
|
121
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
121
122
|
))
|
|
122
123
|
return cls(tools=tools)
|
|
123
124
|
|
|
@@ -7,6 +7,7 @@ from .data_mining_wrapper import AdvancedJiraMiningWrapper
|
|
|
7
7
|
from ..base.tool import BaseAction
|
|
8
8
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
9
9
|
from ..utils import clean_string, get_max_toolkit_length
|
|
10
|
+
from ...runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
10
11
|
|
|
11
12
|
name = "advanced_jira_mining"
|
|
12
13
|
|
|
@@ -78,7 +79,7 @@ class AdvancedJiraMiningToolkit(BaseToolkit):
|
|
|
78
79
|
name=tool["name"],
|
|
79
80
|
description=description,
|
|
80
81
|
args_schema=tool["args_schema"],
|
|
81
|
-
metadata={
|
|
82
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
82
83
|
))
|
|
83
84
|
return cls(tools=tools)
|
|
84
85
|
|
|
@@ -9,6 +9,7 @@ from alita_sdk.configurations.delta_lake import DeltaLakeConfiguration
|
|
|
9
9
|
from ...utils import clean_string, get_max_toolkit_length
|
|
10
10
|
from .api_wrapper import DeltaLakeApiWrapper
|
|
11
11
|
from .tool import DeltaLakeAction
|
|
12
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
12
13
|
|
|
13
14
|
name = "delta_lake"
|
|
14
15
|
|
|
@@ -126,7 +127,7 @@ class DeltaLakeToolkit(BaseToolkit):
|
|
|
126
127
|
name=t["name"],
|
|
127
128
|
description=description,
|
|
128
129
|
args_schema=t["args_schema"],
|
|
129
|
-
metadata={
|
|
130
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: t["name"]} if toolkit_name else {TOOL_NAME_META: t["name"]}
|
|
130
131
|
)
|
|
131
132
|
)
|
|
132
133
|
return instance
|
|
@@ -9,6 +9,7 @@ from ...elitea_base import filter_missconfigured_index_tools
|
|
|
9
9
|
from ...utils import clean_string, get_max_toolkit_length, check_connection_response
|
|
10
10
|
from ....configurations.azure_search import AzureSearchConfiguration
|
|
11
11
|
import requests
|
|
12
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
12
13
|
|
|
13
14
|
logger = getLogger(__name__)
|
|
14
15
|
|
|
@@ -91,7 +92,7 @@ class AzureSearchToolkit(BaseToolkit):
|
|
|
91
92
|
name=tool["name"],
|
|
92
93
|
description=description,
|
|
93
94
|
args_schema=tool["args_schema"],
|
|
94
|
-
metadata={
|
|
95
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
95
96
|
))
|
|
96
97
|
return cls(tools=tools)
|
|
97
98
|
|
|
@@ -13,6 +13,7 @@ from ..utils import clean_string, get_max_toolkit_length, check_connection_respo
|
|
|
13
13
|
from ...configurations.bitbucket import BitbucketConfiguration
|
|
14
14
|
from ...configurations.pgvector import PgVectorConfiguration
|
|
15
15
|
import requests
|
|
16
|
+
from ...runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
name = "bitbucket"
|
|
@@ -114,7 +115,7 @@ class AlitaBitbucketToolkit(BaseToolkit):
|
|
|
114
115
|
name=tool["name"],
|
|
115
116
|
description=description,
|
|
116
117
|
args_schema=tool["args_schema"],
|
|
117
|
-
metadata={
|
|
118
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
118
119
|
))
|
|
119
120
|
return cls(tools=tools)
|
|
120
121
|
|
|
@@ -128,7 +128,7 @@ class BrowserToolkit(BaseToolkit):
|
|
|
128
128
|
if toolkit_name:
|
|
129
129
|
tool_entry.description = f"{tool_entry.description}\nToolkit: {toolkit_name}"
|
|
130
130
|
tool_entry.description = tool_entry.description[:1000]
|
|
131
|
-
tool_entry.metadata = {"toolkit_name": toolkit_name}
|
|
131
|
+
tool_entry.metadata = {"toolkit_name": toolkit_name, "toolkit_type": name}
|
|
132
132
|
tools.append(tool_entry)
|
|
133
133
|
return cls(tools=tools)
|
|
134
134
|
|
|
@@ -77,7 +77,7 @@ class AlitaCarrierToolkit(BaseToolkit):
|
|
|
77
77
|
if toolkit_name:
|
|
78
78
|
tool_instance.description = f"{tool_instance.description}\nToolkit: {toolkit_name}"
|
|
79
79
|
tool_instance.description = tool_instance.description[:1000]
|
|
80
|
-
tool_instance.metadata = {"toolkit_name": toolkit_name}
|
|
80
|
+
tool_instance.metadata = {"toolkit_name": toolkit_name, "toolkit_type": name}
|
|
81
81
|
tools.append(tool_instance)
|
|
82
82
|
logger.info(f"[AlitaCarrierToolkit] Successfully initialized tool '{tool_instance.name}'")
|
|
83
83
|
except Exception as e:
|
|
@@ -7,6 +7,7 @@ from .api_wrapper import AWSToolConfig
|
|
|
7
7
|
from ...base.tool import BaseAction
|
|
8
8
|
from ...elitea_base import filter_missconfigured_index_tools
|
|
9
9
|
from ...utils import clean_string, get_max_toolkit_length
|
|
10
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
10
11
|
|
|
11
12
|
name = "aws"
|
|
12
13
|
|
|
@@ -64,7 +65,7 @@ class AWSToolkit(BaseToolkit):
|
|
|
64
65
|
name=tool["name"],
|
|
65
66
|
description=description,
|
|
66
67
|
args_schema=tool["args_schema"],
|
|
67
|
-
metadata={
|
|
68
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
68
69
|
))
|
|
69
70
|
return cls(tools=tools)
|
|
70
71
|
|
|
@@ -7,6 +7,7 @@ from .api_wrapper import AzureApiWrapper
|
|
|
7
7
|
from ...base.tool import BaseAction
|
|
8
8
|
from ...elitea_base import filter_missconfigured_index_tools
|
|
9
9
|
from ...utils import clean_string, get_max_toolkit_length
|
|
10
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
10
11
|
|
|
11
12
|
name = "azure"
|
|
12
13
|
|
|
@@ -57,7 +58,7 @@ class AzureToolkit(BaseToolkit):
|
|
|
57
58
|
name=tool["name"],
|
|
58
59
|
description=description,
|
|
59
60
|
args_schema=tool["args_schema"],
|
|
60
|
-
metadata={
|
|
61
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
61
62
|
))
|
|
62
63
|
return cls(tools=tools)
|
|
63
64
|
|
|
@@ -7,6 +7,7 @@ from .api_wrapper import GCPApiWrapper
|
|
|
7
7
|
from ...base.tool import BaseAction
|
|
8
8
|
from ...elitea_base import filter_missconfigured_index_tools
|
|
9
9
|
from ...utils import clean_string, get_max_toolkit_length
|
|
10
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
10
11
|
|
|
11
12
|
name = "gcp"
|
|
12
13
|
|
|
@@ -51,7 +52,7 @@ class GCPToolkit(BaseToolkit):
|
|
|
51
52
|
name=tool["name"],
|
|
52
53
|
description=description,
|
|
53
54
|
args_schema=tool["args_schema"],
|
|
54
|
-
metadata={
|
|
55
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
55
56
|
))
|
|
56
57
|
return cls(tools=tools)
|
|
57
58
|
|
|
@@ -7,6 +7,7 @@ from .api_wrapper import KubernetesApiWrapper
|
|
|
7
7
|
from ...base.tool import BaseAction
|
|
8
8
|
from ...elitea_base import filter_missconfigured_index_tools
|
|
9
9
|
from ...utils import clean_string, get_max_toolkit_length
|
|
10
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
10
11
|
|
|
11
12
|
name = "kubernetes"
|
|
12
13
|
|
|
@@ -61,7 +62,7 @@ class KubernetesToolkit(BaseToolkit):
|
|
|
61
62
|
name=tool["name"],
|
|
62
63
|
description=description,
|
|
63
64
|
args_schema=tool["args_schema"],
|
|
64
|
-
metadata={
|
|
65
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
65
66
|
))
|
|
66
67
|
return cls(tools=tools)
|
|
67
68
|
|
|
@@ -6,6 +6,7 @@ from pydantic import BaseModel, create_model, Field
|
|
|
6
6
|
from .api_wrapper import PythonLinter
|
|
7
7
|
from ...base.tool import BaseAction
|
|
8
8
|
from ...utils import clean_string, get_max_toolkit_length
|
|
9
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
9
10
|
|
|
10
11
|
name = "python_linter"
|
|
11
12
|
|
|
@@ -49,7 +50,7 @@ class PythonLinterToolkit(BaseToolkit):
|
|
|
49
50
|
name=tool["name"],
|
|
50
51
|
description=description,
|
|
51
52
|
args_schema=tool["args_schema"],
|
|
52
|
-
metadata={
|
|
53
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
53
54
|
))
|
|
54
55
|
return cls(tools=tools)
|
|
55
56
|
|
|
@@ -7,6 +7,7 @@ from ...base.tool import BaseAction
|
|
|
7
7
|
from ...elitea_base import filter_missconfigured_index_tools
|
|
8
8
|
from ...utils import clean_string, get_max_toolkit_length
|
|
9
9
|
from ....configurations.sonar import SonarConfiguration
|
|
10
|
+
from ....runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
10
11
|
|
|
11
12
|
name = "sonar"
|
|
12
13
|
|
|
@@ -65,7 +66,7 @@ class SonarToolkit(BaseToolkit):
|
|
|
65
66
|
name=tool["name"],
|
|
66
67
|
description=description,
|
|
67
68
|
args_schema=tool["args_schema"],
|
|
68
|
-
metadata={
|
|
69
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
69
70
|
))
|
|
70
71
|
return cls(tools=tools)
|
|
71
72
|
|
|
@@ -10,6 +10,7 @@ from ..utils import clean_string, get_max_toolkit_length, parse_list, check_conn
|
|
|
10
10
|
from ...configurations.confluence import ConfluenceConfiguration
|
|
11
11
|
from ...configurations.pgvector import PgVectorConfiguration
|
|
12
12
|
import requests
|
|
13
|
+
from ...runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
13
14
|
|
|
14
15
|
name = "confluence"
|
|
15
16
|
|
|
@@ -131,7 +132,7 @@ class ConfluenceToolkit(BaseToolkit):
|
|
|
131
132
|
name=tool["name"],
|
|
132
133
|
description=description,
|
|
133
134
|
args_schema=tool["args_schema"],
|
|
134
|
-
metadata={
|
|
135
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
135
136
|
))
|
|
136
137
|
return cls(tools=tools)
|
|
137
138
|
|
|
@@ -6,6 +6,7 @@ from pydantic import create_model, BaseModel, ConfigDict, Field
|
|
|
6
6
|
from .api_wrapper import OpenApiWrapper
|
|
7
7
|
from ..base.tool import BaseAction
|
|
8
8
|
from ..utils import clean_string
|
|
9
|
+
from ...runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
9
10
|
|
|
10
11
|
name = "openapi"
|
|
11
12
|
|
|
@@ -57,7 +58,7 @@ class OpenApiToolkit(BaseToolkit):
|
|
|
57
58
|
name=tool["name"],
|
|
58
59
|
description=description,
|
|
59
60
|
args_schema=tool["args_schema"],
|
|
60
|
-
metadata={
|
|
61
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
61
62
|
))
|
|
62
63
|
return cls(tools=tools)
|
|
63
64
|
|
|
@@ -6,6 +6,7 @@ from pydantic import BaseModel, ConfigDict, create_model, Field, SecretStr
|
|
|
6
6
|
from .api_wrapper import ELITEAElasticApiWrapper
|
|
7
7
|
from ..base.tool import BaseAction
|
|
8
8
|
from ..utils import clean_string, get_max_toolkit_length
|
|
9
|
+
from ...runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
9
10
|
|
|
10
11
|
name = "elastic"
|
|
11
12
|
|
|
@@ -58,7 +59,7 @@ class ElasticToolkit(BaseToolkit):
|
|
|
58
59
|
name=tool["name"],
|
|
59
60
|
description=description,
|
|
60
61
|
args_schema=tool["args_schema"],
|
|
61
|
-
metadata={
|
|
62
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
62
63
|
))
|
|
63
64
|
return cls(tools=tools)
|
|
64
65
|
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
from typing import List, Literal, Optional
|
|
1
|
+
from typing import Dict, List, Literal, Optional
|
|
2
2
|
|
|
3
3
|
from langchain_core.tools import BaseTool, BaseToolkit
|
|
4
4
|
from pydantic import BaseModel, ConfigDict, Field, create_model
|
|
5
5
|
|
|
6
6
|
from ..base.tool import BaseAction
|
|
7
|
-
from .api_wrapper import
|
|
7
|
+
from .api_wrapper import (
|
|
8
|
+
FigmaApiWrapper,
|
|
9
|
+
GLOBAL_LIMIT,
|
|
10
|
+
DEFAULT_FIGMA_IMAGES_PROMPT,
|
|
11
|
+
DEFAULT_FIGMA_SUMMARY_PROMPT,
|
|
12
|
+
DEFAULT_NUMBER_OF_THREADS,
|
|
13
|
+
)
|
|
8
14
|
from ..elitea_base import filter_missconfigured_index_tools
|
|
9
|
-
from ..utils import clean_string, get_max_toolkit_length
|
|
10
15
|
from ...configurations.figma import FigmaConfiguration
|
|
11
16
|
from ...configurations.pgvector import PgVectorConfiguration
|
|
17
|
+
from ...runtime.utils.constants import TOOLKIT_NAME_META, TOOL_NAME_META, TOOLKIT_TYPE_META
|
|
12
18
|
|
|
13
19
|
name = "figma"
|
|
14
20
|
|
|
@@ -28,7 +34,14 @@ def get_tools(tool):
|
|
|
28
34
|
collection_name=str(tool['toolkit_name']),
|
|
29
35
|
doctype='doc',
|
|
30
36
|
embedding_model=tool['settings'].get('embedding_model'),
|
|
31
|
-
vectorstore_type="PGVector"
|
|
37
|
+
vectorstore_type="PGVector",
|
|
38
|
+
# figma summary/image prompt settings (toolkit-level)
|
|
39
|
+
# TODO disabled until new requirements
|
|
40
|
+
# apply_images_prompt=tool["settings"].get("apply_images_prompt"),
|
|
41
|
+
# images_prompt=tool["settings"].get("images_prompt"),
|
|
42
|
+
# apply_summary_prompt=tool["settings"].get("apply_summary_prompt"),
|
|
43
|
+
# summary_prompt=tool["settings"].get("summary_prompt"),
|
|
44
|
+
# number_of_threads=tool["settings"].get("number_of_threads"),
|
|
32
45
|
)
|
|
33
46
|
.get_tools()
|
|
34
47
|
)
|
|
@@ -45,6 +58,39 @@ class FigmaToolkit(BaseToolkit):
|
|
|
45
58
|
}
|
|
46
59
|
return create_model(
|
|
47
60
|
name,
|
|
61
|
+
# TODO disabled until new requirements
|
|
62
|
+
# apply_images_prompt=(Optional[bool], Field(
|
|
63
|
+
# description="Enable advanced image processing instructions for Figma image nodes.",
|
|
64
|
+
# default=True,
|
|
65
|
+
# )),
|
|
66
|
+
# images_prompt=(Optional[Dict[str, str]], Field(
|
|
67
|
+
# description=(
|
|
68
|
+
# "Instruction for how to analyze image-based nodes "
|
|
69
|
+
# "(screenshots, diagrams, etc.) during Figma file retrieving. "
|
|
70
|
+
# "Must contain a single 'prompt' key with the text."
|
|
71
|
+
# ),
|
|
72
|
+
# default=DEFAULT_FIGMA_IMAGES_PROMPT,
|
|
73
|
+
# )),
|
|
74
|
+
# apply_summary_prompt=(Optional[bool], Field(
|
|
75
|
+
# description="Enable LLM-based summarization over loaded Figma data.",
|
|
76
|
+
# default=True,
|
|
77
|
+
# )),
|
|
78
|
+
# summary_prompt=(Optional[Dict[str, str]], Field(
|
|
79
|
+
# description=(
|
|
80
|
+
# "Instruction for the LLM on how to summarize loaded Figma data. "
|
|
81
|
+
# "Must contain a single 'prompt' key with the text."
|
|
82
|
+
# ),
|
|
83
|
+
# default=DEFAULT_FIGMA_SUMMARY_PROMPT,
|
|
84
|
+
# )),
|
|
85
|
+
number_of_threads=(Optional[int], Field(
|
|
86
|
+
description=(
|
|
87
|
+
"Number of worker threads to use when downloading and processing Figma images. "
|
|
88
|
+
f"Valid values are from 1 to 5. Default is {DEFAULT_NUMBER_OF_THREADS}."
|
|
89
|
+
),
|
|
90
|
+
default=DEFAULT_NUMBER_OF_THREADS,
|
|
91
|
+
ge=1,
|
|
92
|
+
le=5,
|
|
93
|
+
)),
|
|
48
94
|
global_limit=(Optional[int], Field(description="Global limit", default=GLOBAL_LIMIT)),
|
|
49
95
|
global_regexp=(Optional[str], Field(description="Global regex pattern", default=None)),
|
|
50
96
|
selected_tools=(
|
|
@@ -98,7 +144,7 @@ class FigmaToolkit(BaseToolkit):
|
|
|
98
144
|
name=tool["name"],
|
|
99
145
|
description=description,
|
|
100
146
|
args_schema=tool["args_schema"],
|
|
101
|
-
metadata={
|
|
147
|
+
metadata={TOOLKIT_NAME_META: toolkit_name, TOOLKIT_TYPE_META: name, TOOL_NAME_META: tool["name"]} if toolkit_name else {TOOL_NAME_META: tool["name"]}
|
|
102
148
|
)
|
|
103
149
|
)
|
|
104
150
|
return cls(tools=tools)
|