bohr-agent-sdk 0.1.102__tar.gz → 0.1.104__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.
Files changed (91) hide show
  1. bohr_agent_sdk-0.1.104/PKG-INFO +293 -0
  2. bohr_agent_sdk-0.1.104/README.md +234 -0
  3. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/pyproject.toml +3 -2
  4. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/setup.py +2 -2
  5. bohr_agent_sdk-0.1.104/src/bohr_agent_sdk.egg-info/PKG-INFO +293 -0
  6. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/bohr_agent_sdk.egg-info/requires.txt +3 -2
  7. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/cli.py +1 -1
  8. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/calculation_mcp_server.py +75 -48
  9. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/executor/dispatcher_executor.py +60 -24
  10. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/storage/http_storage.py +1 -1
  11. bohr_agent_sdk-0.1.104/src/dp/agent/server/utils.py +51 -0
  12. bohr_agent_sdk-0.1.102/PKG-INFO +0 -228
  13. bohr_agent_sdk-0.1.102/README.md +0 -170
  14. bohr_agent_sdk-0.1.102/src/bohr_agent_sdk.egg-info/PKG-INFO +0 -228
  15. bohr_agent_sdk-0.1.102/src/dp/agent/server/utils.py +0 -143
  16. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/setup.cfg +0 -0
  17. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/bohr_agent_sdk.egg-info/SOURCES.txt +0 -0
  18. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/bohr_agent_sdk.egg-info/dependency_links.txt +0 -0
  19. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/bohr_agent_sdk.egg-info/entry_points.txt +0 -0
  20. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/bohr_agent_sdk.egg-info/top_level.txt +0 -0
  21. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/__init__.py +0 -0
  22. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/__init__.py +0 -0
  23. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/adapter/adk/__init__.py +0 -0
  24. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/adapter/adk/client/__init__.py +0 -0
  25. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/adapter/adk/client/calculation_mcp_tool.py +0 -0
  26. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/adapter/adk/storage_artifact_service.py +0 -0
  27. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/adapter/adk/utils.py +0 -0
  28. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/adapter/camel/__init__.py +0 -0
  29. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/adapter/camel/client/__init__.py +0 -0
  30. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/adapter/camel/client/calculation_mcp_client.py +0 -0
  31. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/__init__.py +0 -0
  32. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/__init__.py +0 -0
  33. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/calculation/simple.py.template +0 -0
  34. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/device/tescan_device.py.template +0 -0
  35. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/main.py.template +0 -0
  36. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/__init__.py +0 -0
  37. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/__init__.py +0 -0
  38. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/config.py +0 -0
  39. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/constants.py +0 -0
  40. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/debug.py +0 -0
  41. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/files.py +0 -0
  42. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/files_upload.py +0 -0
  43. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/files_user.py +0 -0
  44. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/messages.py +0 -0
  45. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/projects.py +0 -0
  46. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/sessions.py +0 -0
  47. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/utils.py +0 -0
  48. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/api/websocket.py +0 -0
  49. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/config/__init__.py +0 -0
  50. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/config/agent_config.py +0 -0
  51. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/frontend/index.html +0 -0
  52. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/frontend/package.json +0 -0
  53. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/frontend/tsconfig.json +0 -0
  54. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/frontend/tsconfig.node.json +0 -0
  55. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/frontend/ui-static/assets/index-DdAmKhul.js +0 -0
  56. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/frontend/ui-static/assets/index-DfN2raU9.css +0 -0
  57. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/frontend/ui-static/index.html +0 -0
  58. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/frontend/vite.config.ts +0 -0
  59. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/scripts/build_ui.py +0 -0
  60. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/server/__init__.py +0 -0
  61. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/server/app.py +0 -0
  62. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/server/connection.py +0 -0
  63. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/server/file_watcher.py +0 -0
  64. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/server/middleware.py +0 -0
  65. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/server/models.py +0 -0
  66. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/server/session_manager.py +0 -0
  67. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/server/user_files.py +0 -0
  68. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/server/utils.py +0 -0
  69. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/test_download.py +0 -0
  70. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/ui_utils.py +0 -0
  71. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cli/templates/ui/websocket-server.py +0 -0
  72. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cloud/__init__.py +0 -0
  73. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cloud/main.py +0 -0
  74. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cloud/mcp.py +0 -0
  75. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/cloud/mqtt.py +0 -0
  76. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/device/__init__.py +0 -0
  77. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/device/device/__init__.py +0 -0
  78. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/device/device/device.py +0 -0
  79. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/device/device/types.py +0 -0
  80. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/device/mqtt_device_twin.py +0 -0
  81. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/__init__.py +0 -0
  82. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/executor/__init__.py +0 -0
  83. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/executor/base_executor.py +0 -0
  84. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/executor/local_executor.py +0 -0
  85. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/preprocessor.py +0 -0
  86. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/storage/__init__.py +0 -0
  87. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/storage/base_storage.py +0 -0
  88. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/storage/bohrium_storage.py +0 -0
  89. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/storage/local_storage.py +0 -0
  90. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/src/dp/agent/server/storage/oss_storage.py +0 -0
  91. {bohr_agent_sdk-0.1.102 → bohr_agent_sdk-0.1.104}/tests/test_cli.py +0 -0
