Added a lot of functionality. Bugfixes and changes
This commit is contained in:
@@ -23,6 +23,7 @@ struct Message: Identifiable, Codable, Equatable {
|
||||
let attachments: [FileAttachment]?
|
||||
var responseTime: TimeInterval? // Time taken to generate response in seconds
|
||||
var wasInterrupted: Bool = false // Whether generation was cancelled
|
||||
var modelId: String? // Model ID that generated this message (e.g., "gpt-4", "claude-3-sonnet")
|
||||
|
||||
// Streaming state (not persisted)
|
||||
var isStreaming: Bool = false
|
||||
@@ -40,6 +41,7 @@ struct Message: Identifiable, Codable, Equatable {
|
||||
attachments: [FileAttachment]? = nil,
|
||||
responseTime: TimeInterval? = nil,
|
||||
wasInterrupted: Bool = false,
|
||||
modelId: String? = nil,
|
||||
isStreaming: Bool = false,
|
||||
generatedImages: [Data]? = nil
|
||||
) {
|
||||
@@ -52,12 +54,13 @@ struct Message: Identifiable, Codable, Equatable {
|
||||
self.attachments = attachments
|
||||
self.responseTime = responseTime
|
||||
self.wasInterrupted = wasInterrupted
|
||||
self.modelId = modelId
|
||||
self.isStreaming = isStreaming
|
||||
self.generatedImages = generatedImages
|
||||
}
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id, role, content, tokens, cost, timestamp, attachments, responseTime, wasInterrupted
|
||||
case id, role, content, tokens, cost, timestamp, attachments, responseTime, wasInterrupted, modelId
|
||||
}
|
||||
|
||||
static func == (lhs: Message, rhs: Message) -> Bool {
|
||||
|
||||
Reference in New Issue
Block a user