fix(ios): ChatCitation 字段对齐后端(excerptText 替代 content)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-05-30 08:44:00 +08:00
parent ab7f772072
commit 26610c1baa
2 changed files with 4 additions and 3 deletions

View File

@ -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 {

View File

@ -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())
}