- 后端: 新增 AttachmentContextBuilder 解析图片/PDF 摘要并拼入 LLM 上下文; ai_chat_endpoints 扩展附件接口; 新增 ReportAnalysisService - 前端: 新增历史会话页与 conversation_history_provider; chat 链路支持附件展示与回放 - UI: 重构 medication_checkin / notification_center / profile / health_drawer 等多页面 - 配置: api_client baseUrl 适配当前 WiFi IP
21 lines
859 B
C#
21 lines
859 B
C#
namespace Health.Application.AI;
|
||
|
||
/// <summary>
|
||
/// 用户消息附带的图片/PDF 解析结果。
|
||
/// 既用作 LLM 上下文拼装,也持久化到 ConversationMessage.MetadataJson。
|
||
/// </summary>
|
||
public sealed record AttachmentContext(
|
||
string Kind, // "image" 或 "pdf"
|
||
string? Category, // 仅图片:food / report / wound / drug / chart / other
|
||
string? FileName, // PDF 文件原名
|
||
string Summary, // 简短摘要,用于持久化和历史回顾
|
||
string LlmContent); // 完整文本,拼到当前轮 LLM user content 前
|
||
|
||
public interface IAttachmentContextBuilder
|
||
{
|
||
/// <summary>
|
||
/// 根据 imageUrl 或 pdfUrl 构建附件上下文。两个都为空返回 null。
|
||
/// </summary>
|
||
Task<AttachmentContext?> BuildAsync(string? imageUrl, string? pdfUrl, CancellationToken ct);
|
||
}
|