alita-sdk 0.3.431__py3-none-any.whl → 0.3.432__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.
- alita_sdk/runtime/toolkits/mcp.py +9 -1
- alita_sdk/runtime/tools/mcp_inspect_tool.py +22 -14
- {alita_sdk-0.3.431.dist-info → alita_sdk-0.3.432.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.431.dist-info → alita_sdk-0.3.432.dist-info}/RECORD +7 -7
- {alita_sdk-0.3.431.dist-info → alita_sdk-0.3.432.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.431.dist-info → alita_sdk-0.3.432.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.431.dist-info → alita_sdk-0.3.432.dist-info}/top_level.txt +0 -0
|
@@ -346,7 +346,15 @@ class McpToolkit(BaseToolkit):
|
|
|
346
346
|
if response.status_code != 200:
|
|
347
347
|
raise Exception(f"HTTP {response.status_code}: {response.text}")
|
|
348
348
|
|
|
349
|
-
|
|
349
|
+
# Check if response is actually JSON
|
|
350
|
+
content_type = response.headers.get('Content-Type', '')
|
|
351
|
+
if 'application/json' not in content_type:
|
|
352
|
+
raise Exception(f"Expected JSON response but got Content-Type: {content_type}. Response: {response.text[:200]}")
|
|
353
|
+
|
|
354
|
+
try:
|
|
355
|
+
data = response.json()
|
|
356
|
+
except ValueError as json_err:
|
|
357
|
+
raise Exception(f"Invalid JSON response: {json_err}. Response text: {response.text[:200]}")
|
|
350
358
|
|
|
351
359
|
if "error" in data:
|
|
352
360
|
raise Exception(f"MCP Error: {data['error']}")
|
|
@@ -65,21 +65,17 @@ class McpInspectTool(BaseTool):
|
|
|
65
65
|
def _run(self, resource_type: str = "all") -> str:
|
|
66
66
|
"""Inspect the MCP server for available resources."""
|
|
67
67
|
try:
|
|
68
|
-
#
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
future = executor.submit(self._run_async_inspection, resource_type)
|
|
75
|
-
return future.result(timeout=self.timeout)
|
|
76
|
-
else:
|
|
77
|
-
return loop.run_until_complete(self._run_async_inspection(resource_type))
|
|
68
|
+
# Always create a new event loop for sync context
|
|
69
|
+
# This avoids issues with existing event loops in threads
|
|
70
|
+
import concurrent.futures
|
|
71
|
+
with concurrent.futures.ThreadPoolExecutor() as executor:
|
|
72
|
+
future = executor.submit(self._run_in_new_loop, resource_type)
|
|
73
|
+
return future.result(timeout=self.timeout)
|
|
78
74
|
except Exception as e:
|
|
79
75
|
logger.error(f"Error inspecting MCP server '{self.server_name}': {e}")
|
|
80
76
|
return f"Error inspecting MCP server: {e}"
|
|
81
77
|
|
|
82
|
-
def
|
|
78
|
+
def _run_in_new_loop(self, resource_type: str) -> str:
|
|
83
79
|
"""Run the async inspection in a new event loop."""
|
|
84
80
|
return asyncio.run(self._inspect_server(resource_type))
|
|
85
81
|
|
|
@@ -132,7 +128,11 @@ class McpInspectTool(BaseTool):
|
|
|
132
128
|
"params": {}
|
|
133
129
|
}
|
|
134
130
|
|
|
135
|
-
headers = {
|
|
131
|
+
headers = {
|
|
132
|
+
"Content-Type": "application/json",
|
|
133
|
+
"Accept": "application/json, text/event-stream",
|
|
134
|
+
**self.server_headers
|
|
135
|
+
}
|
|
136
136
|
|
|
137
137
|
async with session.post(self.server_url, json=request, headers=headers) as response:
|
|
138
138
|
if response.status != 200:
|
|
@@ -154,7 +154,11 @@ class McpInspectTool(BaseTool):
|
|
|
154
154
|
"params": {}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
headers = {
|
|
157
|
+
headers = {
|
|
158
|
+
"Content-Type": "application/json",
|
|
159
|
+
"Accept": "application/json, text/event-stream",
|
|
160
|
+
**self.server_headers
|
|
161
|
+
}
|
|
158
162
|
|
|
159
163
|
async with session.post(self.server_url, json=request, headers=headers) as response:
|
|
160
164
|
if response.status != 200:
|
|
@@ -176,7 +180,11 @@ class McpInspectTool(BaseTool):
|
|
|
176
180
|
"params": {}
|
|
177
181
|
}
|
|
178
182
|
|
|
179
|
-
headers = {
|
|
183
|
+
headers = {
|
|
184
|
+
"Content-Type": "application/json",
|
|
185
|
+
"Accept": "application/json, text/event-stream",
|
|
186
|
+
**self.server_headers
|
|
187
|
+
}
|
|
180
188
|
|
|
181
189
|
async with session.post(self.server_url, json=request, headers=headers) as response:
|
|
182
190
|
if response.status != 200:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alita_sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.432
|
|
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
|
|
@@ -103,7 +103,7 @@ alita_sdk/runtime/toolkits/application.py,sha256=HHAKgwKOckxc7EQG-AV7rz4POOzQJKF
|
|
|
103
103
|
alita_sdk/runtime/toolkits/artifact.py,sha256=YChNCX4QhVpaQG7Jk4TS-Wl0Aruc4slQ2K21zh9nNO0,3176
|
|
104
104
|
alita_sdk/runtime/toolkits/configurations.py,sha256=kIDAlnryPQfbZyFxV-9SzN2-Vefzx06TX1BBdIIpN90,141
|
|
105
105
|
alita_sdk/runtime/toolkits/datasource.py,sha256=qk78OdPoReYPCWwahfkKLbKc4pfsu-061oXRryFLP6I,2498
|
|
106
|
-
alita_sdk/runtime/toolkits/mcp.py,sha256=
|
|
106
|
+
alita_sdk/runtime/toolkits/mcp.py,sha256=lh1REOY680Q3yP4DfmzFLllmJIZy1IM90NZd1CwLrDY,25730
|
|
107
107
|
alita_sdk/runtime/toolkits/prompt.py,sha256=WIpTkkVYWqIqOWR_LlSWz3ug8uO9tm5jJ7aZYdiGRn0,1192
|
|
108
108
|
alita_sdk/runtime/toolkits/subgraph.py,sha256=wwUK8JjPXkGzyVZ3tAukmvST6eGbqx_U11rpnmbrvtg,2105
|
|
109
109
|
alita_sdk/runtime/toolkits/tools.py,sha256=YCTjrTJuwj2V2C8ZQqXhFvUbVr7NQcUHZlCQLLvoeGA,10946
|
|
@@ -121,7 +121,7 @@ alita_sdk/runtime/tools/indexer_tool.py,sha256=whSLPevB4WD6dhh2JDXEivDmTvbjiMV1M
|
|
|
121
121
|
alita_sdk/runtime/tools/llm.py,sha256=iRG_wU4T01LRsjEMPZe5Uah7LiMqDc-vspwkMuQtltk,16136
|
|
122
122
|
alita_sdk/runtime/tools/loop.py,sha256=uds0WhZvwMxDVFI6MZHrcmMle637cQfBNg682iLxoJA,8335
|
|
123
123
|
alita_sdk/runtime/tools/loop_output.py,sha256=U4hO9PCQgWlXwOq6jdmCGbegtAxGAPXObSxZQ3z38uk,8069
|
|
124
|
-
alita_sdk/runtime/tools/mcp_inspect_tool.py,sha256=
|
|
124
|
+
alita_sdk/runtime/tools/mcp_inspect_tool.py,sha256=wgnv0z9MvB-PWriGKHHpY2IMxjBkd7Cbz4kvwGp9aq8,10243
|
|
125
125
|
alita_sdk/runtime/tools/mcp_server_tool.py,sha256=y6y0j3JeUajNatpsLVJfP0JEknhlRcDRJ0PlJ3Ch8fA,6626
|
|
126
126
|
alita_sdk/runtime/tools/pgvector_search.py,sha256=NN2BGAnq4SsDHIhUcFZ8d_dbEOM8QwB0UwpsWCYruXU,11692
|
|
127
127
|
alita_sdk/runtime/tools/prompt.py,sha256=nJafb_e5aOM1Rr3qGFCR-SKziU9uCsiP2okIMs9PppM,741
|
|
@@ -358,8 +358,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=kT0TbmMvuKhDUZc0i7KO18O38JM9S
|
|
|
358
358
|
alita_sdk/tools/zephyr_squad/__init__.py,sha256=0ne8XLJEQSLOWfzd2HdnqOYmQlUliKHbBED5kW_Vias,2895
|
|
359
359
|
alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
|
|
360
360
|
alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
|
|
361
|
-
alita_sdk-0.3.
|
|
362
|
-
alita_sdk-0.3.
|
|
363
|
-
alita_sdk-0.3.
|
|
364
|
-
alita_sdk-0.3.
|
|
365
|
-
alita_sdk-0.3.
|
|
361
|
+
alita_sdk-0.3.432.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
362
|
+
alita_sdk-0.3.432.dist-info/METADATA,sha256=5ta9EQvl3qdFIGaqQCAQLW9VWo7PYJRHdNmffxCbdK8,19071
|
|
363
|
+
alita_sdk-0.3.432.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
364
|
+
alita_sdk-0.3.432.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
|
365
|
+
alita_sdk-0.3.432.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|