feat: Day 10-11 - Agent Configuration System completed
Backend: - Create agents.yaml config file with 12 agents definition - Create Prompt templates for topic-evaluation agent - Implement agentService.ts for loading and managing agent configs - Create agentController.ts with CRUD operations - Create agent routes (GET /agents, /agents/:id, etc.) - Register agent routes in main server Frontend: - Create agentApi.ts service module - Update AgentChatPage to dynamically load agent config from API - Add loading state and error handling - Display agent details (description, category, model) Build: Both frontend and backend build successfully
This commit is contained in:
309
backend/config/agents.yaml
Normal file
309
backend/config/agents.yaml
Normal file
@@ -0,0 +1,309 @@
|
||||
# AI临床研究平台 - 智能体配置文件
|
||||
# 版本: 1.0
|
||||
# 更新日期: 2025-10-10
|
||||
|
||||
agents:
|
||||
# ==================== 选题阶段 ====================
|
||||
|
||||
- id: topic-evaluation
|
||||
name: 选题评价智能体
|
||||
nameEn: Topic Evaluation Agent
|
||||
description: 从创新性、临床价值、科学性和可行性等维度评估研究选题
|
||||
category: 选题阶段
|
||||
icon: 🎯
|
||||
enabled: true
|
||||
systemPromptFile: topic_evaluation_system.txt
|
||||
userPromptTemplateFile: topic_evaluation_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.4
|
||||
maxTokens: 2000
|
||||
topP: 0.9
|
||||
qwen3-72b:
|
||||
temperature: 0.5
|
||||
maxTokens: 2000
|
||||
topP: 0.9
|
||||
ragEnabled: true
|
||||
requiresProject: true
|
||||
outputFormat: structured
|
||||
tags:
|
||||
- 选题
|
||||
- 评估
|
||||
- 创新性
|
||||
|
||||
- id: scientific-question
|
||||
name: 科学问题梳理智能体
|
||||
nameEn: Scientific Question Agent
|
||||
description: 将模糊的研究想法提炼成清晰、具体、可验证的科学问题
|
||||
category: 选题阶段
|
||||
icon: 🔬
|
||||
enabled: false
|
||||
systemPromptFile: scientific_question_system.txt
|
||||
userPromptTemplateFile: scientific_question_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.5
|
||||
maxTokens: 1500
|
||||
qwen3-72b:
|
||||
temperature: 0.6
|
||||
maxTokens: 1500
|
||||
ragEnabled: true
|
||||
requiresProject: true
|
||||
outputFormat: structured
|
||||
tags:
|
||||
- 科学问题
|
||||
- PICOS
|
||||
|
||||
- id: picos-construction
|
||||
name: PICOS构建智能体
|
||||
nameEn: PICOS Construction Agent
|
||||
description: 按照PICOS原则结构化定义临床研究的核心要素
|
||||
category: 选题阶段
|
||||
icon: 📋
|
||||
enabled: false
|
||||
systemPromptFile: picos_construction_system.txt
|
||||
userPromptTemplateFile: picos_construction_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.3
|
||||
maxTokens: 1500
|
||||
qwen3-72b:
|
||||
temperature: 0.4
|
||||
maxTokens: 1500
|
||||
ragEnabled: true
|
||||
requiresProject: true
|
||||
outputFormat: structured
|
||||
tags:
|
||||
- PICOS
|
||||
- 研究设计
|
||||
|
||||
# ==================== 研究设计阶段 ====================
|
||||
|
||||
- id: observation-design
|
||||
name: 观察指标设计智能体
|
||||
nameEn: Observation Design Agent
|
||||
description: 推荐合适的主要、次要及安全性观察指标集
|
||||
category: 研究设计阶段
|
||||
icon: 📊
|
||||
enabled: false
|
||||
systemPromptFile: observation_design_system.txt
|
||||
userPromptTemplateFile: observation_design_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.4
|
||||
maxTokens: 2000
|
||||
qwen3-72b:
|
||||
temperature: 0.5
|
||||
maxTokens: 2000
|
||||
ragEnabled: true
|
||||
requiresProject: true
|
||||
outputFormat: structured
|
||||
tags:
|
||||
- 观察指标
|
||||
- 终点事件
|
||||
|
||||
- id: crf-development
|
||||
name: CRF制定智能体
|
||||
nameEn: CRF Development Agent
|
||||
description: 自动生成结构化、符合规范的病例报告表(CRF)框架
|
||||
category: 研究设计阶段
|
||||
icon: 📝
|
||||
enabled: false
|
||||
systemPromptFile: crf_development_system.txt
|
||||
userPromptTemplateFile: crf_development_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.3
|
||||
maxTokens: 3000
|
||||
qwen3-72b:
|
||||
temperature: 0.4
|
||||
maxTokens: 3000
|
||||
ragEnabled: true
|
||||
requiresProject: true
|
||||
outputFormat: document
|
||||
tags:
|
||||
- CRF
|
||||
- 病例报告表
|
||||
|
||||
- id: sample-size
|
||||
name: 样本量计算智能体
|
||||
nameEn: Sample Size Calculation Agent
|
||||
description: 根据研究参数提供科学合理的样本量估算结果
|
||||
category: 研究设计阶段
|
||||
icon: 🔢
|
||||
enabled: false
|
||||
systemPromptFile: sample_size_system.txt
|
||||
userPromptTemplateFile: sample_size_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.2
|
||||
maxTokens: 1500
|
||||
qwen3-72b:
|
||||
temperature: 0.3
|
||||
maxTokens: 1500
|
||||
ragEnabled: false
|
||||
requiresProject: true
|
||||
outputFormat: structured
|
||||
tags:
|
||||
- 样本量
|
||||
- 统计学
|
||||
|
||||
- id: protocol-writing
|
||||
name: 临床研究方案撰写智能体
|
||||
nameEn: Protocol Writing Agent
|
||||
description: 自动生成结构完整的临床研究设计方案
|
||||
category: 研究设计阶段
|
||||
icon: 📄
|
||||
enabled: false
|
||||
systemPromptFile: protocol_writing_system.txt
|
||||
userPromptTemplateFile: protocol_writing_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.5
|
||||
maxTokens: 4000
|
||||
qwen3-72b:
|
||||
temperature: 0.6
|
||||
maxTokens: 4000
|
||||
ragEnabled: true
|
||||
requiresProject: true
|
||||
outputFormat: document
|
||||
tags:
|
||||
- 研究方案
|
||||
- 文档生成
|
||||
|
||||
# ==================== 论文撰写阶段 ====================
|
||||
|
||||
- id: paper-polishing
|
||||
name: 论文润色智能体
|
||||
nameEn: Paper Polishing Agent
|
||||
description: 提供专业级的语言润色,修正语法、拼写和表达方式
|
||||
category: 论文撰写阶段
|
||||
icon: ✨
|
||||
enabled: false
|
||||
systemPromptFile: paper_polishing_system.txt
|
||||
userPromptTemplateFile: paper_polishing_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.4
|
||||
maxTokens: 3000
|
||||
qwen3-72b:
|
||||
temperature: 0.5
|
||||
maxTokens: 3000
|
||||
ragEnabled: false
|
||||
requiresProject: false
|
||||
outputFormat: text
|
||||
tags:
|
||||
- 润色
|
||||
- 语言优化
|
||||
|
||||
- id: paper-translation
|
||||
name: 论文翻译智能体
|
||||
nameEn: Paper Translation Agent
|
||||
description: 提供专业、精准的中英互译服务
|
||||
category: 论文撰写阶段
|
||||
icon: 🌐
|
||||
enabled: false
|
||||
systemPromptFile: paper_translation_system.txt
|
||||
userPromptTemplateFile: paper_translation_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.3
|
||||
maxTokens: 3000
|
||||
qwen3-72b:
|
||||
temperature: 0.4
|
||||
maxTokens: 3000
|
||||
ragEnabled: false
|
||||
requiresProject: false
|
||||
outputFormat: text
|
||||
tags:
|
||||
- 翻译
|
||||
- 中英互译
|
||||
|
||||
- id: methodology-review
|
||||
name: 方法学评审智能体
|
||||
nameEn: Methodology Review Agent
|
||||
description: 对研究方案或论文进行全面的方法学评审
|
||||
category: 论文撰写阶段
|
||||
icon: 🔍
|
||||
enabled: false
|
||||
systemPromptFile: methodology_review_system.txt
|
||||
userPromptTemplateFile: methodology_review_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.5
|
||||
maxTokens: 2500
|
||||
qwen3-72b:
|
||||
temperature: 0.6
|
||||
maxTokens: 2500
|
||||
ragEnabled: true
|
||||
requiresProject: false
|
||||
outputFormat: structured
|
||||
tags:
|
||||
- 方法学评审
|
||||
- 质量控制
|
||||
|
||||
- id: journal-methodology-review
|
||||
name: 期刊方法学评审智能体
|
||||
nameEn: Journal Methodology Review Agent
|
||||
description: 模拟期刊审稿人视角,进行方法学挑战
|
||||
category: 论文撰写阶段
|
||||
icon: 📑
|
||||
enabled: false
|
||||
systemPromptFile: journal_methodology_review_system.txt
|
||||
userPromptTemplateFile: journal_methodology_review_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.6
|
||||
maxTokens: 2500
|
||||
qwen3-72b:
|
||||
temperature: 0.7
|
||||
maxTokens: 2500
|
||||
ragEnabled: true
|
||||
requiresProject: false
|
||||
outputFormat: structured
|
||||
tags:
|
||||
- 期刊审稿
|
||||
- 方法学挑战
|
||||
|
||||
- id: journal-guidelines-review
|
||||
name: 期刊稿约评审智能体
|
||||
nameEn: Journal Guidelines Review Agent
|
||||
description: 检查文章格式、字数、参考文献规范等是否符合投稿要求
|
||||
category: 论文撰写阶段
|
||||
icon: ✅
|
||||
enabled: false
|
||||
systemPromptFile: journal_guidelines_review_system.txt
|
||||
userPromptTemplateFile: journal_guidelines_review_user.txt
|
||||
models:
|
||||
deepseek-v3:
|
||||
temperature: 0.3
|
||||
maxTokens: 2000
|
||||
qwen3-72b:
|
||||
temperature: 0.4
|
||||
maxTokens: 2000
|
||||
ragEnabled: false
|
||||
requiresProject: false
|
||||
outputFormat: structured
|
||||
tags:
|
||||
- 期刊投稿
|
||||
- 格式检查
|
||||
|
||||
# 配置说明:
|
||||
# - id: 智能体唯一标识符
|
||||
# - name: 显示名称
|
||||
# - nameEn: 英文名称
|
||||
# - description: 功能描述
|
||||
# - category: 所属阶段
|
||||
# - icon: 显示图标
|
||||
# - enabled: 是否启用(true/false)
|
||||
# - systemPromptFile: 系统Prompt文件名
|
||||
# - userPromptTemplateFile: 用户Prompt模板文件名
|
||||
# - models: 支持的模型及参数配置
|
||||
# - temperature: 温度参数(0-1)
|
||||
# - maxTokens: 最大token数
|
||||
# - topP: Top-p采样参数
|
||||
# - ragEnabled: 是否支持知识库检索
|
||||
# - requiresProject: 是否需要项目上下文
|
||||
# - outputFormat: 输出格式(text/structured/document)
|
||||
# - tags: 标签列表
|
||||
|
||||
Reference in New Issue
Block a user