alita-sdk 0.3.139__py3-none-any.whl → 0.3.140b1__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.
@@ -176,17 +176,21 @@ class AlitaClient:
176
176
  def application(self, client: Any, application_id: int, application_version_id: int,
177
177
  tools: Optional[list] = None, chat_history: Optional[List[Any]] = None,
178
178
  app_type=None, memory=None, runtime='langchain',
179
- application_variables: Optional[dict] = None):
179
+ application_variables: Optional[dict] = None,
180
+ version_details: Optional[dict] = None):
180
181
  if tools is None:
181
182
  tools = []
182
183
  if chat_history is None:
183
184
  chat_history = []
184
- try:
185
- data = self.get_app_version_details(application_id, application_version_id)
186
- except ApiDetailsRequestError as e:
187
- error_msg = f"Failed to fetch application version details for {application_id}/{application_version_id}\nDetails: {e}"
188
- logger.error(error_msg)
189
- raise ToolException(error_msg)
185
+ if version_details:
186
+ data = version_details
187
+ else:
188
+ try:
189
+ data = self.get_app_version_details(application_id, application_version_id)
190
+ except ApiDetailsRequestError as e:
191
+ error_msg = f"Failed to fetch application version details for {application_id}/{application_version_id}\nDetails: {e}"
192
+ logger.error(error_msg)
193
+ raise ToolException(error_msg)
190
194
 
191
195
  if application_variables:
192
196
  for var in data.get('variables', {}):
@@ -204,15 +208,14 @@ class AlitaClient:
204
208
  elif app_type == 'autogen':
205
209
  app_type = "openai"
206
210
  if runtime == 'nonrunnable':
