alita-sdk 0.3.170__py3-none-any.whl → 0.3.171__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.
@@ -285,7 +285,7 @@ class StateModifierNode(Runnable):
285
285
 
286
286
 
287
287
 
288
- def prepare_output_schema(lg_builder, memory, store, debug=False, interrupt_before=None, interrupt_after=None, state_class=None):
288
+ def prepare_output_schema(lg_builder, memory, store, debug=False, interrupt_before=None, interrupt_after=None, state_class=None, output_variables=None):
289
289
  # prepare output channels
290
290
  if interrupt_after is None:
291
291
  interrupt_after = []
@@ -328,7 +328,8 @@ def prepare_output_schema(lg_builder, memory, store, debug=False, interrupt_befo
328
328
  auto_validate=False,
329
329
  debug=debug,
330
330
  store=store,
331
- schema_to_mapper=state_class
331
+ schema_to_mapper=state_class,
332
+ output_variables=output_variables
332
333
  )
333
334
 
334
335
  compiled.attach_node(START, None)
@@ -597,13 +598,16 @@ def create_graph(
597
598
  lg_builder, memory, store, debug,
598
599
  interrupt_before=interrupt_before,
599
600
  interrupt_after=interrupt_after,
600
- state_class={state_class: None}
601
+ state_class={state_class: None},
602
+ output_variables=node.get('output', [])
601
603
  )
602
604
  return compiled.validate()
603
605
 
604
606
 
605
607
  class LangGraphAgentRunnable(CompiledStateGraph):
606
- builder: CompiledStateGraph
608
+ def __init__(self, *args, output_variables=None, **kwargs):
609
+ super().__init__(*args, **kwargs)
610
+ self.output_variables = output_variables
607
611
 