@@ -0,0 +1,293 @@
1
+ Metadata-Version: 2.4
2
+ Name: bohr-agent-sdk
3
+ Version: 0.1.104
4
+ Summary: SDK for scientific agents
5
+ Home-page: https://github.com/dptech-corp/bohr-agent-sdk/
6
+ Author: DP Technology
7
+ Maintainer-email: liupeng <liupeng@dp.tech>, zjgemi <liuxzj@dp.tech>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/dptech-corp/bohr-agent-sdk
10
+ Project-URL: repository, https://github.com/dptech-corp/bohr-agent-sdk
11
+ Project-URL: Bug Reports, https://github.com/dptech-corp/bohr-agent-sdk/issues
12
+ Keywords: agent SDK,AI for science
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: click>=8.0.0
22
+ Requires-Dist: mcp>=1.17.0
23
+ Requires-Dist: python-dotenv>=1.0.0
24
+ Requires-Dist: typing-extensions>=4.8.0
25
+ Requires-Dist: dpdispatcher>=0.6.8
26
+ Requires-Dist: lbg>=1.2.29
27
+ Requires-Dist: jsonpickle>=3.0.3
28
+ Requires-Dist: psutil>=5.9.6
29
+ Requires-Dist: paho-mqtt>=2.1.0
30
+ Requires-Dist: redis>=6.2.0
31
+ Requires-Dist: twine>=6.1.0
32
+ Requires-Dist: build>=1.2.2.post1
33
+ Requires-Dist: cloudpickle==2.2.0
34
+ Requires-Dist: watchdog>=6.0.0
35
+ Requires-Dist: fastapi>=0.116.0
36
+ Requires-Dist: bohrium-open-sdk
37
+ Provides-Extra: device
38
+ Requires-Dist: pywinauto-recorder>=0.1.0; extra == "device"
39
+ Provides-Extra: cloud
40
+ Requires-Dist: paho-mqtt>=1.6.1; extra == "cloud"
41
+ Requires-Dist: redis>=5.0.1; extra == "cloud"
42
+ Requires-Dist: aiohttp>=3.9.1; extra == "cloud"
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
45
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
46
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
47
+ Requires-Dist: black>=23.11.0; extra == "dev"
48
+ Requires-Dist: isort>=5.12.0; extra == "dev"
49
+ Requires-Dist: mypy>=1.7.0; extra == "dev"
50
+ Requires-Dist: pylint>=3.0.0; extra == "dev"
51
+ Requires-Dist: google-adk; extra == "dev"
52
+ Provides-Extra: docs
53
+ Requires-Dist: sphinx>=7.2.0; extra == "docs"
54
+ Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == "docs"
55
+ Provides-Extra: all
56
+ Requires-Dist: bohr-agent-sdk[bohrium,cloud,dev,device,dispatcher,docs]; extra == "all"
57
+ Dynamic: home-page
58
+ Dynamic: requires-python
59
+
60
+ # Bohrium Science Agent SDK
61
+
62
+ [English](README.md) | [简体中文](README_CN.md)
63
+
64
+ **Transform Scientific Software into AI Assistants — 3 Steps to Intelligent Transformation**
65
+
66
+ ## 📖 Introduction
67
+
68
+ The Bohrium platform introduces the **bohr-agent-sdk Scientific Agent Development Kit**, enabling AI systems to truly execute professional scientific tasks and helping developers quickly build their own specialized research agents. Through a three-step process — **Invoking MCP Tools, Orchestrating Agent Workflows, and Deploying Services** — any scientific software can be rapidly transformed into an AI assistant.
69
+
70
+ ## ✨ Core Features
71
+
72
+ ### 🎯 Intelligent Task Management: Simplified Development, Standardized Output
73
+ With a decorator pattern, just a few annotations can quickly transform scientific computing programs into MCP standard services. Built-in application templates turn scattered research code into standardized, reusable intelligent components.
74
+
75
+ ### 🔧 Multi-Backend Framework Support
76
+ Supports mainstream Agent open frameworks including Google ADK, Langraph, and Camel, providing flexible choices for developers familiar with different technology stacks.
77
+
78
+ ### ☁️ Flexible Deployment: Local Development, Cloud Production
79
+ Dual-mode architecture supports seamless transition between development and production. Local environments enable rapid iteration and feature validation, while Bohrium's cloud GPU clusters handle production-grade computing tasks. The SDK automatically manages the complete workflow of task scheduling, status monitoring, and result collection, with built-in file transfer mechanisms for handling large-scale data uploads and downloads. Developers focus on core algorithm implementation while infrastructure management is fully automated.
80
+
81
+ ### 🖼️ Visual Interactive Interface: Professional Presentation, Intuitive Operation
82
+ Based on the modern React framework, deploy fully-featured web applications with one click. Built-in 3D molecular visualization engine supports multiple structure formats and rendering modes for interactive molecular structure display. Real-time data synchronization ensures instant computing status updates, while multi-session management supports parallel task processing. Integrated with enterprise-grade features including file management, project switching, and permission control. Transform command-line tools into professional visual applications, significantly enhancing user experience and tool usability.
83
+
84
+ ## 🖼️ Interface Showcase
85
+
86
+ ### Scientific Computing Master Console
87
+ <div align="center">
88
+
89
+ ![SCIMaster](image/SCIMaster.PNG)
90
+
91
+ *Powerful scientific computing task management and monitoring platform*
92
+
93
+ </div>
94
+
95
+ ### Visual Interactive Interface
96
+ <div align="center">
97
+
98
+ ![UI](image/UI.png)
99
+
100
+ *Modern web application interface providing intuitive user experience*
101
+
102
+ </div>
103
+
104
+ ## 🚀 Quick Start
105
+
106
+ ### Installation
107
+
108
+ ```bash
109
+ pip install bohr-agent-sdk -i https://pypi.org/simple --upgrade
110
+ ```
111
+
112
+ ### Build Your Research Agent in 3 Steps
113
+
114
+ #### Step 1: Get Project Templates
115
+
116
+ ```bash
117
+ # Get calculation project template
118
+ dp-agent fetch scaffolding --type=calculation
119
+
120
+ # Get device control project template
121
+ dp-agent fetch scaffolding --type=device
122
+
123
+ # Get configuration file
124
+ dp-agent fetch config
125
+ ```
126
+
127
+ #### Step 2: Develop Your Agent
128
+
129
+ **Lab Mode Development Example**
130
+
131
+ ```python
132
+ from typing import Dict, TypedDict
133
+ from dp.agent.device.device import Device, action, BaseParams, SuccessResult
134
+
135
+ class TakePictureParams(BaseParams):
136
+ """Picture taking parameters"""
137
+ horizontal_width: str # Image horizontal width
138
+
139
+ class PictureData(TypedDict):
140
+ """Picture data structure"""
141
+ image_id: str
142
+
143
+ class PictureResult(SuccessResult):
144
+ """Picture taking result"""
145
+ data: PictureData
146
+
147
+ class MyDevice(Device):
148
+ """Custom device class"""
149
+ device_name = "my_device"
150
+
151
+ @action("take_picture")
152
+ def take_picture(self, params: TakePictureParams) -> PictureResult:
153
+ """
154
+ Execute picture taking action
155
+
156
+ Through the @action decorator, automatically register this method as an MCP standard service
157
+ """
158
+ hw = params.get("horizontal_width", "default")
159
+ # Execute actual device control logic
160
+ return PictureResult(
161
+ message=f"Picture taken with {self.device_name}",
162
+ data={"image_id": "image_123"}
163
+ )
164
+ ```
165
+
166
+ **Cloud Mode Development Example**
167
+
168
+ ```python
169
+ """
170
+ MCP protocol-based cloud device control example
171
+ """
172
+ import signal
173
+ import sys
174
+ from dp.agent.cloud import mcp, get_mqtt_cloud_instance
175
+ from dp.agent.device.device import TescanDevice, register_mcp_tools
176
+
177
+ def signal_handler(sig, frame):
178
+ """Graceful shutdown handling"""
179
+ print("Shutting down...")
180
+ get_mqtt_cloud_instance().stop()
181
+ sys.exit(0)
182
+
183
+ def main():
184
+ """Start cloud services"""
185
+ print("Starting Tescan Device Twin Cloud Services...")
186
+
187
+ # Register signal handler
188
+ signal.signal(signal.SIGINT, signal_handler)
189
+
190
+ # Create device instance
191
+ device = TescanDevice(mcp, device)
192
+
193
+ # Automatically register device tools to MCP server
194
+ # register_mcp_tools implements automatic registration through Python introspection
195
+ register_mcp_tools(device)
196
+
197
+ # Start MCP server
198
+ print("Starting MCP server...")
199
+ mcp.run(transport="sse")
200
+
201
+ if __name__ == "__main__":
202
+ main()
203
+ ```
204
+
205
+ #### Step 3: Run and Deploy
206
+
207
+ ```bash
208
+ # Local lab environment
209
+ dp-agent run tool device
210
+
211
+ # Cloud computing environment
212
+ dp-agent run tool cloud
213
+
214
+ # Scientific calculation mode
215
+ dp-agent run tool calculation
216
+
217
+ # Start agent (with Web UI)
218
+ dp-agent run agent --config
219
+
220
+ # Debug mode
221
+ dp-agent run debug
222
+ ```
223
+
224
+ ## 🏗️ Project Structure
225
+
226
+ After running `dp-agent fetch scaffolding`, you'll get a standardized project structure:
227
+
228
+ ```
229
+ your-project/
230
+ ├── lab/ # Lab mode
231
+ │ ├── __init__.py
232
+ │ └── tescan_device.py # Device control implementation
233
+ ├── cloud/ # Cloud mode
234
+ │ ├── __init__.py
235
+ │ └── mcp_server.py # MCP service implementation
236
+ ├── calculation/ # Calculation mode
237
+ │ └── __init__.py
238
+ ├── .env # Environment configuration
239
+ └── main.py # Main program entry
240
+ ```
241
+
242
+ ## ⚙️ Configuration
243
+
244
+ Configure necessary environment variables in the `.env` file:
245
+
246
+ ```bash
247
+ # MQTT connection configuration
248
+ MQTT_INSTANCE_ID=your_instance_id
249
+ MQTT_ENDPOINT=your_endpoint
250
+ MQTT_DEVICE_ID=your_device_id
251
+ MQTT_GROUP_ID=your_group_id
252
+ MQTT_AK=your_access_key
253
+ MQTT_SK=your_secret_key
254
+
255
+ # Computing resource configuration
256
+ BOHRIUM_USERNAME=your_username
257
+ BOHRIUM_PASSWORD=your_password
258
+ ```
259
+
260
+ Note: The `dp-agent fetch config` command automatically downloads configuration files and replaces dynamic variables (such as MQTT_DEVICE_ID). For security reasons, this feature is only available in internal network environments.
261
+
262
+ ## 🎯 Application Scenarios
263
+
264
+ - **Materials Science Computing**: Molecular dynamics simulation, first-principles calculations
265
+ - **Bioinformatics Analysis**: Gene sequence analysis, protein structure prediction
266
+ - **Laboratory Equipment Control**: Intelligent control of research equipment such as electron microscopes and X-ray diffractometers
267
+ - **Data Processing Workflows**: Automated data cleaning, analysis, and visualization
268
+ - **Machine Learning Training**: Model training, hyperparameter optimization, result evaluation
269
+
270
+ ## 🔧 Advanced Features
271
+
272
+ ### File Management
273
+
274
+ ```bash
275
+ # Upload files to cloud
276
+ dp-agent artifact upload <path>
277
+
278
+ # Download cloud files
279
+ dp-agent artifact download <artifact_id>
280
+ ```
281
+
282
+ ### Task Monitoring
283
+
284
+ The SDK provides real-time task status monitoring, supporting:
285
+ - Task queue management
286
+ - Computing resource scheduling
287
+ - Automatic result collection
288
+ - Exception handling and retry mechanisms
289
+
290
+ ## 📚 Documentation & Support
291
+
292
+ - 📖 [Detailed Documentation](https://dptechnology.feishu.cn/wiki/ZSj9wbLJEiwdNek0Iu7cKsFanuW)
293
+
@@ -0,0 +1,234 @@
1
+ # Bohrium Science Agent SDK
2
+
3
+ [English](README.md) | [简体中文](README_CN.md)
4
+
5
+ **Transform Scientific Software into AI Assistants — 3 Steps to Intelligent Transformation**
6
+
7
+ ## 📖 Introduction
8
+
9
+ The Bohrium platform introduces the **bohr-agent-sdk Scientific Agent Development Kit**, enabling AI systems to truly execute professional scientific tasks and helping developers quickly build their own specialized research agents. Through a three-step process — **Invoking MCP Tools, Orchestrating Agent Workflows, and Deploying Services** — any scientific software can be rapidly transformed into an AI assistant.
10
+
11
+ ## ✨ Core Features
12
+
13
+ ### 🎯 Intelligent Task Management: Simplified Development, Standardized Output
14
+ With a decorator pattern, just a few annotations can quickly transform scientific computing programs into MCP standard services. Built-in application templates turn scattered research code into standardized, reusable intelligent components.
15
+
16
+ ### 🔧 Multi-Backend Framework Support
17
+ Supports mainstream Agent open frameworks including Google ADK, Langraph, and Camel, providing flexible choices for developers familiar with different technology stacks.
18
+
19
+ ### ☁️ Flexible Deployment: Local Development, Cloud Production
20
+ Dual-mode architecture supports seamless transition between development and production. Local environments enable rapid iteration and feature validation, while Bohrium's cloud GPU clusters handle production-grade computing tasks. The SDK automatically manages the complete workflow of task scheduling, status monitoring, and result collection, with built-in file transfer mechanisms for handling large-scale data uploads and downloads. Developers focus on core algorithm implementation while infrastructure management is fully automated.
21
+
22
+ ### 🖼️ Visual Interactive Interface: Professional Presentation, Intuitive Operation
23
+ Based on the modern React framework, deploy fully-featured web applications with one click. Built-in 3D molecular visualization engine supports multiple structure formats and rendering modes for interactive molecular structure display. Real-time data synchronization ensures instant computing status updates, while multi-session management supports parallel task processing. Integrated with enterprise-grade features including file management, project switching, and permission control. Transform command-line tools into professional visual applications, significantly enhancing user experience and tool usability.
24
+
25
+ ## 🖼️ Interface Showcase
26
+
27
+ ### Scientific Computing Master Console
28
+ <div align="center">
29
+
30
+ ![SCIMaster](image/SCIMaster.PNG)
31
+
32
+ *Powerful scientific computing task management and monitoring platform*
33
+
34
+ </div>
35
+
36
+ ### Visual Interactive Interface
37
+ <div align="center">
38
+
39
+ ![UI](image/UI.png)
40
+
41
+ *Modern web application interface providing intuitive user experience*
42
+
43
+ </div>
44
+
45
+ ## 🚀 Quick Start
46
+
47
+ ### Installation
48
+
49
+ ```bash
50
+ pip install bohr-agent-sdk -i https://pypi.org/simple --upgrade
51
+ ```
52
+
53
+ ### Build Your Research Agent in 3 Steps
54
+
55
+ #### Step 1: Get Project Templates
56
+
57
+ ```bash
58
+ # Get calculation project template
59
+ dp-agent fetch scaffolding --type=calculation
60
+
61
+ # Get device control project template
62
+ dp-agent fetch scaffolding --type=device
63
+
64
+ # Get configuration file
65
+ dp-agent fetch config
66
+ ```
67
+
68
+ #### Step 2: Develop Your Agent
69
+
70
+ **Lab Mode Development Example**
71
+
72
+ ```python
73
+ from typing import Dict, TypedDict
74
+ from dp.agent.device.device import Device, action, BaseParams, SuccessResult
75
+
76
+ class TakePictureParams(BaseParams):
77
+ """Picture taking parameters"""
78
+ horizontal_width: str # Image horizontal width
79
+
80
+ class PictureData(TypedDict):
81
+ """Picture data structure"""
82
+ image_id: str
83
+
84
+ class PictureResult(SuccessResult):
85
+ """Picture taking result"""
86
+ data: PictureData
87
+
88
+ class MyDevice(Device):
89
+ """Custom device class"""
90
+ device_name = "my_device"
91
+
92
+ @action("take_picture")
93
+ def take_picture(self, params: TakePictureParams) -> PictureResult:
94
+ """
95
+ Execute picture taking action
96
+
97
+ Through the @action decorator, automatically register this method as an MCP standard service
98
+ """
99
+ hw = params.get("horizontal_width", "default")
100
+ # Execute actual device control logic
101
+ return PictureResult(
102
+ message=f"Picture taken with {self.device_name}",
103
+ data={"image_id": "image_123"}
104
+ )
105
+ ```
106
+
107
+ **Cloud Mode Development Example**
108
+
109
+ ```python
110
+ """
111
+ MCP protocol-based cloud device control example
112
+ """
113
+ import signal
114
+ import sys
115
+ from dp.agent.cloud import mcp, get_mqtt_cloud_instance
116
+ from dp.agent.device.device import TescanDevice, register_mcp_tools
117
+
118
+ def signal_handler(sig, frame):
119
+ """Graceful shutdown handling"""
120
+ print("Shutting down...")
121
+ get_mqtt_cloud_instance().stop()
122
+ sys.exit(0)
123
+
124
+ def main():
125
+ """Start cloud services"""
126
+ print("Starting Tescan Device Twin Cloud Services...")
127
+
128
+ # Register signal handler
129
+ signal.signal(signal.SIGINT, signal_handler)
130
+
131
+ # Create device instance
132
+ device = TescanDevice(mcp, device)
133
+
134
+ # Automatically register device tools to MCP server
135
+ # register_mcp_tools implements automatic registration through Python introspection
136
+ register_mcp_tools(device)
137
+
138
+ # Start MCP server
139
+ print("Starting MCP server...")
140
+ mcp.run(transport="sse")
141
+
142
+ if __name__ == "__main__":
143
+ main()
144
+ ```
145
+
146
+ #### Step 3: Run and Deploy
147
+
148
+ ```bash
149
+ # Local lab environment
150
+ dp-agent run tool device
151
+
152
+ # Cloud computing environment
153
+ dp-agent run tool cloud
154
+
155
+ # Scientific calculation mode
156
+ dp-agent run tool calculation
157
+
158
+ # Start agent (with Web UI)
159
+ dp-agent run agent --config
160
+
161
+ # Debug mode
162
+ dp-agent run debug
163
+ ```
164
+
165
+ ## 🏗️ Project Structure
166
+
167
+ After running `dp-agent fetch scaffolding`, you'll get a standardized project structure:
168
+
169
+ ```
170
+ your-project/
171
+ ├── lab/ # Lab mode
172
+ │ ├── __init__.py
173
+ │ └── tescan_device.py # Device control implementation
174
+ ├── cloud/ # Cloud mode
175
+ │ ├── __init__.py
176
+ │ └── mcp_server.py # MCP service implementation
177
+ ├── calculation/ # Calculation mode
178
+ │ └── __init__.py
179
+ ├── .env # Environment configuration
180
+ └── main.py # Main program entry
181
+ ```
182
+
183
+ ## ⚙️ Configuration
184
+
185
+ Configure necessary environment variables in the `.env` file:
186
+
187
+ ```bash
188
+ # MQTT connection configuration
189
+ MQTT_INSTANCE_ID=your_instance_id
190
+ MQTT_ENDPOINT=your_endpoint
191
+ MQTT_DEVICE_ID=your_device_id
192
+ MQTT_GROUP_ID=your_group_id
193
+ MQTT_AK=your_access_key
194
+ MQTT_SK=your_secret_key
195
+
196
+ # Computing resource configuration
197
+ BOHRIUM_USERNAME=your_username
198
+ BOHRIUM_PASSWORD=your_password
199
+ ```
200
+
201
+ Note: The `dp-agent fetch config` command automatically downloads configuration files and replaces dynamic variables (such as MQTT_DEVICE_ID). For security reasons, this feature is only available in internal network environments.
202
+
203
+ ## 🎯 Application Scenarios
204
+
205
+ - **Materials Science Computing**: Molecular dynamics simulation, first-principles calculations
206
+ - **Bioinformatics Analysis**: Gene sequence analysis, protein structure prediction
207
+ - **Laboratory Equipment Control**: Intelligent control of research equipment such as electron microscopes and X-ray diffractometers
208
+ - **Data Processing Workflows**: Automated data cleaning, analysis, and visualization
209
+ - **Machine Learning Training**: Model training, hyperparameter optimization, result evaluation
210
+
211
+ ## 🔧 Advanced Features
212
+
213
+ ### File Management
214
+
215
+ ```bash
216
+ # Upload files to cloud
217
+ dp-agent artifact upload <path>
218
+
219
+ # Download cloud files
220
+ dp-agent artifact download <artifact_id>
221
+ ```
222
+
223
+ ### Task Monitoring
224
+
225
+ The SDK provides real-time task status monitoring, supporting:
226
+ - Task queue management
227
+ - Computing resource scheduling
228
+ - Automatic result collection
229
+ - Exception handling and retry mechanisms
230
+
231
+ ## 📚 Documentation & Support
232
+
233
+ - 📖 [Detailed Documentation](https://dptechnology.feishu.cn/wiki/ZSj9wbLJEiwdNek0Iu7cKsFanuW)
234
+
@@ -22,7 +22,7 @@ classifiers = [
22
22
  # 核心依赖
23
23
  dependencies = [
24
24
  "click>=8.0.0",
25
- "mcp",
25
+ "mcp>=1.17.0",
26
26
  "python-dotenv>=1.0.0",
27
27
  "typing-extensions>=4.8.0",
28
28
  "dpdispatcher>=0.6.8",
@@ -33,9 +33,10 @@ dependencies = [
33
33
  "redis>=6.2.0",
34
34
  "twine>=6.1.0",
35
35
  "build>=1.2.2.post1",
36
+ "cloudpickle==2.2.0",
36
37
  "watchdog>=6.0.0",
37
38
  "fastapi>=0.116.0",
38
- "bohrium-open-sdk==0.1.5"
39
+ "bohrium-open-sdk"
39
40
  ]
40
41
 
41
42
  # 可选依赖
@@ -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.102",
12
+ version="0.1.104",
13
13
  description="SDK for science agent and mcp tools",
14
14
  long_description=long_description,
15
15
  long_description_content_type="text/markdown",
@@ -22,7 +22,7 @@ setup(
22
22
  python_requires=">=3.10",
23
23
  install_requires=[
24
24
  "click",
25
- "mcp",
25
+ "mcp>=1.17.0",
26
26
  "paho-mqtt>=1.6.1", # MQTT客户端
27
27
  "redis>=5.0.1", # Redis客户端,使用最新稳定版
28
28
  "python-dotenv>=1.0.0", # 环境变量管理