alita-sdk 0.3.321b3__py3-none-any.whl → 0.3.323__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.

@@ -702,7 +702,7 @@ class LangGraphAgentRunnable(CompiledStateGraph):
702
702
 
703
703
  # Append current input to existing messages instead of overwriting
704
704
  if input.get('input'):
705
- current_message = HumanMessage(content=input.get('input'))
705
+ current_message = input.get('input')[-1]
706
706
  if input.get('messages'):
707
707
  # Ensure existing messages are LangChain objects
708
708
  input['messages'] = [convert_dict_to_message(msg) for msg in input['messages']]
@@ -718,7 +718,7 @@ class LangGraphAgentRunnable(CompiledStateGraph):
718
718
  else:
719
719
  result = super().invoke(input, config=config, *args, **kwargs)
720
720
  try:
721
- if self.output_variables and self.output_variables[0] in result and self.output_variables[0] != "messages":
721
+ if self.output_variables and self.output_variables[0] != "messages":
722
722
  # If output_variables are specified, use the value of first one or use the last messages as default
723
723
  output = result.get(self.output_variables[0], result['messages'][-1].content)
724
724
  else:
@@ -31,7 +31,8 @@ def formulate_query(kwargs):
31
31
  chat_history = []
32
32
  for each in kwargs.get('chat_history')[:]:
33
33
  chat_history.append(AIMessage(each))
34
- result = {"input": kwargs.get('task'), "chat_history": chat_history}
34
+ input_message = AIMessage(content=kwargs.get('task'))
35
+ result = {"input": [input_message], "chat_history": chat_history}
35
36
  for key, value in kwargs.items():
36
37
  if key not in ("task", "chat_history"):
37
38
  result[key] = value
@@ -14,7 +14,7 @@ logger = logging.getLogger(__name__)
14
14
 
15
15
 
16
16
  def create_llm_input_with_messages(
17
- prompt: Dict[str, str],
17
+ prompt: Dict[str, str],
18
18
  params: Dict[str, Any]
19
19
  ) -> List[BaseMessage]:
