malevich-coretools 0.3.43__tar.gz → 0.3.45__tar.gz
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 malevich-coretools might be problematic. Click here for more details.
- {malevich_coretools-0.3.43/malevich_coretools.egg-info → malevich_coretools-0.3.45}/PKG-INFO +3 -2
- malevich_coretools-0.3.45/VERSION +1 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/abstract/abstract.py +21 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/batch/utils.py +1 -1
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/funcs/funcs.py +72 -6
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/funcs/helpers.py +2 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/secondary/const.py +9 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/secondary/helpers.py +9 -3
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/utils.py +150 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45/malevich_coretools.egg-info}/PKG-INFO +3 -2
- malevich_coretools-0.3.43/VERSION +0 -1
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/LICENSE +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/MANIFEST.in +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/README.md +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/__init__.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/abstract/__init__.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/abstract/operations.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/abstract/pipeline.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/abstract/statuses.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/admin/__init__.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/admin/utils.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/batch/__init__.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/funcs/__init__.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/funcs/checks.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/secondary/__init__.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/secondary/config.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/secondary/kafka_utils.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/tools/__init__.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/tools/abstract.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/tools/vast.py +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools.egg-info/SOURCES.txt +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools.egg-info/dependency_links.txt +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools.egg-info/requires.txt +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools.egg-info/top_level.txt +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/pyproject.toml +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/requirements.txt +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/setup.cfg +0 -0
- {malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/setup.py +0 -0
{malevich_coretools-0.3.43/malevich_coretools.egg-info → malevich_coretools-0.3.45}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: malevich-coretools
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.45
|
|
4
4
|
Author: Andrew Pogrebnoj
|
|
5
5
|
Author-email: andrew@onjulius.co
|
|
6
6
|
License-File: LICENSE
|
|
@@ -11,4 +11,5 @@ Requires-Dist: aiohttp
|
|
|
11
11
|
Requires-Dist: kafka-python
|
|
12
12
|
Dynamic: author
|
|
13
13
|
Dynamic: author-email
|
|
14
|
+
Dynamic: license-file
|
|
14
15
|
Dynamic: requires-dist
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.3.45
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/abstract/abstract.py
RENAMED
|
@@ -589,6 +589,7 @@ class BasePlatformSettings(BaseModel):
|
|
|
589
589
|
cpuLimit: Optional[int] = None
|
|
590
590
|
storageRequest: Optional[int] = None
|
|
591
591
|
storageLimit: Optional[int] = None
|
|
592
|
+
kubeconfig: Optional[str] = None
|
|
592
593
|
|
|
593
594
|
|
|
594
595
|
class Limits(BasePlatformSettings):
|
|
@@ -628,3 +629,23 @@ class WSApp(BaseModel):
|
|
|
628
629
|
|
|
629
630
|
class WSApps(BaseModel):
|
|
630
631
|
data: List[WSApp]
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
class MCPToolSimple(BaseModel):
|
|
635
|
+
name: Optional[str] # can be None on updates
|
|
636
|
+
description: Optional[str] = None
|
|
637
|
+
inputSchema: Optional[Dict[str, Any]] = None
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
class MCPTool(MCPToolSimple):
|
|
641
|
+
id: Optional[str] = None # None if create, id otherwise
|
|
642
|
+
taskId: Optional[str] = None
|
|
643
|
+
pipelineId: Optional[str] = None
|
|
644
|
+
cfgId: Optional[str] = None
|
|
645
|
+
runSettings: Optional[RunSettings] = None
|
|
646
|
+
enableNotAuthorized: Optional[bool] = False
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
class MCPToolCall(BaseModel):
|
|
650
|
+
name: str
|
|
651
|
+
arguments: Dict[str, Any]
|
|
@@ -80,7 +80,7 @@ class DefferOperationInternal(str):
|
|
|
80
80
|
if self.__result_model is not None and self.__code < 400: # ok
|
|
81
81
|
try:
|
|
82
82
|
from malevich_coretools.secondary import model_from_json
|
|
83
|
-
self.__data = model_from_json(res, self.__result_model)
|
|
83
|
+
self.__data = model_from_json(res, self.__result_model, is_list=None)
|
|
84
84
|
except BaseException:
|
|
85
85
|
Config.logger.error(f"parse {self.__alias} failed, model={self.__result_model.__name__}")
|
|
86
86
|
self.__data = res
|
|
@@ -1107,11 +1107,11 @@ async def post_admin_update_superuser_async(data: Superuser, *args, **kwargs) ->
|
|
|
1107
1107
|
|
|
1108
1108
|
|
|
1109
1109
|
def delete_admin_runs(data: AdminStopOperation, *args, **kwargs) -> Alias.Json:
|
|
1110
|
-
return send_to_core_modify(ADMIN_RUNS, data,
|
|
1110
|
+
return send_to_core_modify(ADMIN_RUNS, data, *args, **kwargs, is_post=False)
|
|
1111
1111
|
|
|
1112
1112
|
|
|
1113
1113
|
async def delete_admin_runs_async(data: AdminStopOperation, *args, **kwargs) -> Alias.Json:
|
|
1114
|
-
return await send_to_core_modify_async(ADMIN_RUNS, data,
|
|
1114
|
+
return await send_to_core_modify_async(ADMIN_RUNS, data, *args, **kwargs, is_post=False)
|
|
1115
1115
|
|
|
1116
1116
|
# ManagerController
|
|
1117
1117
|
|
|
@@ -1473,19 +1473,85 @@ async def post_ws_apps_async(wait: bool, *args, **kwargs) -> WSApp:
|
|
|
1473
1473
|
|
|
1474
1474
|
|
|
1475
1475
|
def delete_ws_apps_id(id: str, wait: bool, *args, **kwargs) -> Alias.Info:
|
|
1476
|
-
return send_to_core_modify(WS_APPS_ID(id, wait), *args, **kwargs)
|
|
1476
|
+
return send_to_core_modify(WS_APPS_ID(id, wait), *args, **kwargs, is_post=False)
|
|
1477
1477
|
|
|
1478
1478
|
|
|
1479
1479
|
async def delete_ws_apps_id_async(id: str, wait: bool, *args, **kwargs) -> Alias.Info:
|
|
1480
|
-
return await send_to_core_modify_async(WS_APPS_ID(id, wait), *args, **kwargs)
|
|
1480
|
+
return await send_to_core_modify_async(WS_APPS_ID(id, wait), *args, **kwargs, is_post=False)
|
|
1481
1481
|
|
|
1482
1482
|
|
|
1483
1483
|
def delete_ws_apps(only_not_active: bool, wait: bool, *args, **kwargs) -> Alias.Info:
|
|
1484
|
-
return send_to_core_modify(WS_APPS_(only_not_active, wait), *args, **kwargs)
|
|
1484
|
+
return send_to_core_modify(WS_APPS_(only_not_active, wait), *args, **kwargs, is_post=False)
|
|
1485
1485
|
|
|
1486
1486
|
|
|
1487
1487
|
async def delete_ws_apps_async(only_not_active: bool, wait: bool, *args, **kwargs) -> Alias.Info:
|
|
1488
|
-
return await send_to_core_modify_async(WS_APPS_(only_not_active, wait), *args, **kwargs)
|
|
1488
|
+
return await send_to_core_modify_async(WS_APPS_(only_not_active, wait), *args, **kwargs, is_post=False)
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
def get_mcp_tools(*args, **kwargs) -> List[MCPTool]:
|
|
1492
|
+
return model_from_json(send_to_core_get(MCP_TOOLS_ALL(None), *args, **kwargs), MCPTool, is_list=True)
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
async def get_mcp_tools_async(*args, **kwargs) -> List[MCPTool]:
|
|
1496
|
+
return model_from_json(await send_to_core_get_async(MCP_TOOLS_ALL(None), *args, **kwargs), MCPTool, is_list=True)
|
|
1497
|
+
|
|
1498
|
+
|
|
1499
|
+
def get_mcp_tools_list(*args, **kwargs) -> List[MCPToolSimple]:
|
|
1500
|
+
return model_from_json(send_to_core_get(MCP_TOOLS_LIST, *args, **kwargs), MCPToolSimple, is_list=True)
|
|
1501
|
+
|
|
1502
|
+
|
|
1503
|
+
async def get_mcp_tools_list_async(*args, **kwargs) -> List[MCPToolSimple]:
|
|
1504
|
+
return model_from_json(await send_to_core_get_async(MCP_TOOLS_LIST, *args, **kwargs), MCPToolSimple, is_list=True)
|
|
1505
|
+
|
|
1506
|
+
|
|
1507
|
+
def get_mcp_tool_id_name(id: Optional[str], name: Optional[str], *args, **kwargs) -> MCPTool:
|
|
1508
|
+
return model_from_json(send_to_core_get(MCP_TOOLS(id, name, None), *args, **kwargs), MCPTool)
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
async def get_mcp_tool_id_name_async(id: Optional[str], name: Optional[str], *args, **kwargs) -> MCPTool:
|
|
1512
|
+
return model_from_json(await send_to_core_get_async(MCP_TOOLS(id, name, None), *args, **kwargs), MCPTool)
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
def post_mcp_tool(data, wait: bool, *args, **kwargs) -> Alias.Id:
|
|
1516
|
+
return send_to_core_modify(MCP_TOOLS(None, None, wait), data, *args, **kwargs)
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
async def post_mcp_tool_async(data, wait: bool, *args, **kwargs) -> Alias.Id:
|
|
1520
|
+
return await send_to_core_modify_async(MCP_TOOLS(None, None, wait), data, *args, **kwargs)
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
def call_mcp_tool(data: MCPToolCall, with_show: bool, *args, **kwargs) -> Union[AppLogsWithResults, Any]:
|
|
1524
|
+
res = send_to_core_modify(MCP_TOOLS_CALL, data, with_show=with_show, show_func=show_logs_func, *args, **kwargs)
|
|
1525
|
+
try:
|
|
1526
|
+
res = AppLogsWithResults.model_validate_json(res)
|
|
1527
|
+
except BaseException:
|
|
1528
|
+
pass
|
|
1529
|
+
return res
|
|
1530
|
+
|
|
1531
|
+
|
|
1532
|
+
async def call_mcp_tool_async(data: MCPToolCall, with_show: bool, *args, **kwargs) -> Union[AppLogsWithResults, Any]:
|
|
1533
|
+
res = await send_to_core_modify_async(MCP_TOOLS_CALL, data, with_show=with_show, show_func=show_logs_func, *args, **kwargs)
|
|
1534
|
+
try:
|
|
1535
|
+
res = AppLogsWithResults.model_validate_json(res)
|
|
1536
|
+
except BaseException:
|
|
1537
|
+
pass
|
|
1538
|
+
return res
|
|
1539
|
+
|
|
1540
|
+
|
|
1541
|
+
def delete_mcp_tool_id_name(id: str, name: str, wait: bool, *args, **kwargs) -> Alias.Info:
|
|
1542
|
+
return send_to_core_modify(MCP_TOOLS(id, name, wait), *args, **kwargs, is_post=False)
|
|
1543
|
+
|
|
1544
|
+
|
|
1545
|
+
async def delete_mcp_tool_id_name_async(id: str, name: str, wait: bool, *args, **kwargs) -> Alias.Info:
|
|
1546
|
+
return await send_to_core_modify_async(MCP_TOOLS(id, name, wait), *args, **kwargs, is_post=False)
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
def delete_mcp_tools(wait: bool, *args, **kwargs) -> Alias.Info:
|
|
1550
|
+
return send_to_core_modify(MCP_TOOLS_ALL(wait), *args, **kwargs, is_post=False)
|
|
1551
|
+
|
|
1552
|
+
|
|
1553
|
+
async def delete_mcp_tools_async(wait: bool, *args, **kwargs) -> Alias.Info:
|
|
1554
|
+
return await send_to_core_modify_async(MCP_TOOLS_ALL(wait), *args, **kwargs, is_post=False)
|
|
1489
1555
|
|
|
1490
1556
|
|
|
1491
1557
|
async def kafka_send(data: KafkaMsg, *args, **kwargs) -> Union[Alias.Info, KafkaMsg]:
|
|
@@ -332,6 +332,7 @@ def base_settings(
|
|
|
332
332
|
cpu_limit: Optional[int] = None,
|
|
333
333
|
storage_request: Optional[int] = None,
|
|
334
334
|
storage_limit: Optional[int] = None,
|
|
335
|
+
kubeconfig: Optional[str] = None,
|
|
335
336
|
) -> str:
|
|
336
337
|
return BasePlatformSettings(
|
|
337
338
|
memoryRequest=memory_request,
|
|
@@ -340,4 +341,5 @@ def base_settings(
|
|
|
340
341
|
cpuLimit=cpu_limit,
|
|
341
342
|
storageRequest=storage_request,
|
|
342
343
|
storageLimit=storage_limit,
|
|
344
|
+
kubeconfig=kubeconfig,
|
|
343
345
|
).model_dump_json()
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/secondary/const.py
RENAMED
|
@@ -30,6 +30,8 @@ def with_key_values(url: str, key_values: Dict[str, Optional[str]]) -> str:
|
|
|
30
30
|
value = urllib.parse.quote(str(value), safe='')
|
|
31
31
|
elif isinstance(value, str):
|
|
32
32
|
value = urllib.parse.quote(value, safe='')
|
|
33
|
+
elif isinstance(value, bool):
|
|
34
|
+
value = bool_to_str(value)
|
|
33
35
|
url = f"{url}{sep}{key}={value}"
|
|
34
36
|
if sep == "?":
|
|
35
37
|
sep = "&"
|
|
@@ -216,6 +218,13 @@ WS_APPS = lambda only_active, full: with_key_values(f"{WS_APPS_MAIN}/", {"onlyAc
|
|
|
216
218
|
WS_APPS_ = lambda only_not_active, wait: with_key_values(f"{WS_APPS_MAIN}/", {"onlyNotActive": only_not_active, "wait": wait})
|
|
217
219
|
WS_APPS_ID = lambda id, wait: with_wait(f"{WS_APPS_MAIN}/{id}", wait)
|
|
218
220
|
|
|
221
|
+
## McpToolController
|
|
222
|
+
MCP_TOOLS_MAIN = f"{API_VERSION}/tools"
|
|
223
|
+
MCP_TOOLS = lambda id, name, wait: with_key_values(f"{MCP_TOOLS_MAIN}/", {"id": id, "name": name, "wait": wait})
|
|
224
|
+
MCP_TOOLS_ALL = lambda wait: with_wait(f"{MCP_TOOLS_MAIN}/all", wait)
|
|
225
|
+
MCP_TOOLS_LIST = f"{MCP_TOOLS_MAIN}/list"
|
|
226
|
+
MCP_TOOLS_CALL = f"{MCP_TOOLS_MAIN}/call"
|
|
227
|
+
|
|
219
228
|
### Kafka
|
|
220
229
|
KAFKA_SEND = f"{MANAGER_MAIN}/kafkaMsg"
|
|
221
230
|
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/secondary/helpers.py
RENAMED
|
@@ -35,11 +35,17 @@ def to_json(data: Union[Dict[str, Any], Alias.Json], condition_and_msg: Tuple[Ca
|
|
|
35
35
|
return res
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
def model_from_json(data: Union[Dict[str, Any], Alias.Json], model: BaseModel): # noqa: ANN201
|
|
38
|
+
def model_from_json(data: Union[Dict[str, Any], Alias.Json], model: BaseModel, is_list: Optional[bool] = False): # noqa: ANN201
|
|
39
39
|
if isinstance(data, Alias.Json):
|
|
40
40
|
data = json.loads(data)
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
if is_list is None:
|
|
42
|
+
is_list = isinstance(data, list)
|
|
43
|
+
if is_list:
|
|
44
|
+
assert isinstance(data, list), data
|
|
45
|
+
return [model.model_validate(item) for item in data]
|
|
46
|
+
else:
|
|
47
|
+
assert isinstance(data, dict), data
|
|
48
|
+
return model.model_validate(data)
|
|
43
49
|
|
|
44
50
|
|
|
45
51
|
def rand_str(size: int = 10, chars=string.ascii_letters) -> str:
|
|
@@ -4225,6 +4225,156 @@ def delete_ws_apps(
|
|
|
4225
4225
|
return f.delete_ws_apps(only_not_active, wait=wait, auth=auth, conn_url=conn_url)
|
|
4226
4226
|
|
|
4227
4227
|
|
|
4228
|
+
# MCP Tools
|
|
4229
|
+
|
|
4230
|
+
|
|
4231
|
+
def get_mcp_tools(
|
|
4232
|
+
*,
|
|
4233
|
+
auth: Optional[AUTH] = None,
|
|
4234
|
+
conn_url: Optional[str] = None,
|
|
4235
|
+
batcher: Optional[Batcher] = None,
|
|
4236
|
+
is_async: bool = False,
|
|
4237
|
+
) -> List[MCPTool]:
|
|
4238
|
+
"""return list of mcp tools"""
|
|
4239
|
+
if batcher is None:
|
|
4240
|
+
batcher = Config.BATCHER
|
|
4241
|
+
if batcher is not None:
|
|
4242
|
+
return batcher.add("getMcpTools", result_model=MCPTool) # list of it
|
|
4243
|
+
if is_async:
|
|
4244
|
+
return f.get_mcp_tools_async(auth=auth, conn_url=conn_url)
|
|
4245
|
+
return f.get_mcp_tools(auth=auth, conn_url=conn_url)
|
|
4246
|
+
|
|
4247
|
+
|
|
4248
|
+
def get_mcp_tools_list(
|
|
4249
|
+
*,
|
|
4250
|
+
with_auth: bool = True,
|
|
4251
|
+
auth: Optional[AUTH] = None,
|
|
4252
|
+
conn_url: Optional[str] = None,
|
|
4253
|
+
batcher: Optional[Batcher] = None,
|
|
4254
|
+
is_async: bool = False,
|
|
4255
|
+
) -> List[MCPToolSimple]:
|
|
4256
|
+
"""return list of mcp tools (simple)"""
|
|
4257
|
+
if batcher is None:
|
|
4258
|
+
batcher = Config.BATCHER
|
|
4259
|
+
if batcher is not None:
|
|
4260
|
+
return batcher.add("getMcpToolsSimple", result_model=MCPToolSimple) # list of it
|
|
4261
|
+
if is_async:
|
|
4262
|
+
return f.get_mcp_tools_list_async(with_auth=with_auth, auth=auth, conn_url=conn_url)
|
|
4263
|
+
return f.get_mcp_tools_list(with_auth=with_auth, auth=auth, conn_url=conn_url)
|
|
4264
|
+
|
|
4265
|
+
|
|
4266
|
+
def get_mcp_tool(
|
|
4267
|
+
id: Optional[str] = None,
|
|
4268
|
+
name: Optional[str] = None,
|
|
4269
|
+
*,
|
|
4270
|
+
with_auth: bool = True,
|
|
4271
|
+
auth: Optional[AUTH] = None,
|
|
4272
|
+
conn_url: Optional[str] = None,
|
|
4273
|
+
batcher: Optional[Batcher] = None,
|
|
4274
|
+
is_async: bool = False,
|
|
4275
|
+
) -> Union[MCPToolSimple, MCPTool]:
|
|
4276
|
+
"""return mcp tool struct by `id` or `name` """
|
|
4277
|
+
assert id is not None or name is not None, "id or name should be set"
|
|
4278
|
+
if batcher is None:
|
|
4279
|
+
batcher = Config.BATCHER
|
|
4280
|
+
if batcher is not None:
|
|
4281
|
+
return batcher.add("getMcpToolByIdOrName", vars={"id": id, "name": name}, result_model=MCPTool)
|
|
4282
|
+
if is_async:
|
|
4283
|
+
return f.get_mcp_tool_id_name_async(id, name, with_auth=with_auth, auth=auth, conn_url=conn_url)
|
|
4284
|
+
return f.get_mcp_tool_id_name(id, name, with_auth=with_auth, auth=auth, conn_url=conn_url)
|
|
4285
|
+
|
|
4286
|
+
|
|
4287
|
+
def post_mcp_tool(
|
|
4288
|
+
name: str,
|
|
4289
|
+
description: Optional[str] = None,
|
|
4290
|
+
input_schema: Optional[Dict[str, Any]] = None,
|
|
4291
|
+
task_id: Optional[str] = None,
|
|
4292
|
+
pipeline_id: Optional[str] = None,
|
|
4293
|
+
cfg_id: Optional[str] = None,
|
|
4294
|
+
run_settings: Optional[RunSettings] = None,
|
|
4295
|
+
enable_not_auth: Optional[str] = None,
|
|
4296
|
+
id: Optional[str] = None, # set it on update
|
|
4297
|
+
wait: bool = True,
|
|
4298
|
+
*,
|
|
4299
|
+
auth: Optional[AUTH] = None,
|
|
4300
|
+
conn_url: Optional[str] = None,
|
|
4301
|
+
batcher: Optional[Batcher] = None,
|
|
4302
|
+
is_async: bool = False,
|
|
4303
|
+
) -> Alias.Id:
|
|
4304
|
+
"""create mcp tool, return id"""
|
|
4305
|
+
assert task_id is None or pipeline_id is None, "mcp tool should be defined in one way"
|
|
4306
|
+
if batcher is None:
|
|
4307
|
+
batcher = Config.BATCHER
|
|
4308
|
+
data = MCPTool(name=name, description=description, inputSchema=input_schema, id=id, taskId=task_id,
|
|
4309
|
+
pipelineId=pipeline_id, cfgId=cfg_id, runSettings=run_settings, enableNotAuthorized=enable_not_auth)
|
|
4310
|
+
if batcher is not None:
|
|
4311
|
+
return batcher.add("postMcpTool", data=data)
|
|
4312
|
+
if is_async:
|
|
4313
|
+
return f.post_mcp_tool_async(data, wait=wait, auth=auth, conn_url=conn_url)
|
|
4314
|
+
return f.post_mcp_tool(data, wait=wait, auth=auth, conn_url=conn_url)
|
|
4315
|
+
|
|
4316
|
+
|
|
4317
|
+
def call_mcp_tool(
|
|
4318
|
+
name: str,
|
|
4319
|
+
arguments: Dict[str, Any],
|
|
4320
|
+
with_show: bool = True,
|
|
4321
|
+
*,
|
|
4322
|
+
with_auth: bool = True,
|
|
4323
|
+
auth: Optional[AUTH] = None,
|
|
4324
|
+
conn_url: Optional[str] = None,
|
|
4325
|
+
batcher: Optional[Batcher] = None,
|
|
4326
|
+
is_async: bool = False,
|
|
4327
|
+
) -> Union[AppLogsWithResults, Any]:
|
|
4328
|
+
"""run by mcp tool"""
|
|
4329
|
+
if batcher is None:
|
|
4330
|
+
batcher = Config.BATCHER
|
|
4331
|
+
data = MCPToolCall(name=name, arguments=arguments)
|
|
4332
|
+
if batcher is not None:
|
|
4333
|
+
return batcher.add("postMcpToolCall", data=data, result_model=AppLogsWithResults)
|
|
4334
|
+
if is_async:
|
|
4335
|
+
return f.call_mcp_tool_async(data, with_show=with_show, with_auth=with_auth, auth=auth, conn_url=conn_url)
|
|
4336
|
+
return f.call_mcp_tool(data, with_show=with_show, with_auth=with_auth, auth=auth, conn_url=conn_url)
|
|
4337
|
+
|
|
4338
|
+
|
|
4339
|
+
def delete_mcp_tool(
|
|
4340
|
+
id: Optional[str] = None,
|
|
4341
|
+
name: Optional[str] = None,
|
|
4342
|
+
wait: bool = True,
|
|
4343
|
+
*,
|
|
4344
|
+
auth: Optional[AUTH] = None,
|
|
4345
|
+
conn_url: Optional[str] = None,
|
|
4346
|
+
batcher: Optional[Batcher] = None,
|
|
4347
|
+
is_async: bool = False,
|
|
4348
|
+
) -> Alias.Info:
|
|
4349
|
+
"""delete mcp tool by `id` or `name` """
|
|
4350
|
+
assert id is not None or name is not None, "id or name should be set"
|
|
4351
|
+
if batcher is None:
|
|
4352
|
+
batcher = Config.BATCHER
|
|
4353
|
+
if batcher is not None:
|
|
4354
|
+
return batcher.add("deleteMcpTool", vars={"id": id, "name": name})
|
|
4355
|
+
if is_async:
|
|
4356
|
+
return f.delete_mcp_tool_id_name_async(id, name, wait=wait, auth=auth, conn_url=conn_url)
|
|
4357
|
+
return f.delete_mcp_tool_id_name(id, name, wait=wait, auth=auth, conn_url=conn_url)
|
|
4358
|
+
|
|
4359
|
+
|
|
4360
|
+
def delete_mcp_tools(
|
|
4361
|
+
wait: bool = True,
|
|
4362
|
+
*,
|
|
4363
|
+
auth: Optional[AUTH] = None,
|
|
4364
|
+
conn_url: Optional[str] = None,
|
|
4365
|
+
batcher: Optional[Batcher] = None,
|
|
4366
|
+
is_async: bool = False,
|
|
4367
|
+
) -> Alias.Info:
|
|
4368
|
+
"""delete all mcp tools"""
|
|
4369
|
+
if batcher is None:
|
|
4370
|
+
batcher = Config.BATCHER
|
|
4371
|
+
if batcher is not None:
|
|
4372
|
+
return batcher.add("deleteMcpTools")
|
|
4373
|
+
if is_async:
|
|
4374
|
+
return f.delete_mcp_tools_async(wait=wait, auth=auth, conn_url=conn_url)
|
|
4375
|
+
return f.delete_mcp_tools(wait=wait, auth=auth, conn_url=conn_url)
|
|
4376
|
+
|
|
4377
|
+
|
|
4228
4378
|
# kafka
|
|
4229
4379
|
|
|
4230
4380
|
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45/malevich_coretools.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: malevich-coretools
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.45
|
|
4
4
|
Author: Andrew Pogrebnoj
|
|
5
5
|
Author-email: andrew@onjulius.co
|
|
6
6
|
License-File: LICENSE
|
|
@@ -11,4 +11,5 @@ Requires-Dist: aiohttp
|
|
|
11
11
|
Requires-Dist: kafka-python
|
|
12
12
|
Dynamic: author
|
|
13
13
|
Dynamic: author-email
|
|
14
|
+
Dynamic: license-file
|
|
14
15
|
Dynamic: requires-dist
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.3.43
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/abstract/__init__.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/abstract/operations.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/abstract/pipeline.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/abstract/statuses.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/admin/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/batch/__init__.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/funcs/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/secondary/__init__.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/secondary/config.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/secondary/kafka_utils.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/tools/__init__.py
RENAMED
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools/tools/abstract.py
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools.egg-info/requires.txt
RENAMED
|
File without changes
|
{malevich_coretools-0.3.43 → malevich_coretools-0.3.45}/malevich_coretools.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|