Skip to content

Commit 33a785c

Browse files
committed
Add reference kind error
1 parent 802fa30 commit 33a785c

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

Core/Sources/ChatGPTChatTab/Chat.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,8 @@ private func convertReference(
522522
return kind
523523
case .text:
524524
return reference.content
525+
case .error:
526+
return reference.content
525527
}
526528
}(),
527529
uri: {
@@ -536,6 +538,8 @@ private func convertReference(
536538
return ""
537539
case .text:
538540
return ""
541+
case .error:
542+
return ""
539543
}
540544
}(),
541545
startLine: {

Core/Sources/ChatGPTChatTab/Views/BotMessage.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ struct ReferenceIcon: View {
172172
Color.gray
173173
case .other:
174174
Color.gray
175+
case .error:
176+
Color.red
175177
}
176178
}())
177179
.frame(width: 22, height: 22)
@@ -211,6 +213,8 @@ struct ReferenceIcon: View {
211213
Text("Ot")
212214
case .textFile:
213215
Text("Tx")
216+
case .error:
217+
Text("Er")
214218
}
215219
}
216220
.font(.system(size: 12).monospaced())

Tool/Sources/ChatBasic/ChatMessage.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ public struct ChatMessage: Equatable, Codable {
8585
case textFile(uri: String)
8686
/// Other kind of reference.
8787
case other(kind: String)
88+
/// Error case.
89+
case error
8890
}
8991

9092
/// The title of the reference.

0 commit comments

Comments
 (0)