207
- return LangChainAssistant(self, data, client, chat_history, app_type,
211
+ return LangChainAssistant(self, data, client, chat_history, app_type,
208
212
  tools=tools, memory=memory)
209
213
  if runtime == 'langchain':
210
- return LangChainAssistant(self, data, client,
211
- chat_history, app_type,
214
+ return LangChainAssistant(self, data, client,
215
+ chat_history, app_type,
212
216
  tools=tools, memory=memory).runnable()
213
217
  elif runtime == 'llama':
214
218
  raise NotImplementedError("LLama runtime is not supported")
215
-
216
219
 
217
220
  def datasource(self, datasource_id: int) -> AlitaDataSource:
218
221
  url = f"{self.datasources}/{datasource_id}"
@@ -22,7 +22,13 @@ class McpServerTool(BaseTool):
22
22
  def create_pydantic_model_from_schema(schema: dict):
23
23
  fields = {}
24
24
  for field_name, field_info in schema['properties'].items():
25
- field_type = field_info['type']
25
+ field_type = None
26
+
27
+ if 'type' in field_info:
28
+ field_type = field_info['type']
29
+ elif 'allOf' in field_info or 'anyOf' in field_info:# ADO-MCP wit_update_work_item, testplan_add_test_cases_to_suite
30
+ field_type = 'array'
31
+
26
32
  field_description = field_info.get('description', '')
27
33
  if field_type == 'string':
28
34
  if 'enum' in field_info:
@@ -35,6 +41,22 @@ class McpServerTool(BaseTool):
35
41
  field_type = float
36
42
  elif field_type == 'boolean':
37
43
  field_type = bool
44
+ elif field_type == 'object':#Dict[str, Any] - for tool start_browser in selenium mcp
45
+ nested_model = McpServerTool.create_pydantic_model_from_schema(field_info) if 'properties' in field_info else dict# for tool build_run_build in ADO-MCP
46
+ field_type = nested_model
47
+ elif field_type == 'array':
48
+ item_schema = field_info['items'] if 'items' in field_info else (field_info.get('allOf', field_info.get('anyOf', [{'type': None}]))[-1])# ADO-MCP wit_update_work_item, testplan_add_test_cases_to_suite
49
+ item_type = McpServerTool.create_pydantic_model_from_schema(item_schema) if item_schema['type'] == 'object' else (
50
+ str if item_schema['type'] == 'string' else # support enum
51
+ int if item_schema['type'] == 'integer' else
52
+ float if item_schema['type'] == 'number' else
53
+ bool if item_schema['type'] == 'boolean' else
54
+ list if item_schema['type'] == 'array' else# ADO-MCP testplan_add_test_cases_to_suite
55
+ None
56
+ )
57
+ if item_type is None:
58
+ raise ValueError(f"Unsupported array item type: {item_schema['type']}")
59
+ field_type = list[item_type]
38
60
  else:
39
61
  raise ValueError(f"Unsupported field type: {field_type}")
40
62
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.139
3
+ Version: 0.3.140b1
4
4
  Summary: SDK for building langchain agents using resources from Alita
5
5
  Author-email: Artem Rozumenko <artyom.rozumenko@gmail.com>, Mikalai Biazruchka <mikalai_biazruchka@epam.com>, Roman Mitusov <roman_mitusov@epam.com>, Ivan Krakhmaliuk <lifedjik@gmail.com>
6
6
  Project-URL: Homepage, https://projectalita.ai
@@ -4,7 +4,7 @@ alita_sdk/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
4
4
  alita_sdk/agents/llamaAgentParser.py,sha256=N_Nw6WJ8xrNX3fr_JFwjUIg_Urai9lLU3poMgZz0Cyk,1701
5
5
  alita_sdk/clients/__init__.py,sha256=5O_7WsZmvg5z5uZf_Jkx-f8j5C6yKIuSwQR6AQ-TM84,31
6
6
  alita_sdk/clients/artifact.py,sha256=W6oLlthtsUHfUWjhihaDdhLZdRVqj1D2j7oHHELxJfs,2639
7
- alita_sdk/clients/client.py,sha256=iADTqIaVNmMefPBNH37zilPoX42CqcHZTtYBCS-lbtw,19413
7
+ alita_sdk/clients/client.py,sha256=42g8Q7LosIxqGsxNRhNE0KF3VRPKCbVxkeQMVRnyP3Y,19562
8
8
  alita_sdk/clients/datasource.py,sha256=HAZovoQN9jBg0_-lIlGBQzb4FJdczPhkHehAiVG3Wx0,1020
9
9
  alita_sdk/clients/prompt.py,sha256=li1RG9eBwgNK_Qf0qUaZ8QNTmsncFrAL2pv3kbxZRZg,1447
10
10
  alita_sdk/community/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -88,7 +88,7 @@ alita_sdk/tools/indexer_tool.py,sha256=P9S_omk5TZkizb6UXyxMO87Pzj4UCaye0CuXBgCnh
88
88
  alita_sdk/tools/llm.py,sha256=UUd4U4CuCNImHxVJAF5daYbew-7X9H8k21bUWy2PDvg,3502
89
89
  alita_sdk/tools/loop.py,sha256=uds0WhZvwMxDVFI6MZHrcmMle637cQfBNg682iLxoJA,8335
90
90
  alita_sdk/tools/loop_output.py,sha256=U4hO9PCQgWlXwOq6jdmCGbegtAxGAPXObSxZQ3z38uk,8069
91
- alita_sdk/tools/mcp_server_tool.py,sha256=xcH9AiqfR2TYrwJ3Ixw-_A7XDodtJCnwmq1SsikXpYk,1930
91
+ alita_sdk/tools/mcp_server_tool.py,sha256=8RcYSV_6FAEwFSh4KNpdb8rO9oFQ-RR6ufXiZOTgsHA,3476
92
92
  alita_sdk/tools/pgvector_search.py,sha256=NN2BGAnq4SsDHIhUcFZ8d_dbEOM8QwB0UwpsWCYruXU,11692
93
93
  alita_sdk/tools/prompt.py,sha256=nJafb_e5aOM1Rr3qGFCR-SKziU9uCsiP2okIMs9PppM,741
94
94
  alita_sdk/tools/router.py,sha256=wCvZjVkdXK9dMMeEerrgKf5M790RudH68pDortnHSz0,1517
@@ -101,13 +101,13 @@ alita_sdk/utils/logging.py,sha256=hBE3qAzmcLMdamMp2YRXwOOK9P4lmNaNhM76kntVljs,31
101
101
  alita_sdk/utils/save_dataframe.py,sha256=tNwnaVCvN4_B0oi3F4Y3Z13elbIRtwKmdKHsMcj658g,1465
102
102
  alita_sdk/utils/streamlit.py,sha256=zp8owZwHI3HZplhcExJf6R3-APtWx-z6s5jznT2hY_k,29124
103
103
  alita_sdk/utils/utils.py,sha256=dM8whOJAuFJFe19qJ69-FLzrUp6d2G-G6L7d4ss2XqM,346
104
- alita_sdk-0.3.139.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
104
+ alita_sdk-0.3.140b1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
105
105
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
106
106
  tests/test_ado_analysis.py,sha256=wsxB4B2Ycxoiykthh6YbPQ9hqsDbPFie8D9ZK1i_6kg,3311
107
107
  tests/test_github_analysis.py,sha256=ulR4CEGmiMRPydJuX7aQcglzvhC7kFOAtZRLLBB9F_M,3148
108
108
  tests/test_gitlab_analysis.py,sha256=J7Y2mNi5Sj8-rH2PMRmVbT3uwZ17YeR9pcs0MDIyNW4,3352
109
109
  tests/test_jira_analysis.py,sha256=6F3Elikt02L28N6sS_AKDy9lgqgD81_hr979NcdZeg4,3359
110
- alita_sdk-0.3.139.dist-info/METADATA,sha256=9ZEhLNU3RXXyKXJCqvTQIstIg22YoQYlRP24-ToFEB8,7076
111
- alita_sdk-0.3.139.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
- alita_sdk-0.3.139.dist-info/top_level.txt,sha256=SWRhxB7Et3cOy3RkE5hR7OIRnHoo3K8EXzoiNlkfOmc,25
113
- alita_sdk-0.3.139.dist-info/RECORD,,
110
+ alita_sdk-0.3.140b1.dist-info/METADATA,sha256=mAGZFKCyqDPJoYal-kfCJV96nP9UYigBBybAWK8hxVI,7078
111
+ alita_sdk-0.3.140b1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
+ alita_sdk-0.3.140b1.dist-info/top_level.txt,sha256=SWRhxB7Et3cOy3RkE5hR7OIRnHoo3K8EXzoiNlkfOmc,25
113
+ alita_sdk-0.3.140b1.dist-info/RECORD,,