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.
51 lines
1.6 KiB
Swift
51 lines
1.6 KiB
Swift
//
|
|
// ItemResult.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct ItemResult: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Error is why this example produced no score — the model, the judge, or the run's deadline. A result carrying one is not counted in Scored. */
|
|
public var error: String?
|
|
/** ItemID is the example that was scored. */
|
|
public var itemId: String?
|
|
/** Output is what the model under test answered, truncated at 2000 characters. */
|
|
public var output: String?
|
|
/** Score is the judge's grade. */
|
|
public var score: Double?
|
|
/** TraceID is the model call this result came from. */
|
|
public var traceId: String?
|
|
|
|
public init(error: String? = nil, itemId: String? = nil, output: String? = nil, score: Double? = nil, traceId: String? = nil) {
|
|
self.error = error
|
|
self.itemId = itemId
|
|
self.output = output
|
|
self.score = score
|
|
self.traceId = traceId
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case error
|
|
case itemId
|
|
case output
|
|
case score
|
|
case traceId
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(error, forKey: .error)
|
|
try container.encodeIfPresent(itemId, forKey: .itemId)
|
|
try container.encodeIfPresent(output, forKey: .output)
|
|
try container.encodeIfPresent(score, forKey: .score)
|
|
try container.encodeIfPresent(traceId, forKey: .traceId)
|
|
}
|
|
}
|
|
|