alita-sdk 0.3.497__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.

Files changed (108) hide show
  1. alita_sdk/cli/inventory.py +12 -195
  2. alita_sdk/community/inventory/__init__.py +12 -0
  3. alita_sdk/community/inventory/toolkit.py +9 -5
  4. alita_sdk/community/inventory/toolkit_utils.py +176 -0
  5. alita_sdk/configurations/ado.py +144 -0
  6. alita_sdk/configurations/confluence.py +76 -42
  7. alita_sdk/configurations/figma.py +76 -0
  8. alita_sdk/configurations/gitlab.py +2 -0
  9. alita_sdk/configurations/qtest.py +72 -1
  10. alita_sdk/configurations/report_portal.py +96 -0
  11. alita_sdk/configurations/sharepoint.py +148 -0
  12. alita_sdk/configurations/testio.py +83 -0
  13. alita_sdk/runtime/clients/artifact.py +2 -2
  14. alita_sdk/runtime/clients/client.py +24 -19
  15. alita_sdk/runtime/clients/sandbox_client.py +14 -0
  16. alita_sdk/runtime/langchain/assistant.py +48 -2
  17. alita_sdk/runtime/langchain/document_loaders/AlitaJSONLinesLoader.py +77 -0
  18. alita_sdk/runtime/langchain/document_loaders/AlitaJSONLoader.py +2 -1
  19. alita_sdk/runtime/langchain/document_loaders/constants.py +2 -1
  20. alita_sdk/runtime/langchain/langraph_agent.py +8 -9
  21. alita_sdk/runtime/langchain/utils.py +6 -1
  22. alita_sdk/runtime/toolkits/artifact.py +14 -5
  23. alita_sdk/runtime/toolkits/datasource.py +13 -6
  24. alita_sdk/runtime/toolkits/mcp.py +26 -157
  25. alita_sdk/runtime/toolkits/planning.py +10 -5
  26. alita_sdk/runtime/toolkits/tools.py +23 -7
  27. alita_sdk/runtime/toolkits/vectorstore.py +11 -5
  28. alita_sdk/runtime/tools/artifact.py +139 -6
  29. alita_sdk/runtime/tools/llm.py +20 -10
  30. alita_sdk/runtime/tools/mcp_remote_tool.py +2 -3
  31. alita_sdk/runtime/tools/mcp_server_tool.py +2 -4
  32. alita_sdk/runtime/utils/AlitaCallback.py +30 -1
  33. alita_sdk/runtime/utils/mcp_client.py +33 -6
  34. alita_sdk/runtime/utils/mcp_oauth.py +125 -8
  35. alita_sdk/runtime/utils/mcp_sse_client.py +35 -6
  36. alita_sdk/runtime/utils/utils.py +2 -0
  37. alita_sdk/tools/__init__.py +15 -0
  38. alita_sdk/tools/ado/repos/__init__.py +10 -12
  39. alita_sdk/tools/ado/test_plan/__init__.py +23 -8
  40. alita_sdk/tools/ado/wiki/__init__.py +24 -8
  41. alita_sdk/tools/ado/wiki/ado_wrapper.py +21 -7
  42. alita_sdk/tools/ado/work_item/__init__.py +24 -8
  43. alita_sdk/tools/advanced_jira_mining/__init__.py +10 -8
  44. alita_sdk/tools/aws/delta_lake/__init__.py +12 -9
  45. alita_sdk/tools/aws/delta_lake/tool.py +5 -1
  46. alita_sdk/tools/azure_ai/search/__init__.py +9 -7
  47. alita_sdk/tools/base/tool.py +5 -1
  48. alita_sdk/tools/base_indexer_toolkit.py +25 -0
  49. alita_sdk/tools/bitbucket/__init__.py +14 -10
  50. alita_sdk/tools/bitbucket/api_wrapper.py +50 -2
  51. alita_sdk/tools/browser/__init__.py +5 -4
  52. alita_sdk/tools/carrier/__init__.py +5 -6
  53. alita_sdk/tools/cloud/aws/__init__.py +9 -7
  54. alita_sdk/tools/cloud/azure/__init__.py +9 -7
  55. alita_sdk/tools/cloud/gcp/__init__.py +9 -7
  56. alita_sdk/tools/cloud/k8s/__init__.py +9 -7
  57. alita_sdk/tools/code/linter/__init__.py +9 -8
  58. alita_sdk/tools/code/sonar/__init__.py +9 -7
  59. alita_sdk/tools/confluence/__init__.py +15 -10
  60. alita_sdk/tools/custom_open_api/__init__.py +11 -5
  61. alita_sdk/tools/elastic/__init__.py +10 -8
  62. alita_sdk/tools/elitea_base.py +387 -9
  63. alita_sdk/tools/figma/__init__.py +8 -7
  64. alita_sdk/tools/github/__init__.py +12 -14
  65. alita_sdk/tools/github/github_client.py +68 -2
  66. alita_sdk/tools/github/tool.py +5 -1
  67. alita_sdk/tools/gitlab/__init__.py +14 -11
  68. alita_sdk/tools/gitlab/api_wrapper.py +81 -1
  69. alita_sdk/tools/gitlab_org/__init__.py +9 -8
  70. alita_sdk/tools/google/bigquery/__init__.py +12 -12
  71. alita_sdk/tools/google/bigquery/tool.py +5 -1
  72. alita_sdk/tools/google_places/__init__.py +9 -8
  73. alita_sdk/tools/jira/__init__.py +15 -10
  74. alita_sdk/tools/keycloak/__init__.py +10 -8
  75. alita_sdk/tools/localgit/__init__.py +8 -3
  76. alita_sdk/tools/localgit/local_git.py +62 -54
  77. alita_sdk/tools/localgit/tool.py +5 -1
  78. alita_sdk/tools/memory/__init__.py +11 -3
  79. alita_sdk/tools/ocr/__init__.py +10 -8
  80. alita_sdk/tools/openapi/__init__.py +6 -2
  81. alita_sdk/tools/pandas/__init__.py +9 -7
  82. alita_sdk/tools/postman/__init__.py +10 -11
  83. alita_sdk/tools/pptx/__init__.py +9 -9
  84. alita_sdk/tools/qtest/__init__.py +9 -8
  85. alita_sdk/tools/rally/__init__.py +9 -8
  86. alita_sdk/tools/report_portal/__init__.py +11 -9
  87. alita_sdk/tools/salesforce/__init__.py +9 -9
  88. alita_sdk/tools/servicenow/__init__.py +10 -8
  89. alita_sdk/tools/sharepoint/__init__.py +9 -8
  90. alita_sdk/tools/slack/__init__.py +8 -7
  91. alita_sdk/tools/sql/__init__.py +9 -8
  92. alita_sdk/tools/testio/__init__.py +9 -8
  93. alita_sdk/tools/testrail/__init__.py +10 -8
  94. alita_sdk/tools/utils/__init__.py +9 -4
  95. alita_sdk/tools/utils/text_operations.py +254 -0
  96. alita_sdk/tools/xray/__init__.py +10 -8
  97. alita_sdk/tools/yagmail/__init__.py +8 -3
  98. alita_sdk/tools/zephyr/__init__.py +8 -7
  99. alita_sdk/tools/zephyr_enterprise/__init__.py +10 -8
  100. alita_sdk/tools/zephyr_essential/__init__.py +9 -8
  101. alita_sdk/tools/zephyr_scale/__init__.py +9 -8
  102. alita_sdk/tools/zephyr_squad/__init__.py +9 -8
  103. {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.515.dist-info}/METADATA +1 -1
  104. {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.515.dist-info}/RECORD +108 -105
  105. {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.515.dist-info}/WHEEL +0 -0
  106. {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.515.dist-info}/entry_points.txt +0 -0
  107. {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.515.dist-info}/licenses/LICENSE +0 -0
  108. {alita_sdk-0.3.497.dist-info → alita_sdk-0.3.515.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ from functools import lru_cache
7
7
  from .api_wrapper import CarrierAPIWrapper
8
8
  from .tools import __all__
9
9
  from ..elitea_base import filter_missconfigured_index_tools
10
- from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
10
+ from ..utils import clean_string, get_max_toolkit_length
11
11
  from ...configurations.carrier import CarrierConfiguration
12
12
 
13
13
  logger = logging.getLogger(__name__)
@@ -17,7 +17,6 @@ name = 'carrier'
17
17
 
18
18
  class AlitaCarrierToolkit(BaseToolkit):
19
19
  tools: List[BaseTool] = []
20
- toolkit_max_length: int = 100
21
20
 
22
21
  @classmethod
23
22
  @lru_cache(maxsize=32)
@@ -26,7 +25,6 @@ class AlitaCarrierToolkit(BaseToolkit):
26
25
  for t in __all__:
27
26
  default = t['tool'].__pydantic_fields__['args_schema'].default
28
27
  selected_tools[t['name']] = default.schema() if default else default
29
- cls.toolkit_max_length = get_max_toolkit_length(selected_tools)
30
28
  return create_model(
31
29
  name,
32
30
  project_id=(Optional[str], Field(None, description="Optional project ID for scoped operations")),
@@ -70,15 +68,16 @@ class AlitaCarrierToolkit(BaseToolkit):
70
68
  logger.exception(f"[AlitaCarrierToolkit] Error initializing CarrierAPIWrapper: {e}")
71
69
  raise ValueError(f"CarrierAPIWrapper initialization error: {e}")
72
70
 
73
- prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
74
-
75
71
  tools = []
76
72
  for tool_def in __all__:
77
73
  if selected_tools and tool_def['name'] not in selected_tools:
78
74
  continue
79
75
  try:
80
76
  tool_instance = tool_def['tool'](api_wrapper=carrier_api_wrapper)
81
- tool_instance.name = prefix + tool_instance.name
77
+ if toolkit_name:
78
+ tool_instance.description = f"{tool_instance.description}\nToolkit: {toolkit_name}"
79
+ tool_instance.description = tool_instance.description[:1000]
80
+ tool_instance.metadata = {"toolkit_name": toolkit_name}
82
81
  tools.append(tool_instance)
83
82
  logger.info(f"[AlitaCarrierToolkit] Successfully initialized tool '{tool_instance.name}'")
84
83
  except Exception as e:
@@ -6,7 +6,7 @@ from langchain_core.tools import BaseToolkit, BaseTool
6
6
  from .api_wrapper import AWSToolConfig
7
7
  from ...base.tool import BaseAction
8
8
  from ...elitea_base import filter_missconfigured_index_tools
9
- from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
9
+ from ...utils import clean_string, get_max_toolkit_length
10
10
 
11
11
  name = "aws"
12
12
 
@@ -22,12 +22,10 @@ def get_tools(tool):
22
22
 
23
23
  class AWSToolkit(BaseToolkit):
24
24
  tools: list[BaseTool] = []
25
- toolkit_max_length: int = 0
26
25
 
27
26
  @staticmethod
28
27
  def toolkit_config_schema() -> BaseModel:
29
28
  selected_tools = {x['name']: x['args_schema'].schema() for x in AWSToolConfig.model_construct().get_available_tools()}
30
- AWSToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
31
29
  return create_model(
32
30
  name,
33
31
  region=(str, Field(default="", title="Region", description="AWS region")),
@@ -54,15 +52,19 @@ class AWSToolkit(BaseToolkit):
54
52
  aws_tool_config = AWSToolConfig(**kwargs)
55
53
  available_tools = aws_tool_config.get_available_tools()
56
54
  tools = []
57
- prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
58
55
  for tool in available_tools:
59
56
  if selected_tools and tool["name"] not in selected_tools:
60
57
  continue
58
+ description = tool["description"]
59
+ if toolkit_name:
60
+ description = f"Toolkit: {toolkit_name}\n{description}"
61
+ description = description[:1000]
61
62
  tools.append(BaseAction(
62
63
  api_wrapper=aws_tool_config,
63
- name=prefix + tool["name"],
64
- description=tool["description"],
65
- args_schema=tool["args_schema"]
64
+ name=tool["name"],
65
+ description=description,
66
+ args_schema=tool["args_schema"],
67
+ metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
66
68
  ))
67
69
  return cls(tools=tools)
68
70
 
@@ -6,7 +6,7 @@ from pydantic import create_model, BaseModel, ConfigDict, Field, SecretStr
6
6
  from .api_wrapper import AzureApiWrapper
7
7
  from ...base.tool import BaseAction
8
8
  from ...elitea_base import filter_missconfigured_index_tools
9
- from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
9
+ from ...utils import clean_string, get_max_toolkit_length
10
10
 
11
11
  name = "azure"
12
12
 
@@ -23,12 +23,10 @@ def get_tools(tool):
23
23
 
24
24
  class AzureToolkit(BaseToolkit):
25
25
  tools: list[BaseTool] = []
26
- toolkit_max_length: int = 0
27
26
 
28
27
  @staticmethod
29
28
  def toolkit_config_schema() -> BaseModel:
30
29
  selected_tools = {x['name']: x['args_schema'].schema() for x in AzureApiWrapper.model_construct().get_available_tools()}
31
- AzureToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
32
30
  return create_model(
33
31
  name,
34
32
  subscription_id=(str, Field(default="", title="Subscription ID", description="Azure subscription ID")),
@@ -47,15 +45,19 @@ class AzureToolkit(BaseToolkit):
47
45
  azure_api_wrapper = AzureApiWrapper(**kwargs)
48
46
  available_tools = azure_api_wrapper.get_available_tools()
49
47
  tools = []
50
- prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
51
48
  for tool in available_tools:
52
49
  if selected_tools and tool["name"] not in selected_tools:
53
50
  continue
51
+ description = tool["description"]
52
+ if toolkit_name:
53
+ description = f"Toolkit: {toolkit_name}\n{description}"
54
+ description = description[:1000]
54
55
  tools.append(BaseAction(
55
56
  api_wrapper=azure_api_wrapper,
56
- name=prefix + tool["name"],
57
- description=tool["description"],
58
- args_schema=tool["args_schema"]
57
+ name=tool["name"],
58
+ description=description,
59
+ args_schema=tool["args_schema"],
60
+ metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
59
61
  ))
60
62
  return cls(tools=tools)
61
63
 
@@ -6,7 +6,7 @@ from pydantic import create_model, BaseModel, ConfigDict, Field, SecretStr
6
6
  from .api_wrapper import GCPApiWrapper
7
7
  from ...base.tool import BaseAction
8
8
  from ...elitea_base import filter_missconfigured_index_tools
9
- from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
9
+ from ...utils import clean_string, get_max_toolkit_length
10
10
 
11
11
  name = "gcp"
12
12
 
@@ -20,12 +20,10 @@ def get_tools(tool):
20
20
 
21
21
  class GCPToolkit(BaseToolkit):
22
22
  tools: list[BaseTool] = []
23
- toolkit_max_length: int = 0
24
23
 
25
24
  @staticmethod
26
25
  def toolkit_config_schema() -> BaseModel:
27
26
  selected_tools = {x['name']: x['args_schema'].schema() for x in GCPApiWrapper.model_construct().get_available_tools()}
28
- GCPToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
29
27
  return create_model(
30
28
  name,
31
29
  api_key=(SecretStr, Field(default="", title="API key", description="GCP API key", json_schema_extra={'secret': True})),
@@ -41,15 +39,19 @@ class GCPToolkit(BaseToolkit):
41
39
  gcp_api_wrapper = GCPApiWrapper(**kwargs)
42
40
  available_tools = gcp_api_wrapper.get_available_tools()
43
41
  tools = []
44
- prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
45
42
  for tool in available_tools:
46
43
  if selected_tools and tool["name"] not in selected_tools:
47
44
  continue
45
+ description = tool["description"]
46
+ if toolkit_name:
47
+ description = f"Toolkit: {toolkit_name}\n{description}"
48
+ description = description[:1000]
48
49
  tools.append(BaseAction(
49
50
  api_wrapper=gcp_api_wrapper,
50
- name=prefix + tool["name"],
51
- description=tool["description"],
52
- args_schema=tool["args_schema"]
51
+ name=tool["name"],
52
+ description=description,
53
+ args_schema=tool["args_schema"],
54
+ metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
53
55
  ))
54
56
  return cls(tools=tools)
55
57
 
@@ -6,7 +6,7 @@ from pydantic import create_model, BaseModel, ConfigDict, Field, SecretStr
6
6
  from .api_wrapper import KubernetesApiWrapper
7
7
  from ...base.tool import BaseAction
8
8
  from ...elitea_base import filter_missconfigured_index_tools
9
- from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
9
+ from ...utils import clean_string, get_max_toolkit_length
10
10
 
11
11
  name = "kubernetes"
12
12
 
@@ -21,12 +21,10 @@ def get_tools(tool):
21
21
 
22
22
  class KubernetesToolkit(BaseToolkit):
23
23
  tools: list[BaseTool] = []
24
- toolkit_max_length: int = 0
25
24
 
26
25
  @staticmethod
27
26
  def toolkit_config_schema() -> BaseModel:
28
27
  selected_tools = {x['name']: x['args_schema'].schema() for x in KubernetesApiWrapper.model_construct().get_available_tools()}
29
- KubernetesToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
30
28
  return create_model(
31
29
  name,
32
30
  url=(str, Field(default="", title="Cluster URL", description="The URL of the Kubernetes cluster")),
@@ -51,15 +49,19 @@ class KubernetesToolkit(BaseToolkit):
51
49
  kubernetes_api_wrapper = KubernetesApiWrapper(**kwargs)
52
50
  available_tools = kubernetes_api_wrapper.get_available_tools()
53
51
  tools = []
54
- prefix = clean_string(toolkit_name, cls.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
55
52
  for tool in available_tools:
56
53
  if selected_tools and tool["name"] not in selected_tools:
57
54
  continue
55
+ description = tool["description"]
56
+ if toolkit_name:
57
+ description = f"Toolkit: {toolkit_name}\n{description}"
58
+ description = description[:1000]
58
59
  tools.append(BaseAction(
59
60
  api_wrapper=kubernetes_api_wrapper,
60
- name=prefix + tool["name"],
61
- description=tool["description"],
62
- args_schema=tool["args_schema"]
61
+ name=tool["name"],
62
+ description=description,
63
+ args_schema=tool["args_schema"],
64
+ metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
63
65
  ))
64
66
  return cls(tools=tools)
65
67
 
@@ -5,7 +5,7 @@ from pydantic import BaseModel, create_model, Field
5
5
 
6
6
  from .api_wrapper import PythonLinter
7
7
  from ...base.tool import BaseAction
8
- from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
8
+ from ...utils import clean_string, get_max_toolkit_length
9
9
 
10
10
  name = "python_linter"
11
11
 
@@ -19,11 +19,9 @@ def get_tools(tool):
19
19
 
20
20
  class PythonLinterToolkit(BaseToolkit):
21
21
  tools: list[BaseTool] = []
22
- toolkit_max_length: int = 0
23
22
 
24
23
  @staticmethod
25
24
  def toolkit_config_schema() -> BaseModel:
26
- PythonLinterToolkit.toolkit_max_length = get_max_toolkit_length([])
27
25
  return create_model(
28
26
  name,
29
27
  error_codes=(str, Field(description="Error codes to be used by the linter")),
@@ -39,16 +37,19 @@ class PythonLinterToolkit(BaseToolkit):
39
37
  python_linter = PythonLinter(**kwargs)
40
38
  available_tools = python_linter.get_available_tools()
41
39
  tools = []
42
- toolkit_max_length = get_max_toolkit_length(selected_tools)
43
- prefix = clean_string(toolkit_name, PythonLinterToolkit.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
44
40
  for tool in available_tools:
45
41
  if selected_tools and tool["name"] not in selected_tools:
46
42
  continue
43
+ description = tool["description"]
44
+ if toolkit_name:
45
+ description = f"Toolkit: {toolkit_name}\n{description}"
46
+ description = description[:1000]
47
47
  tools.append(BaseAction(
48
48
  api_wrapper=python_linter,
49
- name=prefix + tool["name"],
50
- description=tool["description"],
51
- args_schema=tool["args_schema"]
49
+ name=tool["name"],
50
+ description=description,
51
+ args_schema=tool["args_schema"],
52
+ metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
52
53
  ))
53
54
  return cls(tools=tools)
54
55
 
@@ -5,7 +5,7 @@ from pydantic import create_model, BaseModel, ConfigDict, Field
5
5
  from .api_wrapper import SonarApiWrapper
6
6
  from ...base.tool import BaseAction
7
7
  from ...elitea_base import filter_missconfigured_index_tools
8
- from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
8
+ from ...utils import clean_string, get_max_toolkit_length
9
9
  from ....configurations.sonar import SonarConfiguration
10
10
 
11
11
  name = "sonar"
@@ -21,12 +21,10 @@ def get_tools(tool):
21
21
 
22
22
  class SonarToolkit(BaseToolkit):
23
23
  tools: list[BaseTool] = []
24
- toolkit_max_length: int = 0
25
24
 
26
25
  @staticmethod
27
26
  def toolkit_config_schema() -> BaseModel:
28
27
  selected_tools = {x['name']: x['args_schema'].schema() for x in SonarApiWrapper.model_construct().get_available_tools()}
29
- SonarToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
30
28
  return create_model(
31
29
  name,
32
30
  sonar_project_name=(str, Field(description="Project name of the desired repository")),
@@ -55,15 +53,19 @@ class SonarToolkit(BaseToolkit):
55
53
  sonar_api_wrapper = SonarApiWrapper(**wrapper_payload)
56
54
  available_tools = sonar_api_wrapper.get_available_tools()
57
55
  tools = []
58
- prefix = clean_string(toolkit_name, SonarToolkit.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
59
56
  for tool in available_tools:
60
57
  if selected_tools and tool["name"] not in selected_tools:
61
58
  continue
59
+ description = tool["description"]
60
+ if toolkit_name:
61
+ description = f"Toolkit: {toolkit_name}\n{description}"
62
+ description = description[:1000]
62
63
  tools.append(BaseAction(
63
64
  api_wrapper=sonar_api_wrapper,
64
- name=prefix + tool["name"],
65
- description=tool["description"],
66
- args_schema=tool["args_schema"]
65
+ name=tool["name"],
66
+ description=description,
67
+ args_schema=tool["args_schema"],
68
+ metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
67
69
  ))
68
70
  return cls(tools=tools)
69
71
 
@@ -6,14 +6,14 @@ from ..base.tool import BaseAction
6
6
  from pydantic import create_model, BaseModel, ConfigDict, Field
7
7
 
8
8
  from ..elitea_base import filter_missconfigured_index_tools
9
- from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length, parse_list, check_connection_response
9
+ from ..utils import clean_string, get_max_toolkit_length, parse_list, check_connection_response
10
10
  from ...configurations.confluence import ConfluenceConfiguration
11
11
  from ...configurations.pgvector import PgVectorConfiguration
12
12
  import requests
13
13
 
14
14
  name = "confluence"
15
15
 
16
- def get_tools(tool):
16
+ def get_toolkit(tool):
17
17
  return ConfluenceToolkit().get_toolkit(
18
18
  selected_tools=tool['settings'].get('selected_tools', []),
19
19
  space=tool['settings'].get('space', None),
@@ -33,18 +33,19 @@ def get_tools(tool):
33
33
  doctype='doc',
34
34
  embedding_model=tool['settings'].get('embedding_model'),
35
35
  vectorstore_type="PGVector"
36
- ).get_tools()
36
+ )
37
+
38
+ def get_tools(tool):
39
+ return get_toolkit(tool).get_tools()
37
40
 
38
41
 
39
42
  class ConfluenceToolkit(BaseToolkit):
40
43
  tools: List[BaseTool] = []
41
- toolkit_max_length: int = 0
42
44
 
43
45
  @staticmethod
44
46
  def toolkit_config_schema() -> BaseModel:
45
47
  selected_tools = {x['name']: x['args_schema'].schema() for x in
46
48
  ConfluenceAPIWrapper.model_construct().get_available_tools()}
47
- ConfluenceToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
48
49
 
49
50
  @check_connection_response
50
51
  def check_connection(self):
@@ -94,7 +95,6 @@ class ConfluenceToolkit(BaseToolkit):
94
95
  'metadata': {
95
96
  "label": "Confluence",
96
97
  "icon_url": None,
97
- "max_length": ConfluenceToolkit.toolkit_max_length,
98
98
  "categories": ["documentation"],
99
99
  "extra_categories": ["confluence", "wiki", "knowledge base", "documentation", "atlassian"]
100
100
  }
@@ -115,18 +115,23 @@ class ConfluenceToolkit(BaseToolkit):
115
115
  **(kwargs.get('pgvector_configuration') or {}),
116
116
  }
117
117
  confluence_api_wrapper = ConfluenceAPIWrapper(**wrapper_payload)
118
- prefix = clean_string(toolkit_name, ConfluenceToolkit.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
119
118
  available_tools = confluence_api_wrapper.get_available_tools()
120
119
  tools = []
121
120
  for tool in available_tools:
122
121
  if selected_tools:
123
122
  if tool["name"] not in selected_tools:
124
123
  continue
124
+ description = tool["description"]
125
+ if toolkit_name:
126
+ description = f"Toolkit: {toolkit_name}\n{description}"
127
+ description = f"Confluence space: {confluence_api_wrapper.space}\n{description}"
128
+ description = description[:1000]
125
129
  tools.append(BaseAction(
126
130
  api_wrapper=confluence_api_wrapper,
127
- name=prefix + tool["name"],
128
- description=f"Confluence space: {confluence_api_wrapper.space}" + tool["description"],
129
- args_schema=tool["args_schema"]
131
+ name=tool["name"],
132
+ description=description,
133
+ args_schema=tool["args_schema"],
134
+ metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
130
135
  ))
131
136
  return cls(tools=tools)
132
137
 
@@ -5,7 +5,7 @@ from pydantic import create_model, BaseModel, ConfigDict, Field
5
5
 
6
6
  from .api_wrapper import OpenApiWrapper
7
7
  from ..base.tool import BaseAction
8
- from ..utils import clean_string, TOOLKIT_SPLITTER
8
+ from ..utils import clean_string
9
9
 
10
10
  name = "openapi"
11
11
 
@@ -43,15 +43,21 @@ class OpenApiToolkit(BaseToolkit):
43
43
  openapi_api_wrapper = OpenApiWrapper(**kwargs)
44
44
  available_tools = openapi_api_wrapper.get_available_tools()
45
45
  tools = []
46
- prefix = clean_string(toolkit_name + TOOLKIT_SPLITTER) if toolkit_name else ''
46
+ # Use clean toolkit name for context (max 1000 chars in description)
47
+ toolkit_context = f" [Toolkit: {clean_string(toolkit_name)}]" if toolkit_name else ''
47
48
  for tool in available_tools:
48
49
  if selected_tools and tool["name"] not in selected_tools:
49
50
  continue
51
+ # Add toolkit context to description with character limit
52
+ description = tool["description"]
53
+ if toolkit_context and len(description + toolkit_context) <= 1000:
54
+ description = description + toolkit_context
50
55
  tools.append(BaseAction(
51
56
  api_wrapper=openapi_api_wrapper,
52
- name=prefix + tool["name"],
53
- description=tool["description"],
54
- args_schema=tool["args_schema"]
57
+ name=tool["name"],
58
+ description=description,
59
+ args_schema=tool["args_schema"],
60
+ metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
55
61
  ))
56
62
  return cls(tools=tools)
57
63
 
@@ -5,7 +5,7 @@ from pydantic import BaseModel, ConfigDict, create_model, Field, SecretStr
5
5
 
6
6
  from .api_wrapper import ELITEAElasticApiWrapper
7
7
  from ..base.tool import BaseAction
8
- from ..utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
8
+ from ..utils import clean_string, get_max_toolkit_length
9
9
 
10
10
  name = "elastic"
11
11
 
@@ -19,15 +19,13 @@ def get_tools(tool):
19
19
 
20
20
  class ElasticToolkit(BaseToolkit):
21
21
  tools: list[BaseTool] = []
22
- toolkit_max_length: int = 0
23
22
 
24
23
  @staticmethod
25
24
  def toolkit_config_schema() -> BaseModel:
26
25
  selected_tools = {x['name']: x['args_schema'].schema() for x in ELITEAElasticApiWrapper.model_construct().get_available_tools()}
27
- ElasticToolkit.toolkit_max_length = get_max_toolkit_length(selected_tools)
28
26
  return create_model(
29
27
  name,
30
- url=(str, Field(default=None, title="Elasticsearch URL", description="Elasticsearch URL", json_schema_extra={'toolkit_name': True, 'max_toolkit_length': ElasticToolkit.toolkit_max_length})),
28
+ url=(str, Field(default=None, title="Elasticsearch URL", description="Elasticsearch URL", json_schema_extra={'toolkit_name': True})),
31
29
  api_key=(
32
30
  Optional[SecretStr],
33
31
  Field(
@@ -48,15 +46,19 @@ class ElasticToolkit(BaseToolkit):
48
46
  elastic_api_wrapper = ELITEAElasticApiWrapper(**kwargs)
49
47
  available_tools = elastic_api_wrapper.get_available_tools()
50
48
  tools = []
51
- prefix = clean_string(toolkit_name, ElasticToolkit.toolkit_max_length) + TOOLKIT_SPLITTER if toolkit_name else ''
52
49
  for tool in available_tools:
53
50
  if selected_tools and tool["name"] not in selected_tools:
54
51
  continue
52
+ description = tool["description"]
53
+ if toolkit_name:
54
+ description = f"Toolkit: {toolkit_name}\n{description}"
55
+ description = description[:1000]
55
56
  tools.append(BaseAction(
56
57
  api_wrapper=elastic_api_wrapper,
57
- name=prefix + tool["name"],
58
- description=tool["description"],
59
- args_schema=tool["args_schema"]
58
+ name=tool["name"],
59
+ description=description,
60
+ args_schema=tool["args_schema"],
61
+ metadata={"toolkit_name": toolkit_name} if toolkit_name else {}
60
62
  ))
61
63
  return cls(tools=tools)
62
64