feat(ai): Phase 2A-4 新增 3 个 Agent Tool — 化验报告/预约/用药查询
新增 3 个 AI Agent Tool 扩展医护沙箱能力: - query_patient_lab_reports: 查询患者化验报告列表(含异常计数) - query_patient_appointments: 查询患者即将到来的预约 - query_patient_medications: 查询患者当前用药列表 同时: - HealthDataProvider trait 新增 get_patient_lab_reports 方法 + LabReportListItemDto - erp-health 实现新 trait 方法(含 PII 解密) - sandbox.rs 更新角色权限:Patient 可查体征/化验/用药,MedicalStaff 额外可查预约 - 修复 ai_prompt_tests.rs 中 AnalysisService::new 签名变更的遗留编译错误 - 新增 5 个 agent 测试覆盖新 Tool 和沙箱权限过滤
This commit is contained in:
@@ -8,6 +8,7 @@ use crate::agent::orchestrator::AgentRunParams;
|
||||
use crate::agent::sandbox::{get_sandbox_config, resolve_role};
|
||||
use crate::agent::tool::ToolContext;
|
||||
use crate::agent::tools::QueryPatientVitalsTool;
|
||||
use crate::agent::tools::{QueryAppointmentsTool, QueryLabReportsTool, QueryMedicationsTool};
|
||||
use crate::agent::{AgentOrchestrator, ToolRegistry};
|
||||
use crate::config_resolver;
|
||||
use crate::dto::{ChatMessage, ChatMessageRole};
|
||||
@@ -117,6 +118,9 @@ where
|
||||
// 构建全局 ToolRegistry(所有已注册 Tool)
|
||||
let mut registry = ToolRegistry::new();
|
||||
registry.register(std::sync::Arc::new(QueryPatientVitalsTool));
|
||||
registry.register(std::sync::Arc::new(QueryLabReportsTool));
|
||||
registry.register(std::sync::Arc::new(QueryAppointmentsTool));
|
||||
registry.register(std::sync::Arc::new(QueryMedicationsTool));
|
||||
|
||||
// 根据用户角色获取沙箱配置
|
||||
let user_role = resolve_role(&ctx.roles);
|
||||
|
||||
Reference in New Issue
Block a user