bohr-agent-sdk 0.1.24__tar.gz → 0.1.101__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.
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/PKG-INFO +1 -1
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/setup.py +1 -1
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/bohr_agent_sdk.egg-info/PKG-INFO +1 -1
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/adapter/adk/client/calculation_mcp_tool.py +10 -2
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/calculation_mcp_server.py +14 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/README.md +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/pyproject.toml +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/setup.cfg +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/bohr_agent_sdk.egg-info/SOURCES.txt +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/bohr_agent_sdk.egg-info/dependency_links.txt +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/bohr_agent_sdk.egg-info/entry_points.txt +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/bohr_agent_sdk.egg-info/requires.txt +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/bohr_agent_sdk.egg-info/top_level.txt +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/adapter/adk/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/adapter/adk/client/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/adapter/adk/storage_artifact_service.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/adapter/adk/utils.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/adapter/camel/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/adapter/camel/client/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/adapter/camel/client/calculation_mcp_client.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/cli/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/cli/cli.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/cloud/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/cloud/main.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/cloud/mcp.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/cloud/mqtt.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/device/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/device/device/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/device/device/device.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/device/device/types.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/device/mqtt_device_twin.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/executor/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/executor/base_executor.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/executor/dispatcher_executor.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/executor/local_executor.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/preprocessor.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/storage/__init__.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/storage/base_storage.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/storage/bohrium_storage.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/storage/http_storage.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/storage/local_storage.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/storage/oss_storage.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/utils.py +0 -0
- {bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/tests/test_cli.py +0 -0
|
@@ -9,7 +9,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
9
9
|
|
|
10
10
|
setup(
|
|
11
11
|
name="bohr-agent-sdk",
|
|
12
|
-
version="0.1.
|
|
12
|
+
version="0.1.101",
|
|
13
13
|
description="SDK for science agent and mcp tools",
|
|
14
14
|
long_description=long_description,
|
|
15
15
|
long_description_content_type="text/markdown",
|
|
@@ -49,6 +49,7 @@ class CalculationMCPTool(MCPTool):
|
|
|
49
49
|
results_tool: Optional[MCPTool] = None,
|
|
50
50
|
query_interval: int = 10,
|
|
51
51
|
logging_callback: Callable = logging_handler,
|
|
52
|
+
override: bool = True,
|
|
52
53
|
):
|
|
53
54
|
"""Calculation MCP tool
|
|
54
55
|
extended from google.adk.tools.mcp_tool.MCPTool
|
|
@@ -71,6 +72,7 @@ class CalculationMCPTool(MCPTool):
|
|
|
71
72
|
results_tool: The tool of getting job results
|
|
72
73
|
query_interval: Time interval of querying job status
|
|
73
74
|
logging_callback: Callback function for server notifications
|
|
75
|
+
override: Override storage and executor in tool params or not
|
|
74
76
|
"""
|
|
75
77
|
self.executor = executor
|
|
76
78
|
self.storage = storage
|
|
@@ -82,6 +84,7 @@ class CalculationMCPTool(MCPTool):
|
|
|
82
84
|
self.query_interval = query_interval
|
|
83
85
|
self.wait = wait
|
|
84
86
|
self.logging_callback = logging_callback
|
|
87
|
+
self.override = override
|
|
85
88
|
|
|
86
89
|
async def log(self, level: str, message: Any, tool_context: ToolContext):
|
|
87
90
|
await self.logging_callback(types.LoggingMessageNotificationParams(
|
|
@@ -90,9 +93,9 @@ class CalculationMCPTool(MCPTool):
|
|
|
90
93
|
async def run_async(self, args, tool_context: ToolContext, **kwargs):
|
|
91
94
|
# TODO: add progress callback when run_async
|
|
92
95
|
args = deepcopy(args)
|
|
93
|
-
if "executor" not in args:
|
|
96
|
+
if self.override or "executor" not in args:
|
|
94
97
|
args["executor"] = self.executor
|
|
95
|
-
if "storage" not in args:
|
|
98
|
+
if self.override or "storage" not in args:
|
|
96
99
|
args["storage"] = self.storage
|
|
97
100
|
if not self.async_mode and self.wait:
|
|
98
101
|
return await super().run_async(
|
|
@@ -155,6 +158,7 @@ class CalculationMCPToolset(MCPToolset):
|
|
|
155
158
|
async_mode: bool = False,
|
|
156
159
|
wait: bool = True,
|
|
157
160
|
logging_callback: Callable = logging_handler,
|
|
161
|
+
override: bool = True,
|
|
158
162
|
**kwargs,
|
|
159
163
|
):
|
|
160
164
|
"""
|
|
@@ -174,7 +178,9 @@ class CalculationMCPToolset(MCPToolset):
|
|
|
174
178
|
tools
|
|
175
179
|
async_mode: Submit and query until the job finishes, instead of
|
|
176
180
|
waiting in single connection
|
|
181
|
+
wait: Wait for the job to finish or directly return
|
|
177
182
|
logging_callback: Callback function for server notifications
|
|
183
|
+
override: Override storage and executor in tool params or not
|
|
178
184
|
"""
|
|
179
185
|
super().__init__(**kwargs)
|
|
180
186
|
self.logging_callback = logging_callback
|
|
@@ -191,6 +197,7 @@ class CalculationMCPToolset(MCPToolset):
|
|
|
191
197
|
self.query_tool = None
|
|
192
198
|
self.terminate_tool = None
|
|
193
199
|
self.results_tool = None
|
|
200
|
+
self.override = override
|
|
194
201
|
|
|
195
202
|
async def get_tools(self, *args, **kwargs) -> List[CalculationMCPTool]:
|
|
196
203
|
tools = await super().get_tools(*args, **kwargs)
|
|
@@ -213,6 +220,7 @@ class CalculationMCPToolset(MCPToolset):
|
|
|
213
220
|
terminate_tool=tools.get("terminate_job"),
|
|
214
221
|
results_tool=tools.get("get_job_results"),
|
|
215
222
|
logging_callback=self.logging_callback,
|
|
223
|
+
override=self.override,
|
|
216
224
|
)
|
|
217
225
|
calc_tool.__dict__.update(tool.__dict__)
|
|
218
226
|
calc_tool.is_long_running = not self.wait
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/calculation_mcp_server.py
RENAMED
|
@@ -11,6 +11,8 @@ from typing import Literal, Optional, get_origin
|
|
|
11
11
|
from mcp.server.fastmcp import FastMCP
|
|
12
12
|
from mcp.server.fastmcp.server import Context
|
|
13
13
|
from mcp.server.fastmcp.utilities.func_metadata import _get_typed_signature
|
|
14
|
+
from starlette.responses import JSONResponse
|
|
15
|
+
from starlette.routing import Route
|
|
14
16
|
|
|
15
17
|
from .executor import executor_dict
|
|
16
18
|
from .storage import storage_dict
|
|
@@ -282,4 +284,16 @@ class CalculationMCPServer:
|
|
|
282
284
|
def run(self, **kwargs):
|
|
283
285
|
if os.environ.get("DP_AGENT_RUNNING_MODE") in ["1", "true"]:
|
|
284
286
|
return
|
|
287
|
+
async def health_check(request) :
|
|
288
|
+
return JSONResponse({"status": "ok"})
|
|
289
|
+
|
|
290
|
+
self.mcp._custom_starlette_routes.append(
|
|
291
|
+
Route(
|
|
292
|
+
"/health",
|
|
293
|
+
endpoint=health_check,
|
|
294
|
+
methods=["GET"],
|
|
295
|
+
name="health_check",
|
|
296
|
+
include_in_schema=True,
|
|
297
|
+
)
|
|
298
|
+
)
|
|
285
299
|
self.mcp.run(**kwargs)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/bohr_agent_sdk.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/bohr_agent_sdk.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/adapter/adk/client/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/adapter/camel/client/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/executor/base_executor.py
RENAMED
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/executor/dispatcher_executor.py
RENAMED
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/executor/local_executor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/storage/base_storage.py
RENAMED
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/storage/bohrium_storage.py
RENAMED
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/storage/http_storage.py
RENAMED
|
File without changes
|
{bohr_agent_sdk-0.1.24 → bohr_agent_sdk-0.1.101}/src/dp/agent/server/storage/local_storage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|