608
612
  def invoke(self, input: Union[dict[str, Any], Any],
609
613
  config: Optional[RunnableConfig] = None,
@@ -624,7 +628,11 @@ class LangGraphAgentRunnable(CompiledStateGraph):
624
628
  else:
625
629
  result = super().invoke(input, config=config, *args, **kwargs)
626
630
  try:
627
- output = result['messages'][-1].content
631
+ if self.output_variables and self.output_variables[0] != "messages":
632
+ # If output_variables are specified, use the value of first one or use the last messages as default
633
+ output = result.get(self.output_variables[0], result['messages'][-1].content)
634
+ else:
635
+ output = result['messages'][-1].content
628
636
  except:
629
637
  output = list(result.values())[-1]
630
638
  thread_id = None
@@ -4,10 +4,9 @@ from langchain_core.tools import BaseTool, BaseToolkit
4
4
  from pydantic import BaseModel, Field, create_model, SecretStr
5
5
 
6
6
  import requests
7
- from alita_tools.utils import check_connection_response
8
7
  from ...base.tool import BaseAction
9
8
  from .repos_wrapper import ReposApiWrapper
10
- from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length
9
+ from ...utils import clean_string, TOOLKIT_SPLITTER, get_max_toolkit_length, check_connection_response
11
10
 
12
11
  name = "ado_repos"
13
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.170
3
+ Version: 0.3.171
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>, Artem Dubrovskiy <ad13box@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -52,7 +52,7 @@ alita_sdk/runtime/langchain/assistant.py,sha256=QJEMiEOrFMJ4GpnK24U2pKFblrvdQpKF
52
52
  alita_sdk/runtime/langchain/chat_message_template.py,sha256=kPz8W2BG6IMyITFDA5oeb5BxVRkHEVZhuiGl4MBZKdc,2176
53
53
  alita_sdk/runtime/langchain/constants.py,sha256=eHVJ_beJNTf1WJo4yq7KMK64fxsRvs3lKc34QCXSbpk,3319
54
54
  alita_sdk/runtime/langchain/indexer.py,sha256=0ENHy5EOhThnAiYFc7QAsaTNp9rr8hDV_hTK8ahbatk,37592
55
- alita_sdk/runtime/langchain/langraph_agent.py,sha256=-5GsPtWXHSTf650H--dabhBchEf0LoZSQXbyr6eeu6w,39954
55
+ alita_sdk/runtime/langchain/langraph_agent.py,sha256=ac96v-Nr7t1x1NzaOpvV1VuML3LfoNNIDTDl8pb-bSY,40505
56
56
  alita_sdk/runtime/langchain/mixedAgentParser.py,sha256=M256lvtsL3YtYflBCEp-rWKrKtcY1dJIyRGVv7KW9ME,2611
57
57
  alita_sdk/runtime/langchain/mixedAgentRenderes.py,sha256=asBtKqm88QhZRILditjYICwFVKF5KfO38hu2O-WrSWE,5964
58
58
  alita_sdk/runtime/langchain/store_manager.py,sha256=w5-0GbPGJAw14g0CCD9BKFMznzk1I-iJ5OGj_HZJZgA,2211
@@ -133,7 +133,7 @@ alita_sdk/tools/__init__.py,sha256=48DhEi14KkaYhNb-KvXuM9XJ4WGC-v9sRcWfN7GFWd4,9
133
133
  alita_sdk/tools/elitea_base.py,sha256=NQaIxPX6DVIerHCb18jwUR6maZxxk73NZaTsFHkBQWE,21119
134
134
  alita_sdk/tools/ado/__init__.py,sha256=mD6GHcYMTtffPJkJvFPe2rzvye_IRmXmWfI7xYuZhO4,912
135
135
  alita_sdk/tools/ado/utils.py,sha256=PTCludvaQmPLakF2EbCGy66Mro4-rjDtavVP-xcB2Wc,1252
136
- alita_sdk/tools/ado/repos/__init__.py,sha256=1gieQi1YWGT8-1lXCLnYTqDoAD8Zlx09H1KzlLV9KpA,5715
136
+ alita_sdk/tools/ado/repos/__init__.py,sha256=Wro7xo1GcpX4M4yPBqDKFFE2wCCVzj0HyusdAmloxKM,5686
137
137
  alita_sdk/tools/ado/repos/repos_wrapper.py,sha256=_OWKAls7VFfFtEPTwqj_DxE1MSvpC0ivxdTIULEz3Tk,48206
138
138
  alita_sdk/tools/ado/test_plan/__init__.py,sha256=ctn2CUkH_xS0Wkv2gLrO3FHQ36BvNCc0VcpMuddvU8E,3404
139
139
  alita_sdk/tools/ado/test_plan/test_plan_wrapper.py,sha256=oIvVhLUMP5ZGctoAtK6sU0y6Si9gNv9-mbLqcWtw3gY,12525
@@ -326,8 +326,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=UHVQUVqcBc3SZvDfO78HSuBzwAsRw
326
326
  alita_sdk/tools/zephyr_squad/__init__.py,sha256=rq4jOb3lRW2GXvAguk4H1KinO5f-zpygzhBJf-E1Ucw,2773
327
327
  alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=iOMxyE7vOc_LwFB_nBMiSFXkNtvbptA4i-BrTlo7M0A,5854
328
328
  alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=IYUJoMFOMA70knLhLtAnuGoy3OK80RuqeQZ710oyIxE,3631
329
- alita_sdk-0.3.170.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
330
- alita_sdk-0.3.170.dist-info/METADATA,sha256=Djs8vf5jNVfyDSg3HQxk9usbGV1nfetOVO_JZyWOcW0,18757
331
- alita_sdk-0.3.170.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
332
- alita_sdk-0.3.170.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
333
- alita_sdk-0.3.170.dist-info/RECORD,,
329
+ alita_sdk-0.3.171.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
330
+ alita_sdk-0.3.171.dist-info/METADATA,sha256=XzQcB4rHIu9pHDX2k-Nj4edZSzgeTFpQA4xyLyfPUVw,18757
331
+ alita_sdk-0.3.171.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
332
+ alita_sdk-0.3.171.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
333
+ alita_sdk-0.3.171.dist-info/RECORD,,