alita-sdk 0.3.445__py3-none-any.whl → 0.3.446__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.

@@ -12,7 +12,7 @@ from concurrent.futures import ThreadPoolExecutor
12
12
  from typing import Any, Dict, Optional
13
13
 
14
14
  from .mcp_server_tool import McpServerTool
15
- from pydantic import Field, computed_field
15
+ from pydantic import Field
16
16
  from ..utils.mcp_oauth import (
17
17
  McpAuthorizationRequired,
18
18
  canonical_resource,
@@ -38,11 +38,20 @@ class McpRemoteTool(McpServerTool):
38
38
  prompt_name: Optional[str] = None # Original prompt name if this is a prompt
39
39
  session_id: Optional[str] = Field(default=None, description="MCP session ID for stateful SSE servers")
40
40
 
41
- @computed_field
42
- @property
43
- def metadata(self) -> dict:
44
- """Return tool metadata including session information for UI."""
45
- return self.get_session_metadata()
41
+ def model_post_init(self, __context: Any) -> None:
42
+ """Update metadata with session info after model initialization."""
43
+ super().model_post_init(__context)
44
+ self._update_metadata_with_session()
45
+
46
+ def _update_metadata_with_session(self):
47
+ """Update the metadata dict with current session information."""
48
+ if self.session_id:
49
+ if self.metadata is None:
50
+ self.metadata = {}
51
+ self.metadata.update({
52
+ 'mcp_session_id': self.session_id,
53
+ 'mcp_server_url': canonical_resource(self.server_url)
54
+ })
46
55
 
47
56
  def __getstate__(self):
48
57
  """Custom serialization for pickle compatibility."""
@@ -201,6 +210,8 @@ class McpRemoteTool(McpServerTool):
201
210
  if session_id:
202
211
  # Retry the request with session
203
212
  self.session_id = session_id
213
+ # Update metadata so callbacks can access session info
214
+ self._update_metadata_with_session()
204
215
  separator = '&' if '?' in self.server_url else '?'
205
216
  retry_url = f"{self.server_url}{separator}sessionId={session_id}"
206
217
  logger.info(f"[MCP Session] Retrying tool call with new session: {session_id}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.445
3
+ Version: 0.3.446
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
@@ -122,7 +122,7 @@ alita_sdk/runtime/tools/llm.py,sha256=iRG_wU4T01LRsjEMPZe5Uah7LiMqDc-vspwkMuQtlt
122
122
  alita_sdk/runtime/tools/loop.py,sha256=uds0WhZvwMxDVFI6MZHrcmMle637cQfBNg682iLxoJA,8335
123
123
  alita_sdk/runtime/tools/loop_output.py,sha256=U4hO9PCQgWlXwOq6jdmCGbegtAxGAPXObSxZQ3z38uk,8069
124
124
  alita_sdk/runtime/tools/mcp_inspect_tool.py,sha256=38X8euaxDbEGjcfp6ElvExZalpZun6QEr6ZEW4nU5pQ,11496
125
- alita_sdk/runtime/tools/mcp_remote_tool.py,sha256=12-EaNqvU0qbJ0ur-L34Ssi4J0n0QyNrozI4gSyHaSU,15294
125
+ alita_sdk/runtime/tools/mcp_remote_tool.py,sha256=ypOJE7MhdPAQqIIjtirH4OzVNFbZeZuwy0Sw1H2CQJ0,15866
126
126
  alita_sdk/runtime/tools/mcp_server_tool.py,sha256=-xO3H6BM63KaIV1CdcQKPVE0WPigiqOgFZDX7m2_yGs,4419
127
127
  alita_sdk/runtime/tools/pgvector_search.py,sha256=NN2BGAnq4SsDHIhUcFZ8d_dbEOM8QwB0UwpsWCYruXU,11692
128
128
  alita_sdk/runtime/tools/prompt.py,sha256=nJafb_e5aOM1Rr3qGFCR-SKziU9uCsiP2okIMs9PppM,741
@@ -360,8 +360,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
360
360
  alita_sdk/tools/zephyr_squad/__init__.py,sha256=0ne8XLJEQSLOWfzd2HdnqOYmQlUliKHbBED5kW_Vias,2895
361
361
  alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
362
362
  alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
363
- alita_sdk-0.3.445.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
364
- alita_sdk-0.3.445.dist-info/METADATA,sha256=eTg9o5vUnq9FRBtfxGhWQEvcFmx1G5UvbJNpwLU1V3Y,19071
365
- alita_sdk-0.3.445.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
366
- alita_sdk-0.3.445.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
367
- alita_sdk-0.3.445.dist-info/RECORD,,
363
+ alita_sdk-0.3.446.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
364
+ alita_sdk-0.3.446.dist-info/METADATA,sha256=akIEnIoOfAXzb6sKj1ef-dWGEr3ySjKbdQhNYkdHNdE,19071
365
+ alita_sdk-0.3.446.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
366
+ alita_sdk-0.3.446.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
367
+ alita_sdk-0.3.446.dist-info/RECORD,,