20
20
  """
@@ -4,6 +4,7 @@ import logging
4
4
  import re
5
5
  from enum import Enum
6
6
  from typing import Dict, List, Generator, Optional, Union
7
+ from urllib.parse import urlparse, parse_qs
7
8
 
8
9
  import requests
9
10
  from FigmaPy import FigmaPy
@@ -238,6 +239,7 @@ class FigmaApiWrapper(NonCodeIndexerToolkit):
238
239
 
239
240
  def _base_loader(
240
241
  self,
242
+ file_or_page_url: Optional[str] = None,
241
243
  project_id: Optional[str] = None,
242
244
  file_keys_include: Optional[List[str]] = None,
243
245
  file_keys_exclude: Optional[List[str]] = None,
@@ -247,6 +249,24 @@ class FigmaApiWrapper(NonCodeIndexerToolkit):
247
249
  node_types_exclude: Optional[List[str]] = None,
248
250
  **kwargs
249
251
  ) -> Generator[Document, None, None]:
252
+ if file_or_page_url:
253
+ # If URL is provided and valid, extract and override file_keys_include and node_ids_include
254
+ try:
255
+ parsed = urlparse(file_or_page_url)
256
+ path_parts = parsed.path.strip('/').split('/')
257
+
258
+ # Check if the path matches the expected format
259
+ if len(path_parts) >= 2 and path_parts[0] == 'design':
260
+ file_keys_include = [path_parts[1]]
261
+ if len(path_parts) == 3:
262
+ # To ensure url structure matches Figma's format with 3 path segments
263
+ query_params = parse_qs(parsed.query)
264
+ if "node-id" in query_params:
265
+ node_ids_include = query_params.get('node-id', [])
266
+ except Exception as e:
267
+ raise ToolException(
268
+ f"Unexpected error while processing Figma url {file_or_page_url}: {e}")
269
+
250
270
  # If both include and exclude are provided, use only include
251
271
  if file_keys_include:
252
272
  self._log_tool_event(f"Loading files: {file_keys_include}")
@@ -364,8 +384,11 @@ class FigmaApiWrapper(NonCodeIndexerToolkit):
364
384
  def _index_tool_params(self):
365
385
  """Return the parameters for indexing data."""
366
386
  return {
387
+ "file_or_page_url": (Optional[str], Field(
388
+ description="Url to file or page to index: i.e. https://www.figma.com/design/[YOUR_FILE_KEY]/Login-page-designs?node-id=[YOUR_PAGE_ID]",
389
+ default=None)),
367
390
  "project_id": (Optional[str], Field(
368
- description="ID of the project to list files from: i.e. 55391681'",
391
+ description="ID of the project to list files from: i.e. 55391681",
369
392
  default=None)),
370
393
  'file_keys_include': (Optional[List[str]], Field(
371
394
  description="List of file keys to include in index if project_id is not provided: i.e. ['Fp24FuzPwH0L74ODSrCnQo', 'jmhAr6q78dJoMRqt48zisY']",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.321b3
3
+ Version: 0.3.323
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 <lifedj27@gmail.com>, Artem Dubrovskiy <ad13box@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -44,7 +44,7 @@ alita_sdk/runtime/langchain/assistant.py,sha256=1Eq8BIefp8suhbC9CssoOXtC-plkemoU
44
44
  alita_sdk/runtime/langchain/chat_message_template.py,sha256=kPz8W2BG6IMyITFDA5oeb5BxVRkHEVZhuiGl4MBZKdc,2176
45
45
  alita_sdk/runtime/langchain/constants.py,sha256=eHVJ_beJNTf1WJo4yq7KMK64fxsRvs3lKc34QCXSbpk,3319
46
46
  alita_sdk/runtime/langchain/indexer.py,sha256=0ENHy5EOhThnAiYFc7QAsaTNp9rr8hDV_hTK8ahbatk,37592
47
- alita_sdk/runtime/langchain/langraph_agent.py,sha256=gT6f8I0mOdCc4l4xWYaZ-fYqkkPGhM6hwOIgpr1mXA8,44875
47
+ alita_sdk/runtime/langchain/langraph_agent.py,sha256=jbUlqWFly055uSu0pe0qfUvi5L4CoSUCyMHUFVyNMck,44818
48
48
  alita_sdk/runtime/langchain/mixedAgentParser.py,sha256=M256lvtsL3YtYflBCEp-rWKrKtcY1dJIyRGVv7KW9ME,2611
49
49
  alita_sdk/runtime/langchain/mixedAgentRenderes.py,sha256=asBtKqm88QhZRILditjYICwFVKF5KfO38hu2O-WrSWE,5964
50
50
  alita_sdk/runtime/langchain/store_manager.py,sha256=i8Fl11IXJhrBXq1F1ukEVln57B1IBe-tqSUvfUmBV4A,2218
@@ -105,14 +105,14 @@ alita_sdk/runtime/toolkits/tools.py,sha256=Ea3LO6voPNysdzVB7jYMZIqSMtda7LCq_6fkV
105
105
  alita_sdk/runtime/toolkits/vectorstore.py,sha256=BGppQADa1ZiLO17fC0uCACTTEvPHlodEDYEzUcBRbAA,2901
106
106
  alita_sdk/runtime/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
107
  alita_sdk/runtime/tools/agent.py,sha256=m98QxOHwnCRTT9j18Olbb5UPS8-ZGeQaGiUyZJSyFck,3162
108
- alita_sdk/runtime/tools/application.py,sha256=mC2_ZFx4WLHc98Gzll88Vw6cqyx2cmbig2IeJBtHRdg,2836
108
+ alita_sdk/runtime/tools/application.py,sha256=j6H2OFteb7h2Yhxk1ipA-i5g3BvfmTfPuMxbfLPEa0E,2891
109
109
  alita_sdk/runtime/tools/artifact.py,sha256=yIn-kfI9OWoaxbBeqdqF0M1HPeMtNnvZ_pCPoUIwnCk,8708
110
110
  alita_sdk/runtime/tools/datasource.py,sha256=pvbaSfI-ThQQnjHG-QhYNSTYRnZB0rYtZFpjCfpzxYI,2443
111
111
  alita_sdk/runtime/tools/echo.py,sha256=spw9eCweXzixJqHnZofHE1yWiSUa04L4VKycf3KCEaM,486
112
112
  alita_sdk/runtime/tools/function.py,sha256=ZFpd7TGwIawze2e7BHlKwP0NHwNw42wwrmmnXyJQJhk,2600
113
113
  alita_sdk/runtime/tools/graph.py,sha256=MbnZYqdmvZY7SGDp43lOVVIjUt5ARHSgj43mdtBjSjQ,3092
114
114
  alita_sdk/runtime/tools/indexer_tool.py,sha256=whSLPevB4WD6dhh2JDXEivDmTvbjiMV1MrPl9cz5eLA,4375
115
- alita_sdk/runtime/tools/llm.py,sha256=55pKvoFalDGUc_HpAlzEfUP5cMZRZEUKAj9J0uVBnXk,15129
115
+ alita_sdk/runtime/tools/llm.py,sha256=lVg8t785JLrB2kwIQjpigfhZZP9-BRu-SEUQw6DQyh8,15128
116
116
  alita_sdk/runtime/tools/loop.py,sha256=uds0WhZvwMxDVFI6MZHrcmMle637cQfBNg682iLxoJA,8335
117
117
  alita_sdk/runtime/tools/loop_output.py,sha256=U4hO9PCQgWlXwOq6jdmCGbegtAxGAPXObSxZQ3z38uk,8069
118
118
  alita_sdk/runtime/tools/mcp_server_tool.py,sha256=trGraI8-AwdbNmTKMjfmlBxgTDMTE4-21heCVtd_lz0,4156
@@ -235,7 +235,7 @@ alita_sdk/tools/custom_open_api/api_wrapper.py,sha256=sDSFpvEqpSvXHGiBISdQQcUecf
235
235
  alita_sdk/tools/elastic/__init__.py,sha256=iwnSRppRpzvJ1da2K3Glu8Uu41MhBDCYbguboLkEbW0,2818
236
236
  alita_sdk/tools/elastic/api_wrapper.py,sha256=pl8CqQxteJAGwyOhMcld-ZgtOTFwwbv42OITQVe8rM0,1948
237
237
  alita_sdk/tools/figma/__init__.py,sha256=W6vIMMkZI2Lmpg6_CRRV3oadaIbVI-qTLmKUh6enqWs,4509
238
- alita_sdk/tools/figma/api_wrapper.py,sha256=SjTKCq8FrW1nCP1uFuRw8A2WVKnzEyRmKEr8e3W4QjE,26174
238
+ alita_sdk/tools/figma/api_wrapper.py,sha256=SFuvjhxYgey1qGsO9sakFpY1bK1RSzgAH-uJsAp7FnE,27477
239
239
  alita_sdk/tools/github/__init__.py,sha256=2rHu0zZyZGnLC5CkHgDIhe14N9yCyaEfrrt7ydH8478,5191
240
240
  alita_sdk/tools/github/api_wrapper.py,sha256=uDwYckdnpYRJtb0uZnDkaz2udvdDLVxuCh1tSwspsiU,8411
241
241
  alita_sdk/tools/github/github_client.py,sha256=nxnSXsDul2PPbWvYZS8TmAFFmR-5ALyakNoV5LN2D4U,86617
@@ -349,8 +349,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
349
349
  alita_sdk/tools/zephyr_squad/__init__.py,sha256=0ne8XLJEQSLOWfzd2HdnqOYmQlUliKHbBED5kW_Vias,2895
350
350
  alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
351
351
  alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
352
- alita_sdk-0.3.321b3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
353
- alita_sdk-0.3.321b3.dist-info/METADATA,sha256=9-lhUYajTSe2MsQUUf7xSXAdZm3w_644X-og34Lu_9M,18899
354
- alita_sdk-0.3.321b3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
355
- alita_sdk-0.3.321b3.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
356
- alita_sdk-0.3.321b3.dist-info/RECORD,,
352
+ alita_sdk-0.3.323.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
353
+ alita_sdk-0.3.323.dist-info/METADATA,sha256=H6Stzos-D6Mw5ie9tVXbVrUWFhIZOHkJbE8Jz-dGHao,18897
354
+ alita_sdk-0.3.323.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
355
+ alita_sdk-0.3.323.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
356
+ alita_sdk-0.3.323.dist-info/RECORD,,