mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The forge tree held the package scaffolding and none of the generated sources — 2,435 files of APIs, Models and Infrastructure, including BaseAPI, were simply absent, so anything depending on this copy had a package that compiled to nothing usable. Generated from the current API document rather than reconciled with the other copy: a client is a function of the spec, so regenerating answers "which history wins" without anyone having to choose. .spec-lock records which document, so the next reader can tell.
74 lines
2.6 KiB
Swift
74 lines
2.6 KiB
Swift
//
|
|
// ScoreView.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct ScoreView: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Comment is the grader's reasoning, truncated at 2000 characters. */
|
|
public var comment: String?
|
|
/** DataType is NUMERIC, CATEGORICAL or BOOLEAN. */
|
|
public var dataType: String?
|
|
/** ID is the score event's handle. */
|
|
public var id: String?
|
|
/** Name is the score name, which a rubric of the same name governs. */
|
|
public var name: String?
|
|
/** RunName is the run this score was recorded under, when it came from one. */
|
|
public var runName: String?
|
|
/** StringValue is the label of a CATEGORICAL score. */
|
|
public var stringValue: String?
|
|
/** Timestamp is when the score was recorded. */
|
|
public var timestamp: String?
|
|
/** TraceID is the model call this score grades, when it grades one. */
|
|
public var traceId: String?
|
|
/** Value is the numeric score; for BOOLEAN it is 0 or 1. */
|
|
public var value: Double?
|
|
|
|
public init(comment: String? = nil, dataType: String? = nil, id: String? = nil, name: String? = nil, runName: String? = nil, stringValue: String? = nil, timestamp: String? = nil, traceId: String? = nil, value: Double? = nil) {
|
|
self.comment = comment
|
|
self.dataType = dataType
|
|
self.id = id
|
|
self.name = name
|
|
self.runName = runName
|
|
self.stringValue = stringValue
|
|
self.timestamp = timestamp
|
|
self.traceId = traceId
|
|
self.value = value
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case comment
|
|
case dataType
|
|
case id
|
|
case name
|
|
case runName
|
|
case stringValue
|
|
case timestamp
|
|
case traceId
|
|
case value
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(comment, forKey: .comment)
|
|
try container.encodeIfPresent(dataType, forKey: .dataType)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(name, forKey: .name)
|
|
try container.encodeIfPresent(runName, forKey: .runName)
|
|
try container.encodeIfPresent(stringValue, forKey: .stringValue)
|
|
try container.encodeIfPresent(timestamp, forKey: .timestamp)
|
|
try container.encodeIfPresent(traceId, forKey: .traceId)
|
|
try container.encodeIfPresent(value, forKey: .value)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension ScoreView: Identifiable {}
|