namespace Health.Application.AI; /// /// 用户消息附带的图片/PDF 解析结果。 /// 既用作 LLM 上下文拼装,也持久化到 ConversationMessage.MetadataJson。 /// 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 { /// /// 根据 imageUrl 或 pdfUrl 构建附件上下文。两个都为空返回 null。 /// Task BuildAsync(Guid userId, string? imageUrl, string? pdfUrl, CancellationToken ct); }