mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
56 lines
1.8 KiB
Swift
56 lines
1.8 KiB
Swift
//
|
|
// ModelRow.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct ModelRow: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Model is the model id, e.g. zen5-coder. */
|
|
public var model: String?
|
|
/** Pct is this model's share of the window's returned spend, 0..100, one decimal. */
|
|
public var pct: Double?
|
|
/** Provider is who served it. */
|
|
public var provider: String?
|
|
/** Requests is how many calls went to this model. */
|
|
public var requests: Int64?
|
|
/** SpendCents is what they cost, in cents. */
|
|
public var spendCents: Int64?
|
|
/** Tokens is prompt plus completion tokens over those calls. */
|
|
public var tokens: Int64?
|
|
|
|
public init(model: String? = nil, pct: Double? = nil, provider: String? = nil, requests: Int64? = nil, spendCents: Int64? = nil, tokens: Int64? = nil) {
|
|
self.model = model
|
|
self.pct = pct
|
|
self.provider = provider
|
|
self.requests = requests
|
|
self.spendCents = spendCents
|
|
self.tokens = tokens
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case model
|
|
case pct
|
|
case provider
|
|
case requests
|
|
case spendCents
|
|
case tokens
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(model, forKey: .model)
|
|
try container.encodeIfPresent(pct, forKey: .pct)
|
|
try container.encodeIfPresent(provider, forKey: .provider)
|
|
try container.encodeIfPresent(requests, forKey: .requests)
|
|
try container.encodeIfPresent(spendCents, forKey: .spendCents)
|
|
try container.encodeIfPresent(tokens, forKey: .tokens)
|
|
}
|
|
}
|
|
|