Added a lot of functionality. Bugfixes and changes

This commit is contained in:
2026-02-15 16:46:06 +01:00
parent 2434e554f8
commit 04c9b8da1e
31 changed files with 6653 additions and 239 deletions

View File

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