mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
288 of hanzoai/ai's 294 operations now declare a response, against 1 before. GET /v1/models, POST /v1/chat/completions, /v1/embeddings, /v1/messages — every address a client actually calls — used to reach this client untyped, because cloud's relay carried an operation's sentence and dropped the shapes it named. It carries both now. Fleet-wide the document goes from 69% to 81% of operations declaring what comes back, which is where the ~208 new models here come from.
81 lines
3.0 KiB
Swift
81 lines
3.0 KiB
Swift
//
|
|
// AiModelInfo.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct AiModelInfo: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
public var access: AiModelAccessInfo?
|
|
public var contextWindow: Int?
|
|
public var created: Int?
|
|
public var id: String?
|
|
public var maxOutputTokens: Int?
|
|
public var object: String?
|
|
public var outputs: [String]?
|
|
public var ownedBy: String?
|
|
public var premium: Bool?
|
|
public var pricing: AiModelPricingInfo?
|
|
public var provider: String?
|
|
public var supportsTools: Bool?
|
|
public var supportsVision: Bool?
|
|
|
|
public init(access: AiModelAccessInfo? = nil, contextWindow: Int? = nil, created: Int? = nil, id: String? = nil, maxOutputTokens: Int? = nil, object: String? = nil, outputs: [String]? = nil, ownedBy: String? = nil, premium: Bool? = nil, pricing: AiModelPricingInfo? = nil, provider: String? = nil, supportsTools: Bool? = nil, supportsVision: Bool? = nil) {
|
|
self.access = access
|
|
self.contextWindow = contextWindow
|
|
self.created = created
|
|
self.id = id
|
|
self.maxOutputTokens = maxOutputTokens
|
|
self.object = object
|
|
self.outputs = outputs
|
|
self.ownedBy = ownedBy
|
|
self.premium = premium
|
|
self.pricing = pricing
|
|
self.provider = provider
|
|
self.supportsTools = supportsTools
|
|
self.supportsVision = supportsVision
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case access
|
|
case contextWindow = "context_window"
|
|
case created
|
|
case id
|
|
case maxOutputTokens = "max_output_tokens"
|
|
case object
|
|
case outputs
|
|
case ownedBy = "owned_by"
|
|
case premium
|
|
case pricing
|
|
case provider
|
|
case supportsTools = "supports_tools"
|
|
case supportsVision = "supports_vision"
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(access, forKey: .access)
|
|
try container.encodeIfPresent(contextWindow, forKey: .contextWindow)
|
|
try container.encodeIfPresent(created, forKey: .created)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(maxOutputTokens, forKey: .maxOutputTokens)
|
|
try container.encodeIfPresent(object, forKey: .object)
|
|
try container.encodeIfPresent(outputs, forKey: .outputs)
|
|
try container.encodeIfPresent(ownedBy, forKey: .ownedBy)
|
|
try container.encodeIfPresent(premium, forKey: .premium)
|
|
try container.encodeIfPresent(pricing, forKey: .pricing)
|
|
try container.encodeIfPresent(provider, forKey: .provider)
|
|
try container.encodeIfPresent(supportsTools, forKey: .supportsTools)
|
|
try container.encodeIfPresent(supportsVision, forKey: .supportsVision)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension AiModelInfo: Identifiable {}
|