feat(ai): Day 5 — ChatResponse display_hints + Web RichMessage 渲染
- ChatResponse 增加 display_hints 字段,Orchestrator 收集 Tool 产生的 DisplayHint - DisplayHint 实现 utoipa::ToSchema - Web ChatResponse 类型同步,DisplayHint 8 种联合类型 - RichMessage 组件:InsightCard/RiskAlert/LabReportCard/TrendChart/PatientProfile/VitalCard - AiSidebar 消息中渲染 display_hints 富消息 - 小程序 AiChatResponse 类型同步
This commit is contained in:
@@ -10,8 +10,19 @@ export interface AiChatMessage {
|
||||
export interface AiChatResponse {
|
||||
reply: string;
|
||||
message_id: string;
|
||||
display_hints?: DisplayHint[];
|
||||
}
|
||||
|
||||
export type DisplayHint =
|
||||
| { type: 'vital_card'; indicator_type: string; values: [string, number][]; unit: string }
|
||||
| { type: 'lab_report_card'; report_date: string; abnormal_count: number }
|
||||
| { type: 'action_confirm'; action_type: string; summary: string; confirm_payload: unknown }
|
||||
| { type: 'risk_alert'; level: string; message: string }
|
||||
| { type: 'trend_chart'; metrics: string[]; period: string; summary: string }
|
||||
| { type: 'insight_card'; title: string; severity: string; items: string[] }
|
||||
| { type: 'patient_profile'; chronic_conditions: string[]; medication_count: number }
|
||||
| { type: 'text' };
|
||||
|
||||
/** 发送消息给 AI 客服 */
|
||||
export async function sendAiMessage(
|
||||
message: string,
|
||||
|
||||
Reference in New Issue
Block a user