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.
79 lines
3.0 KiB
Swift
79 lines
3.0 KiB
Swift
//
|
|
// O11yO11yLLMTrace.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct O11yO11yLLMTrace: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** CompletionTokens is the trace's total output tokens. */
|
|
public var completionTokens: Int64?
|
|
/** ID is the trace id. */
|
|
public var id: String?
|
|
/** LatencyMs is the trace's span, in milliseconds. */
|
|
public var latencyMs: Double?
|
|
/** Observations is how many observations the trace holds. */
|
|
public var observations: Int64?
|
|
/** PromptTokens is the trace's total input tokens. */
|
|
public var promptTokens: Int64?
|
|
/** ServiceName is the app that emitted it. */
|
|
public var serviceName: String?
|
|
/** SessionID is the conversation the trace belongs to. */
|
|
public var sessionId: String?
|
|
/** TotalCost is the trace's total cost. */
|
|
public var totalCost: Double?
|
|
/** TotalTokens is the trace's total tokens. */
|
|
public var totalTokens: Int64?
|
|
/** UserID is the end user the trace is attributed to. */
|
|
public var userId: String?
|
|
|
|
public init(completionTokens: Int64? = nil, id: String? = nil, latencyMs: Double? = nil, observations: Int64? = nil, promptTokens: Int64? = nil, serviceName: String? = nil, sessionId: String? = nil, totalCost: Double? = nil, totalTokens: Int64? = nil, userId: String? = nil) {
|
|
self.completionTokens = completionTokens
|
|
self.id = id
|
|
self.latencyMs = latencyMs
|
|
self.observations = observations
|
|
self.promptTokens = promptTokens
|
|
self.serviceName = serviceName
|
|
self.sessionId = sessionId
|
|
self.totalCost = totalCost
|
|
self.totalTokens = totalTokens
|
|
self.userId = userId
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case completionTokens
|
|
case id
|
|
case latencyMs
|
|
case observations
|
|
case promptTokens
|
|
case serviceName
|
|
case sessionId
|
|
case totalCost
|
|
case totalTokens
|
|
case userId
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(completionTokens, forKey: .completionTokens)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(latencyMs, forKey: .latencyMs)
|
|
try container.encodeIfPresent(observations, forKey: .observations)
|
|
try container.encodeIfPresent(promptTokens, forKey: .promptTokens)
|
|
try container.encodeIfPresent(serviceName, forKey: .serviceName)
|
|
try container.encodeIfPresent(sessionId, forKey: .sessionId)
|
|
try container.encodeIfPresent(totalCost, forKey: .totalCost)
|
|
try container.encodeIfPresent(totalTokens, forKey: .totalTokens)
|
|
try container.encodeIfPresent(userId, forKey: .userId)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension O11yO11yLLMTrace: Identifiable {}
|