From 26610c1baa64d8de2bfc01ed4a1ceac3cbc4c592 Mon Sep 17 00:00:00 2001 From: wangdl Date: Sat, 30 May 2026 08:44:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(ios):=20ChatCitation=20=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=E5=90=8E=E7=AB=AF=EF=BC=88excerptText=20?= =?UTF-8?q?=E6=9B=BF=E4=BB=A3=20content=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- AIStudyApp/AIStudyApp/Core/Models/APIModels.swift | 5 +++-- AIStudyApp/AIStudyApp/Features/AI/AIChatPage.swift | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AIStudyApp/AIStudyApp/Core/Models/APIModels.swift b/AIStudyApp/AIStudyApp/Core/Models/APIModels.swift index 9e48aa7..601d438 100644 --- a/AIStudyApp/AIStudyApp/Core/Models/APIModels.swift +++ b/AIStudyApp/AIStudyApp/Core/Models/APIModels.swift @@ -421,8 +421,9 @@ struct ChatMessage: Codable, Identifiable { struct ChatCitation: Codable, Identifiable { let id: String let chunkId: String? - let content: String? - let score: Double? + let sourceTitle: String? + let excerptText: String? + let pageNumber: Int? } struct CreateSessionRequest: Codable { diff --git a/AIStudyApp/AIStudyApp/Features/AI/AIChatPage.swift b/AIStudyApp/AIStudyApp/Features/AI/AIChatPage.swift index f63af47..3748843 100644 --- a/AIStudyApp/AIStudyApp/Features/AI/AIChatPage.swift +++ b/AIStudyApp/AIStudyApp/Features/AI/AIChatPage.swift @@ -33,7 +33,7 @@ struct AIChatPage: View { ForEach(citations.prefix(3)) { c in HStack(spacing: 4) { Image(systemName: "doc.text").font(.system(size: 9)).foregroundColor(Color.zxF04) - Text(c.content?.prefix(60).description ?? "").font(.system(size: 10)).foregroundColor(Color.zxF04).lineLimit(1) + Text(c.excerptText?.prefix(60).description ?? "").font(.system(size: 10)).foregroundColor(Color.zxF04).lineLimit(1) }.padding(.horizontal, 8).padding(.vertical, 4) .background(Color.zxFill004).clipShape(Capsule()) }