分享
🔥快速使用 Bohr-agent-sdk 开发
输入“/”快速插入内容
🔥快速使用 Bohr-agent-sdk 开发
用户4054
用户4054
用户5191
用户5191
用户9580
用户9580
用户4036
用户4036
用户9097
用户9097
用户311
用户311
1月23日修改
让科研计算工具快速升级为 AI 智能体
在 AI 驱动的科研新范式下,如何让传统的科研计算工具与大语言模型无缝协作,成为科研人员面临的关键挑战。Bohr-Agent-SDK 提供了一套完整的解决方案,让任何科研软件都能通过
三步流程——封装 MCP 工具、构建 Agent 智能体、部署交互服务
——快速转型为智能化的 AI 助手。
📋 三步开发流程
Step 1: 封装 MCP 工具
代码块
Python
from dp.agent.server import CalculationMCPServer
mcp = CalculationMCPServer("MyTools")
@mcp.tool()
def analyze_structure(pdb_file: Path) -> dict:
"""分析蛋白质结构"""
# 您的分析代码
return results
Step 2: 构建 Agent 智能体
代码块
Python
from google.adk.agents import Agent
from dp.agent.adapter.adk import CalculationMCPToolset
# 连接工具
toolset = CalculationMCPToolset(connection_params=...)
# 创建智能体
agent = Agent(
name="Research Assistant",
instruction="帮助用户进行科研计算分析",
tools=[toolset]
)
Step 3: 部署发布服务
配置界面,一键上线:
JSON
{
"agent": {
"module": "agent.py",
"name": "蛋白质分析助手",
"welcomeMessage": "我可以帮您分析蛋白质结构"
},
"ui": {
"title": "Protein Analyzer"
}
}
运行命令:bash
Bash
dp-agent run agent --config config.json
🎓 快速开始
只需三个命令,开始您的 AI 升级之旅:
bash
代码块
Bash
# 1. 安装 SDK
pip install bohr-agent-sdk --upgrade
# 2. 创建您的第一个Agent和config
Agent.py
config.json
# 3. 启动 Agent 服务
dp-agent run agent --config config.json