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.
61 lines
2.2 KiB
Swift
61 lines
2.2 KiB
Swift
//
|
|
// OpenaiChatCompletionResponse.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct OpenaiChatCompletionResponse: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
public var choices: [OpenaiChatCompletionChoice]?
|
|
public var created: Int?
|
|
public var id: String?
|
|
public var model: String?
|
|
public var object: String?
|
|
public var promptFilterResults: [OpenaiPromptFilterResult]?
|
|
public var systemFingerprint: String?
|
|
public var usage: OpenaiUsage?
|
|
|
|
public init(choices: [OpenaiChatCompletionChoice]? = nil, created: Int? = nil, id: String? = nil, model: String? = nil, object: String? = nil, promptFilterResults: [OpenaiPromptFilterResult]? = nil, systemFingerprint: String? = nil, usage: OpenaiUsage? = nil) {
|
|
self.choices = choices
|
|
self.created = created
|
|
self.id = id
|
|
self.model = model
|
|
self.object = object
|
|
self.promptFilterResults = promptFilterResults
|
|
self.systemFingerprint = systemFingerprint
|
|
self.usage = usage
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case choices
|
|
case created
|
|
case id
|
|
case model
|
|
case object
|
|
case promptFilterResults = "prompt_filter_results"
|
|
case systemFingerprint = "system_fingerprint"
|
|
case usage
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(choices, forKey: .choices)
|
|
try container.encodeIfPresent(created, forKey: .created)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(model, forKey: .model)
|
|
try container.encodeIfPresent(object, forKey: .object)
|
|
try container.encodeIfPresent(promptFilterResults, forKey: .promptFilterResults)
|
|
try container.encodeIfPresent(systemFingerprint, forKey: .systemFingerprint)
|
|
try container.encodeIfPresent(usage, forKey: .usage)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension OpenaiChatCompletionResponse: Identifiable {}
|