alita-sdk 0.3.554__py3-none-any.whl → 0.3.603__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of alita-sdk might be problematic. Click here for more details.
- alita_sdk/cli/agent_executor.py +2 -1
- alita_sdk/cli/agent_loader.py +34 -4
- alita_sdk/cli/agents.py +433 -203
- alita_sdk/configurations/openapi.py +227 -15
- alita_sdk/runtime/clients/client.py +4 -2
- alita_sdk/runtime/langchain/_constants_bkup.py +1318 -0
- alita_sdk/runtime/langchain/assistant.py +61 -11
- alita_sdk/runtime/langchain/constants.py +419 -171
- alita_sdk/runtime/langchain/document_loaders/AlitaJSONLoader.py +4 -2
- alita_sdk/runtime/langchain/document_loaders/AlitaTextLoader.py +5 -2
- alita_sdk/runtime/langchain/langraph_agent.py +106 -21
- alita_sdk/runtime/langchain/utils.py +30 -14
- alita_sdk/runtime/toolkits/__init__.py +3 -0
- alita_sdk/runtime/toolkits/artifact.py +2 -1
- alita_sdk/runtime/toolkits/mcp.py +6 -3
- alita_sdk/runtime/toolkits/mcp_config.py +1048 -0
- alita_sdk/runtime/toolkits/skill_router.py +2 -2
- alita_sdk/runtime/toolkits/tools.py +64 -2
- alita_sdk/runtime/toolkits/vectorstore.py +1 -1
- alita_sdk/runtime/tools/artifact.py +15 -0
- alita_sdk/runtime/tools/data_analysis.py +183 -0
- alita_sdk/runtime/tools/llm.py +30 -11
- alita_sdk/runtime/tools/mcp_server_tool.py +6 -3
- alita_sdk/runtime/tools/router.py +2 -4
- alita_sdk/runtime/tools/sandbox.py +9 -6
- alita_sdk/runtime/utils/constants.py +5 -1
- alita_sdk/runtime/utils/mcp_client.py +1 -1
- alita_sdk/runtime/utils/mcp_sse_client.py +1 -1
- alita_sdk/runtime/utils/toolkit_utils.py +2 -0
- alita_sdk/tools/__init__.py +3 -1
- alita_sdk/tools/ado/repos/__init__.py +26 -8
- alita_sdk/tools/ado/repos/repos_wrapper.py +78 -52
- alita_sdk/tools/ado/test_plan/__init__.py +3 -2
- alita_sdk/tools/ado/test_plan/test_plan_wrapper.py +23 -1
- alita_sdk/tools/ado/utils.py +1 -18
- alita_sdk/tools/ado/wiki/__init__.py +2 -1
- alita_sdk/tools/ado/wiki/ado_wrapper.py +23 -1
- alita_sdk/tools/ado/work_item/__init__.py +3 -2
- alita_sdk/tools/ado/work_item/ado_wrapper.py +23 -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/azure_ai/search/api_wrapper.py +1 -1
- alita_sdk/tools/base_indexer_toolkit.py +15 -6
- alita_sdk/tools/bitbucket/__init__.py +2 -1
- alita_sdk/tools/bitbucket/api_wrapper.py +1 -1
- alita_sdk/tools/bitbucket/cloud_api_wrapper.py +3 -3
- alita_sdk/tools/browser/__init__.py +1 -1
- alita_sdk/tools/carrier/__init__.py +1 -1
- alita_sdk/tools/chunkers/code/treesitter/treesitter.py +37 -13
- 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/code_indexer_toolkit.py +19 -2
- alita_sdk/tools/confluence/__init__.py +7 -6
- alita_sdk/tools/confluence/api_wrapper.py +2 -2
- alita_sdk/tools/custom_open_api/__init__.py +2 -1
- alita_sdk/tools/elastic/__init__.py +2 -1
- alita_sdk/tools/elitea_base.py +28 -9
- alita_sdk/tools/figma/__init__.py +52 -6
- alita_sdk/tools/figma/api_wrapper.py +1158 -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/github/github_client.py +69 -97
- alita_sdk/tools/github/schemas.py +4 -4
- alita_sdk/tools/gitlab/__init__.py +2 -1
- alita_sdk/tools/gitlab/api_wrapper.py +118 -38
- alita_sdk/tools/gitlab_org/__init__.py +2 -1
- alita_sdk/tools/gitlab_org/api_wrapper.py +60 -62
- 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 +11 -5
- alita_sdk/tools/pandas/api_wrapper.py +38 -25
- alita_sdk/tools/postman/__init__.py +2 -1
- alita_sdk/tools/pptx/__init__.py +2 -1
- alita_sdk/tools/qtest/__init__.py +21 -2
- alita_sdk/tools/qtest/api_wrapper.py +430 -13
- alita_sdk/tools/rally/__init__.py +2 -1
- alita_sdk/tools/rally/api_wrapper.py +1 -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/sharepoint/api_wrapper.py +2 -2
- alita_sdk/tools/slack/__init__.py +3 -2
- alita_sdk/tools/slack/api_wrapper.py +2 -2
- alita_sdk/tools/sql/__init__.py +3 -2
- alita_sdk/tools/testio/__init__.py +2 -1
- alita_sdk/tools/testrail/__init__.py +2 -1
- alita_sdk/tools/utils/content_parser.py +77 -3
- alita_sdk/tools/utils/text_operations.py +163 -71
- alita_sdk/tools/xray/__init__.py +3 -2
- 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 +3 -2
- alita_sdk/tools/zephyr_scale/api_wrapper.py +2 -2
- alita_sdk/tools/zephyr_squad/__init__.py +2 -1
- {alita_sdk-0.3.554.dist-info → alita_sdk-0.3.603.dist-info}/METADATA +7 -6
- {alita_sdk-0.3.554.dist-info → alita_sdk-0.3.603.dist-info}/RECORD +116 -111
- {alita_sdk-0.3.554.dist-info → alita_sdk-0.3.603.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.554.dist-info → alita_sdk-0.3.603.dist-info}/entry_points.txt +0 -0
- {alita_sdk-0.3.554.dist-info → alita_sdk-0.3.603.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.554.dist-info → alita_sdk-0.3.603.dist-info}/top_level.txt +0 -0
|
@@ -13,7 +13,10 @@ from langchain_core.messages import (
|
|
|
13
13
|
BaseMessage, SystemMessage, HumanMessage
|
|
14
14
|
)
|
|
15
15
|
from langchain_core.prompts import MessagesPlaceholder
|
|
16
|
-
from .constants import REACT_ADDON, REACT_VARS, XML_ADDON, USER_ADDON,
|
|
16
|
+
from .constants import (REACT_ADDON, REACT_VARS, XML_ADDON, USER_ADDON,
|
|
17
|
+
QA_ASSISTANT, NERDY_ASSISTANT, QUIRKY_ASSISTANT, CYNICAL_ASSISTANT,
|
|
18
|
+
DEFAULT_ASSISTANT, PLAN_ADDON, PYODITE_ADDON, DATA_ANALYSIS_ADDON,
|
|
19
|
+
SEARCH_INDEX_ADDON, FILE_HANDLING_INSTRUCTIONS)
|
|
17
20
|
from .chat_message_template import Jinja2TemplatedChatMessagesTemplate
|
|
18
21
|
from ..tools.echo import EchoTool
|
|
19
22
|
from langchain_core.tools import BaseTool, ToolException
|
|
@@ -34,11 +37,13 @@ class Assistant:
|
|
|
34
37
|
debug_mode: Optional[bool] = False,
|
|
35
38
|
mcp_tokens: Optional[dict] = None,
|
|
36
39
|
conversation_id: Optional[str] = None,
|
|
37
|
-
ignored_mcp_servers: Optional[list] = None
|
|
40
|
+
ignored_mcp_servers: Optional[list] = None,
|
|
41
|
+
persona: Optional[str] = "generic"):
|
|
38
42
|
|
|
39
43
|
self.app_type = app_type
|
|
40
44
|
self.memory = memory
|
|
41
45
|
self.store = store
|
|
46
|
+
self.persona = persona
|
|
42
47
|
self.max_iterations = data.get('meta', {}).get('step_limit', 25)
|
|
43
48
|
|
|
44
49
|
logger.debug("Data for agent creation: %s", data)
|
|
@@ -89,8 +94,24 @@ class Assistant:
|
|
|
89
94
|
# Handle internal tools
|
|
90
95
|
meta = data.get('meta', {})
|
|
91
96
|
if meta.get("internal_tools"):
|
|
97
|
+
# Find bucket from artifact toolkit marked with is_attachment flag
|
|
98
|
+
bucket_name = None
|
|
99
|
+
for tool in version_tools:
|
|
100
|
+
if tool.get('type') == 'artifact' and tool.get('is_attachment'):
|
|
101
|
+
bucket_name = tool.get('settings', {}).get('bucket')
|
|
102
|
+
break
|
|
103
|
+
# Fallback: use first artifact toolkit with a bucket
|
|
104
|
+
if not bucket_name:
|
|
105
|
+
for tool in version_tools:
|
|
106
|
+
if tool.get('type') == 'artifact' and tool.get('settings', {}).get('bucket'):
|
|
107
|
+
bucket_name = tool['settings']['bucket']
|
|
108
|
+
break
|
|
109
|
+
|
|
92
110
|
for internal_tool_name in meta.get("internal_tools"):
|
|
93
|
-
|
|
111
|
+
tool_config = {"type": "internal_tool", "name": internal_tool_name, "settings": {}}
|
|
112
|
+
if bucket_name:
|
|
113
|
+
tool_config["settings"]["bucket_name"] = bucket_name
|
|
114
|
+
version_tools.append(tool_config)
|
|
94
115
|
|
|
95
116
|
self.tools = get_tools(
|
|
96
117
|
version_tools,
|
|
@@ -274,7 +295,7 @@ class Assistant:
|
|
|
274
295
|
chat_history_messages.append(message)
|
|
275
296
|
|
|
276
297
|
# Only use prompt_instructions if explicitly specified (for predict app_type)
|
|
277
|
-
if self.app_type
|
|
298
|
+
if self.app_type in ["predict", "react"] and isinstance(self.prompt, str):
|
|
278
299
|
prompt_instructions = self.prompt
|
|
279
300
|
|
|
280
301
|
# Add tool binding only if tools are present
|
|
@@ -289,14 +310,43 @@ class Assistant:
|
|
|
289
310
|
|
|
290
311
|
user_addon = USER_ADDON.format(prompt=str(prompt_instructions)) if prompt_instructions else ""
|
|
291
312
|
plan_addon = PLAN_ADDON if 'update_plan' in tool_names else ""
|
|
313
|
+
data_analysis_addon = DATA_ANALYSIS_ADDON if 'pandas_analyze_data' in tool_names else ""
|
|
292
314
|
pyodite_addon = PYODITE_ADDON if 'pyodide_sandbox' in tool_names else ""
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
315
|
+
search_index_addon = SEARCH_INDEX_ADDON if 'stepback_summary_index' in tool_names else ""
|
|
316
|
+
|
|
317
|
+
# Select assistant template based on persona
|
|
318
|
+
persona_templates = {
|
|
319
|
+
"qa": QA_ASSISTANT,
|
|
320
|
+
"nerdy": NERDY_ASSISTANT,
|
|
321
|
+
"quirky": QUIRKY_ASSISTANT,
|
|
322
|
+
"cynical": CYNICAL_ASSISTANT,
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
# For predict agents with their own instructions, use those directly
|
|
326
|
+
# instead of wrapping in DEFAULT_ASSISTANT
|
|
327
|
+
if self.app_type == "openai" and prompt_instructions:
|
|
328
|
+
# Use agent's own instructions as the base system prompt
|
|
329
|
+
# Append addons only when their corresponding tools are present
|
|
330
|
+
addons = "\n\n---\n\n".join(filter(None, [
|
|
331
|
+
plan_addon,
|
|
332
|
+
search_index_addon,
|
|
333
|
+
FILE_HANDLING_INSTRUCTIONS if simple_tools else "",
|
|
334
|
+
pyodite_addon,
|
|
335
|
+
data_analysis_addon
|
|
336
|
+
]))
|
|
337
|
+
escaped_prompt = f"{prompt_instructions}\n\n---\n\n{addons}" if addons else str(prompt_instructions)
|
|
338
|
+
logger.info("Using agent's own instructions directly (app_type=predict)")
|
|
339
|
+
else:
|
|
340
|
+
base_assistant = persona_templates.get(self.persona, DEFAULT_ASSISTANT)
|
|
341
|
+
escaped_prompt = base_assistant.format(
|
|
342
|
+
users_instructions=user_addon,
|
|
343
|
+
planning_instructions=plan_addon,
|
|
344
|
+
pyodite_addon=pyodite_addon,
|
|
345
|
+
data_analysis_addon=data_analysis_addon,
|
|
346
|
+
search_index_addon=search_index_addon,
|
|
347
|
+
file_handling_instructions=FILE_HANDLING_INSTRUCTIONS
|
|
348
|
+
)
|
|
349
|
+
|
|
300
350
|
# Properly setup the prompt for YAML
|
|
301
351
|
import yaml
|
|
302
352
|
|