医学界的Manus Agent - 当Manus在多模态领域大放异彩时,PubMedAgent正以生物医学文献智能体的身份掀起科研革命!
- 自然语言查询解析(示例:"肺癌的免疫治疗进展")
- 多条件结果过滤(年份/期刊/研究类型)
- 关键信息摘要生成
# 典型Agent工作流(src/main.py 核心逻辑)
async def generate():
async for event in agent.aquery(user_input):
if event.type == "thinking":
yield render_thought(event.content) # 思考过程可视化
elif event.type == "observation":
yield render_data(event.content) # 原始数据展示
elif event.type == "final":
yield render_answer(event.content) # 最终答案生成-
模块化设计
src/ ├── agents/ # Agent核心逻辑 ├── tools/ # PubMed等工具集成 ├── prompts/ # 提示工程模板 └── utils/ # 配置与辅助函数
-
实时流处理
基于Quart的Server-Sent Events实现:@app.route('/query', methods=['POST']) async def query(): async def generate(): async for event in agent.aquery(user_input): yield f"data: {json.dumps(event)}\n\n"
-
认知可追溯
Loadinggraph LR A[用户问题] --> B(意图识别) B --> C{问题类型} C -->|文献查询| D[PubMed工具] C -->|概念解析| E[LLM推理] D --> F[结果增强] E --> G[知识图谱] F & G --> H[结构化输出]
# 克隆仓库
git clone https://github.com/AceLi12138/PubMedAgent.git
# 安装依赖
pip install -r requirements.txt
# 启动服务(开发模式)
python src/main.py --debug# config.py 核心配置项
CONFIG = {
"max_iterations": 5, # Agent最大推理轮次
"result_cache_ttl": 3600, # 结果缓存时间
"enable_debug": False, # 调试模式
"api_timeout": 30.0 # API超时设置
}/* 矩阵背景动画 */
@keyframes matrix {
0% { background-position: 0 0; }
100% { background-position: 0 100%; }
}
/* 霓虹光效文本 */
.glow-text {
text-shadow: 0 0 10px #0ff;
animation: glow 2s ease-in-out infinite;
}
/* 全息投影效果 */
.hologram {
background: radial-gradient(circle, #0ff 0%, transparent 70%);
animation: hologram-pulse 2s ease-in-out infinite;
}- 动态矩阵背景使用CSS渐变+Base64图案实现
- 消息框采用玻璃拟态效果(backdrop-filter: blur(10px))
- 三维立方体按钮使用CSS 3D变换
// 基于SSE的事件处理
const eventSource = new EventSource('/query');
eventSource.onmessage = (e) => {
const data = JSON.parse(e.data);
switch(data.type) {
case 'thinking':
renderThinkingProcess(data.content);
break;
case 'observation':
renderDataVisualization(data.content);
break;
case 'final':
renderFinalAnswer(data.content);
}
};
// Markdown动态渲染
function renderMarkdown(content) {
const html = marked.parse(content);
const container = document.createElement('div');
container.className = 'markdown-content';
container.innerHTML = html;
hljs.highlightAllUnder(container);
return container;
}| 功能 | 实现技术 | 关键代码文件 |
|---|---|---|
| 动态输入框 | CSS Transition + JS ResizeObserver | style.css/chat.js |
| 能量条反馈 | CSS Gradient + JS Input事件 | style.css#L450 |
| 消息动画系统 | CSS Keyframes + requestAnimationFrame | style.css#L120 |
| 代码高亮 | highlight.js + marked | chat.js#L45 |
@media (max-width: 768px) {
.chat-container {
height: 100vh;
border-radius: 0;
}
.message-content {
max-width: 90%;
padding: 10px;
}
.cyber-button {
width: 40px;
height: 40px;
}
}- 移动端优先的响应式布局
- 触摸友好的交互元素尺寸
- 折叠式调试信息面板
// 三维立方体加载动画
class CubeLoader {
constructor() {
this.cube = document.createElement('div');
this.cube.className = 'cube-loader';
// 创建6个面并应用3D变换
}
start() {
this.cube.style.animation = 'cube-spin 4s linear infinite';
}
}
// 能量条动态反馈
class EnergyBar {
constructor() {
this.bar = document.querySelector('.energy-fill');
this.maxLength = 1000;
}
update(value) {
const percent = Math.min((value.length / this.maxLength) * 100, 100);
this.bar.style.width = `${percent}%`;
}
}本项目采用 MIT License,您可以在保留版权声明的前提下自由使用、修改和分发代码。
🌟 如果本项目对您有帮助,请点击右上角Star支持我们!您的支持是我们持续优化的动力!


