mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
98 lines
4.2 KiB
Swift
98 lines
4.2 KiB
Swift
//
|
|
// Session.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
#if canImport(AnyCodable)
|
|
import AnyCodable
|
|
#endif
|
|
|
|
public struct Session: Codable, JSONEncodable, Hashable {
|
|
|
|
public static let messageCountRule = NumericRule<Int>(minimum: 0, exclusiveMinimum: false, maximum: nil, exclusiveMaximum: false, multipleOf: nil)
|
|
public var accumulatedInputTokens: Int?
|
|
public var accumulatedOutputTokens: Int?
|
|
public var accumulatedTotalTokens: Int?
|
|
public var conversation: [Message]?
|
|
public var createdAt: Date
|
|
public var description: String
|
|
/** Extension data containing all extension states Keys are in format \"extension_name.version\" (e.g., \"todo.v0\") */
|
|
public var extensionData: [String: AnyCodable]
|
|
public var id: String
|
|
public var inputTokens: Int?
|
|
public var messageCount: Int
|
|
public var outputTokens: Int?
|
|
public var recipe: Recipe?
|
|
public var scheduleId: String?
|
|
public var totalTokens: Int?
|
|
public var updatedAt: Date
|
|
public var workingDir: String
|
|
|
|
public init(accumulatedInputTokens: Int? = nil, accumulatedOutputTokens: Int? = nil, accumulatedTotalTokens: Int? = nil, conversation: [Message]? = nil, createdAt: Date, description: String, extensionData: [String: AnyCodable], id: String, inputTokens: Int? = nil, messageCount: Int, outputTokens: Int? = nil, recipe: Recipe? = nil, scheduleId: String? = nil, totalTokens: Int? = nil, updatedAt: Date, workingDir: String) {
|
|
self.accumulatedInputTokens = accumulatedInputTokens
|
|
self.accumulatedOutputTokens = accumulatedOutputTokens
|
|
self.accumulatedTotalTokens = accumulatedTotalTokens
|
|
self.conversation = conversation
|
|
self.createdAt = createdAt
|
|
self.description = description
|
|
self.extensionData = extensionData
|
|
self.id = id
|
|
self.inputTokens = inputTokens
|
|
self.messageCount = messageCount
|
|
self.outputTokens = outputTokens
|
|
self.recipe = recipe
|
|
self.scheduleId = scheduleId
|
|
self.totalTokens = totalTokens
|
|
self.updatedAt = updatedAt
|
|
self.workingDir = workingDir
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case accumulatedInputTokens = "accumulated_input_tokens"
|
|
case accumulatedOutputTokens = "accumulated_output_tokens"
|
|
case accumulatedTotalTokens = "accumulated_total_tokens"
|
|
case conversation
|
|
case createdAt = "created_at"
|
|
case description
|
|
case extensionData = "extension_data"
|
|
case id
|
|
case inputTokens = "input_tokens"
|
|
case messageCount = "message_count"
|
|
case outputTokens = "output_tokens"
|
|
case recipe
|
|
case scheduleId = "schedule_id"
|
|
case totalTokens = "total_tokens"
|
|
case updatedAt = "updated_at"
|
|
case workingDir = "working_dir"
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(accumulatedInputTokens, forKey: .accumulatedInputTokens)
|
|
try container.encodeIfPresent(accumulatedOutputTokens, forKey: .accumulatedOutputTokens)
|
|
try container.encodeIfPresent(accumulatedTotalTokens, forKey: .accumulatedTotalTokens)
|
|
try container.encodeIfPresent(conversation, forKey: .conversation)
|
|
try container.encode(createdAt, forKey: .createdAt)
|
|
try container.encode(description, forKey: .description)
|
|
try container.encode(extensionData, forKey: .extensionData)
|
|
try container.encode(id, forKey: .id)
|
|
try container.encodeIfPresent(inputTokens, forKey: .inputTokens)
|
|
try container.encode(messageCount, forKey: .messageCount)
|
|
try container.encodeIfPresent(outputTokens, forKey: .outputTokens)
|
|
try container.encodeIfPresent(recipe, forKey: .recipe)
|
|
try container.encodeIfPresent(scheduleId, forKey: .scheduleId)
|
|
try container.encodeIfPresent(totalTokens, forKey: .totalTokens)
|
|
try container.encode(updatedAt, forKey: .updatedAt)
|
|
try container.encode(workingDir, forKey: .workingDir)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension Session: Identifiable {}
|