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.9 KiB
Swift
51 lines
1.9 KiB
Swift
//
|
|
// Report.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Report: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Answer is the grounded prose, with inline markdown citations. Every link in it points at a page in Sources: the citation check runs on the text before it leaves the engine, so a cited URL is one THIS call fetched. */
|
|
public var answer: String?
|
|
/** FollowUps are the questions worth asking next. Best-effort — an empty list is a normal outcome, not a fault. */
|
|
public var followUps: [String]?
|
|
/** Mode is the profile that ran: search, news, research or deep. */
|
|
public var mode: String?
|
|
/** Model is the model that synthesized the answer. */
|
|
public var model: String?
|
|
/** Sources are the pages the answer was written from, deduplicated and ranked. Always an array, never null. */
|
|
public var sources: [Source]?
|
|
|
|
public init(answer: String? = nil, followUps: [String]? = nil, mode: String? = nil, model: String? = nil, sources: [Source]? = nil) {
|
|
self.answer = answer
|
|
self.followUps = followUps
|
|
self.mode = mode
|
|
self.model = model
|
|
self.sources = sources
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case answer
|
|
case followUps = "follow_ups"
|
|
case mode
|
|
case model
|
|
case sources
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(answer, forKey: .answer)
|
|
try container.encodeIfPresent(followUps, forKey: .followUps)
|
|
try container.encodeIfPresent(mode, forKey: .mode)
|
|
try container.encodeIfPresent(model, forKey: .model)
|
|
try container.encodeIfPresent(sources, forKey: .sources)
|
|
}
|
|
}
|
|
|