| 15 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 16 | @available(tvOS, unavailable) |
| 17 | @available(watchOS, unavailable) |
| 18 | extension FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Refusal { |
| 19 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 20 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 21 | @available(tvOS, unavailable) |
| 22 | @available(watchOS, unavailable) |
| 23 | nonisolated(nonsending) public var explanation: FoundationModels::LanguageModelSession.FoundationModels::Response<Swift::String> { |
| 24 | get async throws |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 25 | } |
| 26 | #endif |
| 27 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 28 | @available(tvOS, unavailable) |
| 29 | @available(watchOS, unavailable) |
| 30 | public var explanationStream: FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Swift::String> { |
| 31 | get |
| 32 | } |
| 33 | } |
| 34 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 35 | @available(tvOS, unavailable) |
| 36 | @available(watchOS, unavailable) |
| 37 | extension FoundationModels::LanguageModelSession { |
| 38 | @_disfavoredOverload convenience public init(model: FoundationModels::SystemLanguageModel = .default, tools: [any FoundationModels::Tool] = [], instructions: Swift::String? = nil) |
| 39 | convenience public init(model: FoundationModels::SystemLanguageModel = .default, tools: [any FoundationModels::Tool] = [], @FoundationModels::InstructionsBuilder instructions: () throws -> FoundationModels::Instructions) rethrows |
| 40 | convenience public init(model: FoundationModels::SystemLanguageModel = .default, tools: [any FoundationModels::Tool] = [], instructions: FoundationModels::Instructions? = nil) |
| 41 | convenience public init(model: FoundationModels::SystemLanguageModel = .default, tools: [any FoundationModels::Tool] = [], transcript: FoundationModels::Transcript) |
| 42 | } |
| 43 | @_hasMissingDesignatedInitializers @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 44 | @available(tvOS, unavailable) |
| 45 | final public class PrivateCloudComputeLanguageModel : Swift::Sendable { |
| 46 | final public var availability: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Availability { |
| |
| |
| |
| |
| |
| |
| |
| 47 | get |
| 48 | } |
| 49 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 50 | @available(tvOS, unavailable) |
| 51 | final public var quotaUsage: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::QuotaUsage { |
| |
| |
| |
| 52 | get |
| 53 | } |
| 54 | final public var isAvailable: Swift::Bool { |
| |
| 55 | get |
| 56 | } |
| 57 | @objc deinit |
| 58 | } |
| 59 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 60 | @available(tvOS, unavailable) |
| 61 | extension FoundationModels::PrivateCloudComputeLanguageModel { |
| 62 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 63 | @available(tvOS, unavailable) |
| 64 | convenience public init() |
| 65 | } |
| 66 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 67 | @available(tvOS, unavailable) |
| 68 | extension FoundationModels::PrivateCloudComputeLanguageModel { |
| 69 | @frozen public enum Availability : Swift::Equatable, Swift::Sendable { |
| 70 | case available |
| 71 | case unavailable(FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Availability.FoundationModels::UnavailableReason) |
| 72 | public enum UnavailableReason : Swift::Equatable, Swift::Sendable { |
| 73 | case deviceNotEligible |
| 74 | case systemNotReady |
| 75 | public static func == (a: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Availability.FoundationModels::UnavailableReason, b: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Availability.FoundationModels::UnavailableReason) -> Swift::Bool |
| 76 | public func hash(into hasher: inout Swift::Hasher) |
| 77 | public var hashValue: Swift::Int { |
| 78 | get |
| 79 | } |
| 80 | } |
| 81 | public static func == (a: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Availability, b: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Availability) -> Swift::Bool |
| 82 | } |
| 83 | } |
| 84 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 85 | @available(tvOS, unavailable) |
| 86 | extension FoundationModels::PrivateCloudComputeLanguageModel : nonisolated Observation::Observable { |
| 87 | } |
| 88 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 89 | @available(tvOS, unavailable) |
| 90 | extension FoundationModels::PrivateCloudComputeLanguageModel : FoundationModels::LanguageModel { |
| 91 | final public var capabilities: FoundationModels::LanguageModelCapabilities { |
| 92 | get |
| 93 | } |
| 94 | final public var executorConfiguration: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Executor.FoundationModels::Configuration { |
| |
| 95 | get |
| 96 | } |
| 97 | public struct Executor : FoundationModels::LanguageModelExecutor { |
| 98 | public typealias Model = FoundationModels::PrivateCloudComputeLanguageModel |
| 99 | public init(configuration: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Executor.FoundationModels::Configuration) |
| 100 | public func prewarm(model: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Executor.FoundationModels::Model, transcript: FoundationModels::Transcript) |
| 101 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 102 | nonisolated(nonsending) public func respond(to request: FoundationModels::LanguageModelExecutorGenerationRequest, model: FoundationModels::PrivateCloudComputeLanguageModel, streamingInto channel: FoundationModels::LanguageModelExecutorGenerationChannel) async throws |
| 103 | #endif |
| 104 | } |
| 105 | } |
| 106 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 107 | @available(tvOS, unavailable) |
| 108 | extension FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Executor { |
| 109 | public struct Configuration : Swift::Hashable & Swift::Sendable { |
| 110 | public static func == (a: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Executor.FoundationModels::Configuration, b: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Executor.FoundationModels::Configuration) -> Swift::Bool |
| 111 | public func hash(into hasher: inout Swift::Hasher) |
| 112 | public var hashValue: Swift::Int { |
| 113 | get |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 118 | @available(tvOS, unavailable) |
| 119 | extension FoundationModels::PrivateCloudComputeLanguageModel { |
| 120 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 121 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 122 | @available(tvOS, unavailable) |
| 123 | nonisolated(nonsending) final public var contextSize: Swift::Int { |
| 124 | get async throws |
| 125 | } |
| 126 | #endif |
| 127 | } |
| 128 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 129 | @available(tvOS, unavailable) |
| 130 | extension FoundationModels::PrivateCloudComputeLanguageModel { |
| 131 | final public var supportedLanguages: Swift::Set<Foundation::Locale.Foundation::Language> { |
| 132 | get |
| 133 | } |
| 134 | final public func supportsLocale(_ locale: Foundation::Locale = Locale.current) -> Swift::Bool |
| 135 | } |
| 136 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 137 | @available(tvOS, unavailable) |
| 138 | extension FoundationModels::PrivateCloudComputeLanguageModel { |
| 139 | public enum Error : Swift::Error, Foundation::LocalizedError, Swift::CustomDebugStringConvertible { |
| 140 | case networkFailure(FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Error.FoundationModels::NetworkFailure) |
| 141 | case quotaLimitReached(FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Error.FoundationModels::QuotaLimitReached) |
| 142 | case serviceUnavailable(FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::Error.FoundationModels::ServiceUnavailable) |
| 143 | public var debugDescription: Swift::String { |
| 144 | get |
| 145 | } |
| 146 | public var errorDescription: Swift::String? { |
| 147 | get |
| 148 | } |
| 149 | public struct NetworkFailure : Swift::Sendable { |
| 150 | public var debugDescription: Swift::String |
| 151 | public init(debugDescription: Swift::String) |
| 152 | } |
| 153 | public struct QuotaLimitReached : Swift::Sendable { |
| 154 | public var limitIncreaseSuggestion: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::QuotaUsage.FoundationModels::LimitIncreaseSuggestion? |
| 155 | public var resetDate: Foundation::Date? |
| 156 | public var debugDescription: Swift::String |
| 157 | public init(limitIncreaseSuggestion: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::QuotaUsage.FoundationModels::LimitIncreaseSuggestion? = nil, resetDate: Foundation::Date? = nil, debugDescription: Swift::String) |
| 158 | } |
| 159 | public struct ServiceUnavailable : Swift::Sendable { |
| 160 | public var debugDescription: Swift::String |
| 161 | public init(debugDescription: Swift::String) |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 166 | @available(tvOS, unavailable) |
| 167 | extension FoundationModels::PrivateCloudComputeLanguageModel { |
| 168 | public struct QuotaUsage : Swift::Sendable { |
| 169 | public var status: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::QuotaUsage.FoundationModels::Status |
| 170 | public var isLimitReached: Swift::Bool { |
| 171 | get |
| 172 | } |
| 173 | public var limitIncreaseSuggestion: FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::QuotaUsage.FoundationModels::LimitIncreaseSuggestion? |
| 174 | public var resetDate: Foundation::Date? |
| 175 | public enum Status : Swift::Sendable { |
| 176 | case belowLimit(FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::QuotaUsage.FoundationModels::Status.FoundationModels::BelowLimit) |
| 177 | case limitReached(FoundationModels::PrivateCloudComputeLanguageModel.FoundationModels::QuotaUsage.FoundationModels::Status.FoundationModels::LimitReached) |
| 178 | public struct BelowLimit : Swift::Sendable { |
| 179 | public var isApproachingLimit: Swift::Bool |
| 180 | } |
| 181 | public struct LimitReached : Swift::Sendable { |
| 182 | } |
| 183 | } |
| 184 | public struct LimitIncreaseSuggestion : Swift::Sendable { |
| 185 | public func show() |
| 186 | } |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 187 | } |
| 188 | } |
| 189 | @_hasMissingDesignatedInitializers @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 190 | @available(tvOS, unavailable) |
| 191 | @available(watchOS, unavailable) |
| 192 | final public class SystemLanguageModel : Swift::Sendable { |
| 193 | final public var availability: FoundationModels::SystemLanguageModel.FoundationModels::Availability { |
| 194 | get |
| 195 | } |
| 196 | final public var isAvailable: Swift::Bool { |
| 197 | get |
| 198 | } |
| 199 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 200 | @available(tvOS, unavailable) |
| 201 | @available(watchOS, unavailable) |
| 202 | public struct UseCase : Swift::Sendable, Swift::Equatable { |
| 203 | public static let general: FoundationModels::SystemLanguageModel.FoundationModels::UseCase |
| 204 | public static let contentTagging: FoundationModels::SystemLanguageModel.FoundationModels::UseCase |
| 205 | public static func == (a: FoundationModels::SystemLanguageModel.FoundationModels::UseCase, b: FoundationModels::SystemLanguageModel.FoundationModels::UseCase) -> Swift::Bool |
| 206 | } |
| 207 | @objc deinit |
| 208 | } |
| 209 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 210 | @available(tvOS, unavailable) |
| 211 | @available(watchOS, unavailable) |
| 212 | extension FoundationModels::SystemLanguageModel : nonisolated Observation::Observable { |
| 213 | } |
| 214 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, *) |
| 215 | @available(watchOS, unavailable) |
| 216 | @available(tvOS, unavailable) |
| 217 | extension FoundationModels::SystemLanguageModel : FoundationModels::LanguageModel { |
| 218 | final public var capabilities: FoundationModels::LanguageModelCapabilities { |
| |
| 219 | get |
| 220 | } |
| 221 | final public var executorConfiguration: FoundationModels::SystemLanguageModel.FoundationModels::Executor.FoundationModels::Configuration { |
| 222 | get |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 223 | } |
| 224 | public struct Executor : FoundationModels::LanguageModelExecutor { |
| 225 | public typealias Model = FoundationModels::SystemLanguageModel |
| 226 | public init(configuration: FoundationModels::SystemLanguageModel.FoundationModels::Executor.FoundationModels::Configuration) |
| 227 | public func prewarm(model: FoundationModels::SystemLanguageModel.FoundationModels::Executor.FoundationModels::Model, transcript: FoundationModels::Transcript) |
| 228 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 229 | nonisolated(nonsending) public func respond(to request: FoundationModels::LanguageModelExecutorGenerationRequest, model: FoundationModels::SystemLanguageModel, streamingInto channel: FoundationModels::LanguageModelExecutorGenerationChannel) async throws |
| 230 | #endif |
| 231 | } |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 232 | } |
| 233 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, *) |
| 234 | @available(watchOS, unavailable) |
| 235 | @available(tvOS, unavailable) |
| 236 | extension FoundationModels::SystemLanguageModel.FoundationModels::Executor { |
| 237 | public struct Configuration : Swift::Hashable & Swift::Sendable { |
| 238 | public static func == (a: FoundationModels::SystemLanguageModel.FoundationModels::Executor.FoundationModels::Configuration, b: FoundationModels::SystemLanguageModel.FoundationModels::Executor.FoundationModels::Configuration) -> Swift::Bool |
| 239 | public func hash(into hasher: inout Swift::Hasher) |
| 240 | public var hashValue: Swift::Int { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 241 | get |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 246 | @available(tvOS, unavailable) |
| 247 | @available(watchOS, unavailable) |
| 248 | extension FoundationModels::SystemLanguageModel { |
| 249 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 250 | @available(tvOS, unavailable) |
| 251 | @available(watchOS, unavailable) |
| 252 | public struct Guardrails : Swift::Sendable { |
| 253 | public static let `default`: FoundationModels::SystemLanguageModel.FoundationModels::Guardrails |
| 254 | public static let permissiveContentTransformations: FoundationModels::SystemLanguageModel.FoundationModels::Guardrails |
| |
| |
| 255 | } |
| 256 | } |
| 257 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 258 | @available(tvOS, unavailable) |
| 259 | @available(watchOS, unavailable) |
| 260 | extension FoundationModels::SystemLanguageModel { |
| |
| 261 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 262 | @available(tvOS, unavailable) |
| 263 | @available(watchOS, unavailable) |
| 264 | @frozen public enum Availability : Swift::Equatable, Swift::Sendable { |
| 265 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| |
| 266 | @available(tvOS, unavailable) |
| 267 | @available(watchOS, unavailable) |
| 268 | public enum UnavailableReason : Swift::Equatable, Swift::Sendable { |
| 269 | case deviceNotEligible |
| 270 | case appleIntelligenceNotEnabled |
| 271 | case modelNotReady |
| 272 | public static func == (a: FoundationModels::SystemLanguageModel.FoundationModels::Availability.FoundationModels::UnavailableReason, b: FoundationModels::SystemLanguageModel.FoundationModels::Availability.FoundationModels::UnavailableReason) -> Swift::Bool |
| 273 | public func hash(into hasher: inout Swift::Hasher) |
| 274 | public var hashValue: Swift::Int { |
| 275 | get |
| 276 | } |
| 277 | } |
| 278 | case available |
| 279 | case unavailable(FoundationModels::SystemLanguageModel.FoundationModels::Availability.FoundationModels::UnavailableReason) |
| 280 | public static func == (a: FoundationModels::SystemLanguageModel.FoundationModels::Availability, b: FoundationModels::SystemLanguageModel.FoundationModels::Availability) -> Swift::Bool |
| 281 | } |
| 282 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| |
| |
| |
| |
| 283 | @available(tvOS, unavailable) |
| 284 | @available(watchOS, unavailable) |
| 285 | public static var `default`: FoundationModels::SystemLanguageModel { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 286 | get |
| 287 | } |
| 288 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 289 | @available(tvOS, unavailable) |
| 290 | @available(watchOS, unavailable) |
| 291 | convenience public init(useCase: FoundationModels::SystemLanguageModel.FoundationModels::UseCase = .general, guardrails: FoundationModels::SystemLanguageModel.FoundationModels::Guardrails = Guardrails.default) |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 292 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 293 | @available(iOS, obsoleted: 27.0) |
| 294 | @available(macOS, obsoleted: 27.0) |
| 295 | @available(visionOS, obsoleted: 27.0) |
| 296 | @available(watchOS, unavailable) |
| 297 | @available(tvOS, unavailable) |
| 298 | convenience public init(adapter: FoundationModels::SystemLanguageModel.FoundationModels::Adapter, guardrails: FoundationModels::SystemLanguageModel.FoundationModels::Guardrails = .default) |
| 299 | final public var supportedLanguages: Swift::Set<Foundation::Locale.Foundation::Language> { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 300 | get |
| 301 | } |
| 302 | final public func supportsLocale(_ locale: Foundation::Locale = Locale.current) -> Swift::Bool |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 303 | } |
| 304 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, *) |
| 305 | @available(tvOS, unavailable) |
| 306 | @available(watchOS, unavailable) |
| 307 | extension FoundationModels::SystemLanguageModel { |
| 308 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 309 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, *) |
| 310 | @available(tvOS, unavailable) |
| 311 | @available(watchOS, unavailable) |
| 312 | nonisolated(nonsending) final public func tokenCount(for prompt: some PromptRepresentable) async throws -> Swift::Int |
| 313 | #endif |
| 314 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 315 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, *) |
| 316 | @available(tvOS, unavailable) |
| 317 | @available(watchOS, unavailable) |
| 318 | nonisolated(nonsending) final public func tokenCount(for instructions: FoundationModels::Instructions) async throws -> Swift::Int |
| 319 | #endif |
| 320 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 321 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, *) |
| 322 | @available(tvOS, unavailable) |
| 323 | @available(watchOS, unavailable) |
| 324 | nonisolated(nonsending) final public func tokenCount(for tools: [any FoundationModels::Tool]) async throws -> Swift::Int |
| 325 | #endif |
| 326 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 327 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, *) |
| 328 | @available(tvOS, unavailable) |
| 329 | @available(watchOS, unavailable) |
| 330 | nonisolated(nonsending) final public func tokenCount(for schema: FoundationModels::GenerationSchema) async throws -> Swift::Int |
| 331 | #endif |
| 332 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 333 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, *) |
| 334 | @available(tvOS, unavailable) |
| 335 | @available(watchOS, unavailable) |
| 336 | nonisolated(nonsending) final public func tokenCount(for transcriptEntries: some Collection<Transcript.Entry>) async throws -> Swift::Int |
| 337 | #endif |
| 338 | } |
| 339 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 340 | @available(tvOS, unavailable) |
| 341 | @available(watchOS, unavailable) |
| 342 | extension FoundationModels::SystemLanguageModel { |
| 343 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 344 | @backDeployed(before: iOS 26.4, macOS 26.4, visionOS 26.4) |
| 345 | @available(tvOS, unavailable) |
| 346 | @available(watchOS, unavailable) |
| 347 | final public var contextSize: Swift::Int { |
| 348 | get { |
| 349 | if #available(iOS 27.0, macOS 27.0, visionOS 27.0, tvOS 27.0, watchOS 27.0, *) { |
| 350 | return _contextSize |
| 351 | } |
| 352 | |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | return 4096 |
| 358 | } |
| 359 | } |
| 360 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, *) |
| 361 | @usableFromInline |
| 362 | final internal var _contextSize: Swift::Int { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 363 | get |
| 364 | } |
| 365 | } |
| 366 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 367 | @available(watchOS, unavailable) |
| 368 | @available(tvOS, unavailable) |
| 369 | extension FoundationModels::SystemLanguageModel { |
| 370 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 371 | @available(iOS, deprecated: 26.4, obsoleted: 27.0) |
| 372 | @available(macOS, deprecated: 26.4, obsoleted: 27.0) |
| 373 | @available(visionOS, deprecated: 26.4, obsoleted: 27.0) |
| 374 | @available(watchOS, unavailable) |
| 375 | @available(tvOS, unavailable) |
| 376 | public struct Adapter { |
| 377 | public var creatorDefinedMetadata: [Swift::String : Any] { |
| 378 | get |
| 379 | } |
| 380 | } |
| 381 | } |
| 382 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 383 | @available(iOS, deprecated: 26.4, obsoleted: 27.0) |
| 384 | @available(macOS, deprecated: 26.4, obsoleted: 27.0) |
| 385 | @available(visionOS, deprecated: 26.4, obsoleted: 27.0) |
| 386 | @available(watchOS, unavailable) |
| 387 | @available(tvOS, unavailable) |
| 388 | extension FoundationModels::SystemLanguageModel.FoundationModels::Adapter { |
| 389 | public init(fileURL: Foundation::URL) throws |
| 390 | public init(name: Swift::String) throws |
| 391 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 392 | @concurrent public func compile() async throws |
| 393 | #endif |
| 394 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 395 | @available(iOS, deprecated: 26.4, obsoleted: 27.0) |
| 396 | @available(macOS, deprecated: 26.4, obsoleted: 27.0) |
| 397 | @available(visionOS, deprecated: 26.4, obsoleted: 27.0) |
| 398 | @available(watchOS, unavailable) |
| 399 | @available(tvOS, unavailable) |
| 400 | public static func compatibleAdapterIdentifiers(name: Swift::String) -> [Swift::String] |
| 401 | public static func removeObsoleteAdapters() throws |
| 402 | } |
| 403 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 404 | @available(iOS, deprecated: 26.4) |
| 405 | @available(macOS, deprecated: 26.4) |
| 406 | @available(visionOS, deprecated: 26.4) |
| 407 | @available(watchOS, unavailable) |
| 408 | @available(tvOS, unavailable) |
| 409 | extension FoundationModels::SystemLanguageModel.FoundationModels::Adapter { |
| 410 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 411 | @available(watchOS, unavailable) |
| 412 | @available(tvOS, unavailable) |
| 413 | public enum AssetError : Swift::Error, Foundation::LocalizedError { |
| 414 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 415 | @available(iOS, deprecated: 26.4) |
| 416 | @available(macOS, deprecated: 26.4) |
| 417 | @available(visionOS, deprecated: 26.4) |
| 418 | @available(watchOS, unavailable) |
| 419 | @available(tvOS, unavailable) |
| 420 | public struct Context : Swift::Sendable { |
| 421 | public let debugDescription: Swift::String |
| 422 | public init(debugDescription: Swift::String) |
| 423 | } |
| 424 | case invalidAsset(FoundationModels::SystemLanguageModel.FoundationModels::Adapter.FoundationModels::AssetError.FoundationModels::Context) |
| 425 | case invalidAdapterName(FoundationModels::SystemLanguageModel.FoundationModels::Adapter.FoundationModels::AssetError.FoundationModels::Context) |
| 426 | case compatibleAdapterNotFound(FoundationModels::SystemLanguageModel.FoundationModels::Adapter.FoundationModels::AssetError.FoundationModels::Context) |
| 427 | public var errorDescription: Swift::String? { |
| 428 | get |
| 429 | } |
| 430 | public var recoverySuggestion: Swift::String? { |
| 431 | get |
| 432 | } |
| 433 | } |
| 434 | } |
| 435 | @available(tvOS, unavailable) |
| 436 | @available(watchOS, unavailable) |
| 437 | extension FoundationModels::SystemLanguageModel { |
| 438 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, *) |
| 439 | @available(tvOS, unavailable) |
| 440 | @available(watchOS, unavailable) |
| 441 | public enum Error : Foundation::LocalizedError, Swift::CustomDebugStringConvertible { |
| 442 | case assetsUnavailable(FoundationModels::SystemLanguageModel.FoundationModels::Error.FoundationModels::AssetsUnavailable) |
| 443 | public struct AssetsUnavailable : Swift::Sendable { |
| 444 | public var debugDescription: Swift::String |
| 445 | public init(debugDescription: Swift::String) |
| 446 | } |
| 447 | public var debugDescription: Swift::String { |
| 448 | get |
| 449 | } |
| 450 | public var errorDescription: Swift::String? { |
| 451 | get |
| 452 | } |
| 453 | } |
| 454 | } |
| 455 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 456 | @available(tvOS, unavailable) |
| 457 | public struct _DynamicInstructionsInputs { |
| 458 | } |
| 459 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 460 | @available(tvOS, unavailable) |
| 461 | public struct _DynamicInstructionsOutputs { |
| 462 | } |
| 463 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 464 | @available(tvOS, unavailable) |
| 465 | public struct AnyDynamicInstructions : FoundationModels::DynamicInstructions { |
| 466 | public init(_ dynamicInstructions: any FoundationModels::DynamicInstructions) |
| 467 | @_alwaysEmitIntoClient public init(erasing dynamicInstructions: some DynamicInstructions) { |
| 468 | self.init(dynamicInstructions) |
| 469 | } |
| 470 | public var body: Swift::Never { |
| 471 | get |
| 472 | } |
| 473 | public static func _makeDynamicInstructions(_ value: FoundationModels::_DSLValue<FoundationModels::AnyDynamicInstructions>, _ inputs: FoundationModels::_DynamicInstructionsInputs) -> FoundationModels::_DynamicInstructionsOutputs |
| 474 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 475 | @available(tvOS, unavailable) |
| 476 | public typealias Body = Swift::Never |
| 477 | } |
| 478 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 479 | @available(tvOS, unavailable) |
| 480 | @_typeEraser(AnyDynamicInstructions) public protocol DynamicInstructions { |
| 481 | associatedtype Body : FoundationModels::DynamicInstructions |
| 482 | @FoundationModels::DynamicInstructionsBuilder var body: Self.Body { get } |
| 483 | } |
| 484 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 485 | @available(tvOS, unavailable) |
| 486 | public struct _DSLValue<T> { |
| 487 | } |
| 488 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 489 | @available(tvOS, unavailable) |
| 490 | @_functionBuilder public struct DynamicInstructionsBuilder { |
| 491 | public static func buildExpression<T>(_ expression: T) -> some FoundationModels::DynamicInstructions where T : FoundationModels::Tool |
| 492 | |
| 493 | public static func buildExpression<T>(_ expression: T) -> T where T : FoundationModels::DynamicInstructions |
| 494 | public static func buildExpression(_ tools: [any FoundationModels::Tool]) -> some FoundationModels::DynamicInstructions |
| 495 | |
| 496 | @_disfavoredOverload public static func buildBlock<each Content>(_ contents: repeat each Content) -> FoundationModels::TupleDynamicInstructions<repeat each Content> where repeat each Content : FoundationModels::DynamicInstructions |
| 497 | public static func buildBlock<T>(_ content: T) -> T where T : FoundationModels::DynamicInstructions |
| 498 | public static func buildBlock() -> FoundationModels::EmptyDynamicInstructions |
| 499 | public static func buildEither<TrueContent, FalseContent>(first content: TrueContent) -> FoundationModels::ConditionalDynamicInstructions<TrueContent, FalseContent> where TrueContent : FoundationModels::DynamicInstructions, FalseContent : FoundationModels::DynamicInstructions |
| 500 | public static func buildEither<TrueContent, FalseContent>(second content: FalseContent) -> FoundationModels::ConditionalDynamicInstructions<TrueContent, FalseContent> where TrueContent : FoundationModels::DynamicInstructions, FalseContent : FoundationModels::DynamicInstructions |
| 501 | public static func buildOptional<Content>(_ content: Content?) -> Content? where Content : FoundationModels::DynamicInstructions |
| 502 | } |
| 503 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 504 | @available(tvOS, unavailable) |
| 505 | public struct TupleDynamicInstructions<each Content> : FoundationModels::DynamicInstructions where repeat each Content : FoundationModels::DynamicInstructions { |
| 506 | public init(_ contents: repeat each Content) |
| 507 | public var body: Swift::Never { |
| 508 | get |
| 509 | } |
| 510 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 511 | @available(tvOS, unavailable) |
| 512 | public typealias Body = Swift::Never |
| 513 | } |
| 514 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 515 | @available(tvOS, unavailable) |
| 516 | public struct ConditionalDynamicInstructions<TrueContent, FalseContent> : FoundationModels::DynamicInstructions where TrueContent : FoundationModels::DynamicInstructions, FalseContent : FoundationModels::DynamicInstructions { |
| 517 | public enum Branch { |
| 518 | case trueContent(TrueContent) |
| 519 | case falseContent(FalseContent) |
| 520 | } |
| 521 | public init(_ branch: FoundationModels::ConditionalDynamicInstructions<TrueContent, FalseContent>.FoundationModels::Branch) |
| 522 | public var body: Swift::Never { |
| 523 | get |
| 524 | } |
| 525 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 526 | @available(tvOS, unavailable) |
| 527 | public typealias Body = Swift::Never |
| 528 | } |
| 529 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 530 | @available(tvOS, unavailable) |
| 531 | extension Swift::Optional : FoundationModels::DynamicInstructions where Wrapped : FoundationModels::DynamicInstructions { |
| 532 | public var body: Swift::Never { |
| 533 | get |
| 534 | } |
| 535 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 536 | @available(tvOS, unavailable) |
| 537 | public typealias Body = Swift::Never |
| 538 | } |
| 539 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 540 | @available(tvOS, unavailable) |
| 541 | extension Swift::Never : FoundationModels::DynamicInstructions { |
| 542 | public var body: Swift::Never { |
| 543 | get |
| 544 | } |
| 545 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 546 | @available(tvOS, unavailable) |
| 547 | public typealias Body = Swift::Never |
| 548 | } |
| 549 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 550 | @available(tvOS, unavailable) |
| 551 | public struct EmptyDynamicInstructions : FoundationModels::DynamicInstructions, Swift::Sendable { |
| 552 | public var body: Swift::Never { |
| 553 | get |
| 554 | } |
| 555 | public init() |
| 556 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 557 | @available(tvOS, unavailable) |
| 558 | public typealias Body = Swift::Never |
| 559 | } |
| 560 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 561 | @available(tvOS, unavailable) |
| 562 | public struct _DynamicInstructionsForEach<Data, ID, Content> : FoundationModels::DynamicInstructions where Data : Swift::RandomAccessCollection, ID : Swift::Hashable, Content : FoundationModels::DynamicInstructions { |
| 563 | public var body: Swift::Never { |
| 564 | get |
| 565 | } |
| 566 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 567 | @available(tvOS, unavailable) |
| 568 | public typealias Body = Swift::Never |
| 569 | } |
| 570 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 571 | @available(tvOS, unavailable) |
| 572 | extension FoundationModels::_DynamicInstructionsForEach { |
| 573 | public init(_ data: Data, id: Swift::KeyPath<Data.Element, ID>, @FoundationModels::DynamicInstructionsBuilder content: @escaping (Data.Element) -> Content) |
| 574 | } |
| 575 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 576 | @available(tvOS, unavailable) |
| 577 | extension FoundationModels::_DynamicInstructionsForEach where ID == Data.Element.ID, Data.Element : Swift::Identifiable { |
| 578 | public init(_ data: Data, @FoundationModels::DynamicInstructionsBuilder content: @escaping (Data.Element) -> Content) |
| 579 | } |
| 580 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 581 | @available(tvOS, unavailable) |
| 582 | extension FoundationModels::DynamicInstructions { |
| 583 | public typealias ForEach = FoundationModels::_DynamicInstructionsForEach |
| 584 | } |
| 585 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 586 | @available(tvOS, unavailable) |
| 587 | extension FoundationModels::LanguageModelSession { |
| 588 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 589 | @available(tvOS, unavailable) |
| 590 | public protocol DynamicProfile { |
| 591 | associatedtype Body : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 592 | @FoundationModels::LanguageModelSession.FoundationModels::DynamicProfileBuilder var body: Self.Body { get } |
| 593 | } |
| 594 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 595 | @available(tvOS, unavailable) |
| 596 | public struct Profile : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 597 | public init(@FoundationModels::DynamicInstructionsBuilder _ dynamicInstructions: () -> some DynamicInstructions) |
| 598 | public var body: Swift::Never { |
| 599 | get |
| 600 | } |
| 601 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 602 | @available(tvOS, unavailable) |
| 603 | public typealias Body = Swift::Never |
| 604 | } |
| 605 | } |
| 606 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 607 | @available(tvOS, unavailable) |
| 608 | extension FoundationModels::LanguageModelSession { |
| 609 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 610 | @available(tvOS, unavailable) |
| 611 | public struct ConditionalDynamicProfile<TrueContent, FalseContent> : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile where TrueContent : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile, FalseContent : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 612 | @usableFromInline |
| 613 | internal enum Branch { |
| 614 | case trueContent(TrueContent) |
| 615 | case falseContent(FalseContent) |
| 616 | } |
| 617 | @usableFromInline |
| 618 | internal var branch: FoundationModels::LanguageModelSession.FoundationModels::ConditionalDynamicProfile<TrueContent, FalseContent>.FoundationModels::Branch |
| 619 | @usableFromInline |
| 620 | internal init(_ branch: FoundationModels::LanguageModelSession.FoundationModels::ConditionalDynamicProfile<TrueContent, FalseContent>.FoundationModels::Branch) |
| 621 | public var body: Swift::Never { |
| 622 | get |
| 623 | } |
| 624 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 625 | @available(tvOS, unavailable) |
| 626 | public typealias Body = Swift::Never |
| 627 | } |
| 628 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 629 | @available(tvOS, unavailable) |
| 630 | @_functionBuilder public struct DynamicProfileBuilder { |
| 631 | public static func buildBlock<T>(_ content: T) -> T where T : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 632 | public static func buildEither<TrueContent, FalseContent>(first content: TrueContent) -> FoundationModels::LanguageModelSession.FoundationModels::ConditionalDynamicProfile<TrueContent, FalseContent> where TrueContent : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile, FalseContent : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 633 | public static func buildEither<TrueContent, FalseContent>(second content: FalseContent) -> FoundationModels::LanguageModelSession.FoundationModels::ConditionalDynamicProfile<TrueContent, FalseContent> where TrueContent : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile, FalseContent : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 634 | } |
| 635 | } |
| 636 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 637 | @available(tvOS, unavailable) |
| 638 | extension FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 639 | public typealias Profile = FoundationModels::LanguageModelSession.FoundationModels::Profile |
| 640 | public typealias DynamicProfile = FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 641 | } |
| 642 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 643 | @available(tvOS, unavailable) |
| 644 | extension Swift::Never : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 645 | } |
| 646 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 647 | @available(tvOS, unavailable) |
| 648 | extension FoundationModels::LanguageModelSession { |
| 649 | convenience public init(profile: sending some DynamicProfile, history: some Collection<Transcript.Entry> = []) |
| 650 | } |
| 651 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 652 | @available(tvOS, unavailable) |
| 653 | extension FoundationModels::LanguageModelSession { |
| 654 | public struct _DynamicProfileInputs { |
| 655 | } |
| 656 | public struct _DynamicProfileOutputs { |
| 657 | } |
| 658 | } |
| 659 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 660 | @available(tvOS, unavailable) |
| 661 | extension FoundationModels::LanguageModelSession { |
| 662 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 663 | @available(tvOS, unavailable) |
| 664 | public protocol DynamicProfileModifier { |
| 665 | associatedtype Body : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 666 | @FoundationModels::LanguageModelSession.FoundationModels::DynamicProfileBuilder func body(content: Self.Content) -> Self.Body |
| 667 | typealias Content = FoundationModels::LanguageModelSession.FoundationModels::DynamicProfileModifierContent<Self> |
| 668 | } |
| 669 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 670 | @available(tvOS, unavailable) |
| 671 | public struct DynamicProfileModifierContent<Modifier> : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile where Modifier : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfileModifier { |
| 672 | public var body: Swift::Never { |
| 673 | get |
| 674 | } |
| 675 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 676 | @available(tvOS, unavailable) |
| 677 | public typealias Body = Swift::Never |
| 678 | } |
| 679 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 680 | @available(tvOS, unavailable) |
| 681 | public struct ModifiedDynamicProfile<Content, Modifier> : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile where Content : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile, Modifier : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfileModifier { |
| 682 | public var body: Swift::Never { |
| 683 | get |
| 684 | } |
| 685 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 686 | @available(tvOS, unavailable) |
| 687 | public typealias Body = Swift::Never |
| 688 | } |
| 689 | } |
| 690 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 691 | @available(tvOS, unavailable) |
| 692 | extension FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 693 | public func modifier<Modifier>(_ modifier: Modifier) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile where Modifier : FoundationModels::LanguageModelSession.FoundationModels::DynamicProfileModifier |
| 694 | |
| 695 | } |
| 696 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 697 | @available(tvOS, unavailable) |
| 698 | extension FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 699 | public func model(_ model: some LanguageModel) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 700 | |
| 701 | public func temperature(_ temperature: Swift::Double?) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 702 | |
| 703 | public func samplingMode(_ samplingMode: FoundationModels::GenerationOptions.FoundationModels::SamplingMode?) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 704 | |
| 705 | public func maximumResponseTokens(_ maximumResponseTokens: Swift::Int?) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 706 | |
| 707 | public func reasoningLevel(_ reasoningLevel: FoundationModels::ContextOptions.FoundationModels::ReasoningLevel?) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 708 | |
| 709 | @available(*, deprecated, renamed: "toolCallingMode(_:)") |
| 710 | public func toolCalling(_ toolCallingMode: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode?) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 711 | |
| 712 | public func toolCallingMode(_ toolCallingMode: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode?) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 713 | |
| 714 | @available(*, deprecated, renamed: "historyTransform(_:)") |
| 715 | public func inputFilter(_ filter: @escaping ([FoundationModels::Transcript.FoundationModels::Entry]) -> [FoundationModels::Transcript.FoundationModels::Entry]) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 716 | |
| 717 | public func historyTransform(_ transform: @escaping ([FoundationModels::Transcript.FoundationModels::Entry]) -> [FoundationModels::Transcript.FoundationModels::Entry]) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 718 | |
| 719 | public func transcriptErrorHandlingPolicy(_ transcriptErrorHandlingPolicy: FoundationModels::TranscriptErrorHandlingPolicy?) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 720 | |
| 721 | @_alwaysEmitIntoClient public func onPrompt(@_inheritActorContext perform action: nonisolated(nonsending) sending @escaping () async throws -> Swift::Void) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 722 | onPrompt { _ in |
| 723 | try await action() |
| 724 | } |
| 725 | } |
| 726 | |
| 727 | public func onPrompt(@_inheritActorContext perform action: nonisolated(nonsending) sending @escaping (FoundationModels::Transcript.FoundationModels::Prompt) async throws -> Swift::Void) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 728 | |
| 729 | @_alwaysEmitIntoClient public func onResponse(@_inheritActorContext perform action: nonisolated(nonsending) sending @escaping () async throws -> Swift::Void) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 730 | onResponse { _ in |
| 731 | try await action() |
| 732 | } |
| 733 | } |
| 734 | |
| 735 | public func onResponse(@_inheritActorContext perform action: nonisolated(nonsending) sending @escaping (FoundationModels::Transcript.FoundationModels::Response) async throws -> Swift::Void) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 736 | |
| 737 | @_alwaysEmitIntoClient public func onToolCall(@_inheritActorContext perform action: nonisolated(nonsending) sending @escaping () async throws -> Swift::Void) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 738 | onToolCall { _ in |
| 739 | try await action() |
| 740 | } |
| 741 | } |
| 742 | |
| 743 | public func onToolCall(@_inheritActorContext perform action: nonisolated(nonsending) sending @escaping (FoundationModels::Transcript.FoundationModels::ToolCall) async throws -> Swift::Void) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 744 | |
| 745 | @_alwaysEmitIntoClient public func onToolOutput(@_inheritActorContext perform action: nonisolated(nonsending) sending @escaping () async throws -> Swift::Void) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 746 | onToolOutput { _, _ in |
| 747 | try await action() |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | public func onToolOutput(@_inheritActorContext perform action: nonisolated(nonsending) sending @escaping (FoundationModels::Transcript.FoundationModels::ToolCall, FoundationModels::Transcript.FoundationModels::ToolOutput) async throws -> Swift::Void) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 752 | |
| 753 | public func onActivate(@_inheritActorContext perform action: sending @escaping @isolated(any) () async -> Swift::Void) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 754 | |
| 755 | public func onDeactivate(@_inheritActorContext perform action: sending @escaping @isolated(any) () async -> Swift::Void) -> some FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 756 | |
| 757 | } |
| 758 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 759 | @available(tvOS, unavailable) |
| 760 | extension FoundationModels::LanguageModelSession.FoundationModels::DynamicProfileModifier { |
| 761 | public typealias DynamicProfile = FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile |
| 762 | } |
| 763 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 764 | @available(tvOS, unavailable) |
| 765 | extension FoundationModels::LanguageModelSession { |
| 766 | @propertyWrapper public struct SessionProperty<Value> { |
| 767 | public var wrappedValue: Value { |
| 768 | get |
| 769 | nonmutating set |
| 770 | } |
| 771 | public init(_ keyPath: Swift::ReferenceWritableKeyPath<FoundationModels::SessionPropertyValues, Value>) |
| 772 | } |
| 773 | } |
| 774 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 775 | @available(tvOS, unavailable) |
| 776 | extension FoundationModels::LanguageModelSession.FoundationModels::SessionProperty : Swift::Sendable where Value : Swift::Sendable { |
| 777 | } |
| 778 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 779 | @available(tvOS, unavailable) |
| 780 | extension FoundationModels::DynamicInstructions { |
| 781 | public typealias SessionProperty = FoundationModels::LanguageModelSession.FoundationModels::SessionProperty |
| 782 | } |
| 783 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 784 | @available(tvOS, unavailable) |
| 785 | extension FoundationModels::Tool { |
| 786 | public typealias SessionProperty = FoundationModels::LanguageModelSession.FoundationModels::SessionProperty |
| 787 | } |
| 788 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 789 | @available(tvOS, unavailable) |
| 790 | extension FoundationModels::LanguageModelSession.FoundationModels::DynamicProfile { |
| 791 | public typealias SessionProperty = FoundationModels::LanguageModelSession.FoundationModels::SessionProperty |
| 792 | } |
| 793 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 794 | @available(tvOS, unavailable) |
| 795 | extension FoundationModels::LanguageModelSession.FoundationModels::DynamicProfileModifier { |
| 796 | public typealias SessionProperty = FoundationModels::LanguageModelSession.FoundationModels::SessionProperty |
| 797 | } |
| 798 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 799 | @available(tvOS, unavailable) |
| 800 | extension FoundationModels::SessionPropertyValues { |
| 801 | final public var history: Swift::ArraySlice<FoundationModels::Transcript.FoundationModels::Entry> { |
| 802 | get |
| 803 | set |
| 804 | _modify |
| 805 | } |
| 806 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 807 | @available(tvOS, unavailable) |
| 808 | final public var rootDynamicInstructions: any FoundationModels::DynamicInstructions { |
| 809 | get |
| 810 | set |
| 811 | } |
| 812 | } |
| 813 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 814 | @available(tvOS, unavailable) |
| 815 | public protocol SessionPropertyKey : Swift::SendableMetatype { |
| 816 | associatedtype Value |
| 817 | static var defaultValue: Self.Value { get } |
| 818 | } |
| 819 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 820 | @available(tvOS, unavailable) |
| 821 | @attached(accessor) @attached(peer, names: prefixed(__Key_)) public macro SessionPropertyEntry() = #externalMacro( |
| 822 | module: "FoundationModelsMacros", |
| 823 | type: "EntryMacro" |
| 824 | ) |
| 825 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 826 | @available(tvOS, unavailable) |
| 827 | @attached(accessor) public macro __SessionPropertyEntryDefaultValue() = #externalMacro( |
| 828 | module: "FoundationModelsMacros", |
| 829 | type: "SessionPropertyEntryDefaultValueMacro" |
| 830 | ) |
| 831 | @_hasMissingDesignatedInitializers @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 832 | @available(tvOS, unavailable) |
| 833 | final public class SessionPropertyValues : Swift::Sendable { |
| 834 | @inline(__always) final public subscript<K>(key: K.Type) -> K.Value where K : FoundationModels::SessionPropertyKey { |
| 835 | get |
| 836 | set |
| 837 | _modify |
| 838 | } |
| 839 | @objc deinit |
| 840 | } |
| 841 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 842 | @available(tvOS, unavailable) |
| 843 | extension FoundationModels::SessionPropertyValues : nonisolated Observation::Observable { |
| 844 | } |
| 845 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 846 | @available(tvOS, unavailable) |
| 847 | public struct AnyTool : FoundationModels::Tool { |
| 848 | public var name: Swift::String { |
| 849 | get |
| 850 | } |
| 851 | public var description: Swift::String { |
| 852 | get |
| 853 | } |
| 854 | public var parameters: FoundationModels::GenerationSchema { |
| 855 | get |
| 856 | } |
| 857 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 858 | nonisolated(nonsending) public func call(arguments: FoundationModels::GeneratedContent) async throws -> FoundationModels::Prompt |
| 859 | #endif |
| 860 | public init(_ tool: some Tool) |
| 861 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 862 | @available(tvOS, unavailable) |
| 863 | public typealias Arguments = FoundationModels::GeneratedContent |
| 864 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 865 | @available(tvOS, unavailable) |
| 866 | public typealias Output = FoundationModels::Prompt |
| 867 | } |
| 868 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 869 | @available(tvOS, unavailable) |
| 870 | extension FoundationModels::Instructions : FoundationModels::DynamicInstructions { |
| 871 | public var body: some FoundationModels::DynamicInstructions { |
| 872 | get |
| 873 | } |
| 874 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 875 | @available(tvOS, unavailable) |
| 876 | public typealias Body = @_opaqueReturnTypeOf("$s16FoundationModels12InstructionsV4bodyQrvp", 0) __ |
| 877 | } |
| 878 | @available(macOS 27.0, iOS 27.0, visionOS 27.0, *) |
| 879 | @available(watchOS, unavailable) |
| 880 | @available(tvOS, unavailable) |
| 881 | extension FoundationModels::LanguageModelSession { |
| 882 | convenience public init(model: some LanguageModel = SystemLanguageModel.default, dynamicInstructions: sending some DynamicInstructions, history: some Collection<Transcript.Entry> = []) |
| 883 | final public var properties: FoundationModels::SessionPropertyValues { |
| 884 | get |
| 885 | } |
| 886 | } |
| 887 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| |
| 888 | @available(tvOS, unavailable) |
| 889 | @attached(extension, conformances: FoundationModels::Generable, names: named(init(_:)), named(generatedContent)) @attached(member, names: arbitrary) public macro Generable(description: Swift::String? = nil) = #externalMacro(module: "FoundationModelsMacros", type: "GenerableMacro") |
| 890 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, watchOS 27.0, *) |
| 891 | @available(tvOS, unavailable) |
| 892 | @attached(extension, conformances: FoundationModels::Generable, names: named(init(_:)), named(generatedContent)) @attached(member, names: arbitrary) public macro Generable(description: Swift::String? = nil, representNilExplicitlyInGeneratedContent: Swift::Bool) = #externalMacro(module: "FoundationModelsMacros", type: "GenerableMacro") |
| 893 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 894 | @available(tvOS, unavailable) |
| 895 | @attached(extension, conformances: FoundationModels::Generable, names: named(init(_:)), named(generatedContent)) @attached(member, names: arbitrary) public macro Generable(name: Swift::String, description: Swift::String? = nil, representNilExplicitlyInGeneratedContent: Swift::Bool = false) = #externalMacro(module: "FoundationModelsMacros", type: "GenerableMacro") |
| 896 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 897 | @available(tvOS, unavailable) |
| 898 | @attached(peer) public macro Guide<T>(description: Swift::String? = nil, _ guides: FoundationModels::GenerationGuide<T>...) = #externalMacro(module: "FoundationModelsMacros", type: "GuideMacro") where T : FoundationModels::Generable |
| 899 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 900 | @available(tvOS, unavailable) |
| 901 | @attached(peer) public macro Guide<RegexOutput>(description: Swift::String? = nil, _ guides: _StringProcessing::Regex<RegexOutput>) = #externalMacro(module: "FoundationModelsMacros", type: "GuideMacro") |
| 902 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 903 | @available(tvOS, unavailable) |
| 904 | @attached(peer) public macro Guide(description: Swift::String) = #externalMacro(module: "FoundationModelsMacros", type: "GuideMacro") |
| 905 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 906 | @available(tvOS, unavailable) |
| 907 | public protocol Generable : FoundationModels::ConvertibleFromGeneratedContent, FoundationModels::ConvertibleToGeneratedContent { |
| 908 | associatedtype PartiallyGenerated : FoundationModels::ConvertibleFromGeneratedContent = Self |
| 909 | static var generationSchema: FoundationModels::GenerationSchema { get } |
| 910 | } |
| 911 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 912 | @available(tvOS, unavailable) |
| 913 | extension FoundationModels::Generable { |
| 914 | public func asPartiallyGenerated() -> Self.PartiallyGenerated |
| 915 | } |
| 916 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 917 | @available(tvOS, unavailable) |
| 918 | public protocol ConvertibleFromGeneratedContent : Swift::SendableMetatype { |
| 919 | init(_ content: FoundationModels::GeneratedContent) throws |
| 920 | } |
| 921 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 922 | @available(tvOS, unavailable) |
| 923 | public protocol ConvertibleToGeneratedContent : FoundationModels::InstructionsRepresentable, FoundationModels::PromptRepresentable { |
| 924 | var generatedContent: FoundationModels::GeneratedContent { get } |
| 925 | } |
| 926 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 927 | @available(tvOS, unavailable) |
| 928 | extension FoundationModels::ConvertibleToGeneratedContent { |
| 929 | public var instructionsRepresentation: FoundationModels::Instructions { |
| 930 | get |
| 931 | } |
| 932 | public var promptRepresentation: FoundationModels::Prompt { |
| 933 | get |
| 934 | } |
| 935 | } |
| 936 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| |
| 937 | @available(tvOS, unavailable) |
| 938 | extension FoundationModels::Generable { |
| 939 | public typealias PartiallyGenerated = Self |
| 940 | } |
| 941 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 942 | @available(tvOS, unavailable) |
| 943 | extension Swift::Optional where Wrapped : FoundationModels::Generable { |
| 944 | public typealias PartiallyGenerated = Wrapped.PartiallyGenerated |
| 945 | } |
| 946 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 947 | @available(tvOS, unavailable) |
| 948 | extension Swift::Optional : FoundationModels::ConvertibleToGeneratedContent, FoundationModels::PromptRepresentable, FoundationModels::InstructionsRepresentable where Wrapped : FoundationModels::ConvertibleToGeneratedContent { |
| 949 | public var generatedContent: FoundationModels::GeneratedContent { |
| 950 | get |
| 951 | } |
| 952 | } |
| 953 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| |
| 954 | @available(tvOS, unavailable) |
| 955 | extension Swift::Bool : FoundationModels::Generable { |
| 956 | public static var generationSchema: FoundationModels::GenerationSchema { |
| 957 | get |
| 958 | } |
| 959 | public init(_ content: FoundationModels::GeneratedContent) throws |
| 960 | public var generatedContent: FoundationModels::GeneratedContent { |
| 961 | get |
| 962 | } |
| 963 | } |
| 964 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| |
| 965 | @available(tvOS, unavailable) |
| 966 | extension Swift::String : FoundationModels::Generable { |
| 967 | public static var generationSchema: FoundationModels::GenerationSchema { |
| 968 | get |
| 969 | } |
| 970 | public init(_ content: FoundationModels::GeneratedContent) throws |
| 971 | public var generatedContent: FoundationModels::GeneratedContent { |
| 972 | get |
| 973 | } |
| 974 | } |
| 975 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| |
| 976 | @available(tvOS, unavailable) |
| 977 | extension Swift::Int : FoundationModels::Generable { |
| 978 | public static var generationSchema: FoundationModels::GenerationSchema { |
| 979 | get |
| 980 | } |
| 981 | public init(_ content: FoundationModels::GeneratedContent) throws |
| 982 | public var generatedContent: FoundationModels::GeneratedContent { |
| 983 | get |
| 984 | } |
| 985 | } |
| 986 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| |
| 987 | @available(tvOS, unavailable) |
| 988 | extension Swift::Float : FoundationModels::Generable { |
| 989 | public static var generationSchema: FoundationModels::GenerationSchema { |
| 990 | get |
| 991 | } |
| 992 | public init(_ content: FoundationModels::GeneratedContent) throws |
| 993 | public var generatedContent: FoundationModels::GeneratedContent { |
| 994 | get |
| 995 | } |
| 996 | } |
| 997 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| |
| 998 | @available(tvOS, unavailable) |
| 999 | extension Swift::Double : FoundationModels::Generable { |
| 1000 | public static var generationSchema: FoundationModels::GenerationSchema { |
| 1001 | get |
| 1002 | } |
| 1003 | public init(_ content: FoundationModels::GeneratedContent) throws |
| 1004 | public var generatedContent: FoundationModels::GeneratedContent { |
| 1005 | get |
| 1006 | } |
| 1007 | } |
| 1008 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| |
| 1009 | @available(tvOS, unavailable) |
| 1010 | extension Foundation::Decimal : FoundationModels::Generable { |
| 1011 | public static var generationSchema: FoundationModels::GenerationSchema { |
| 1012 | get |
| 1013 | } |
| 1014 | public init(_ content: FoundationModels::GeneratedContent) throws |
| 1015 | public var generatedContent: FoundationModels::GeneratedContent { |
| 1016 | get |
| 1017 | } |
| 1018 | } |
| 1019 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| |
| 1020 | @available(tvOS, unavailable) |
| 1021 | extension Swift::Array : FoundationModels::Generable where Element : FoundationModels::Generable { |
| 1022 | public typealias PartiallyGenerated = [Element.PartiallyGenerated] |
| 1023 | public static var generationSchema: FoundationModels::GenerationSchema { |
| 1024 | get |
| 1025 | } |
| 1026 | } |
| 1027 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1028 | @available(tvOS, unavailable) |
| 1029 | extension Swift::Array : FoundationModels::ConvertibleToGeneratedContent where Element : FoundationModels::ConvertibleToGeneratedContent { |
| 1030 | public var generatedContent: FoundationModels::GeneratedContent { |
| 1031 | get |
| 1032 | } |
| 1033 | } |
| 1034 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1035 | @available(tvOS, unavailable) |
| 1036 | extension Swift::Array : FoundationModels::ConvertibleFromGeneratedContent where Element : FoundationModels::ConvertibleFromGeneratedContent { |
| 1037 | public init(_ content: FoundationModels::GeneratedContent) throws |
| 1038 | } |
| 1039 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1040 | @available(tvOS, unavailable) |
| 1041 | extension Swift::Never : FoundationModels::Generable { |
| 1042 | public static var generationSchema: FoundationModels::GenerationSchema { |
| 1043 | get |
| 1044 | } |
| 1045 | public init(_ content: FoundationModels::GeneratedContent) throws |
| 1046 | public var generatedContent: FoundationModels::GeneratedContent { |
| 1047 | get |
| 1048 | } |
| 1049 | } |
| 1050 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1051 | @available(tvOS, unavailable) |
| 1052 | public struct GeneratedContent : Swift::Sendable, Swift::Equatable, FoundationModels::Generable, Swift::CustomDebugStringConvertible { |
| 1053 | public static var generationSchema: FoundationModels::GenerationSchema { |
| 1054 | get |
| 1055 | } |
| 1056 | public var id: FoundationModels::GenerationID? |
| 1057 | public init(_ content: FoundationModels::GeneratedContent) throws |
| 1058 | public var generatedContent: FoundationModels::GeneratedContent { |
| 1059 | get |
| 1060 | } |
| 1061 | public init(properties: Swift::KeyValuePairs<Swift::String, any FoundationModels::ConvertibleToGeneratedContent>, id: FoundationModels::GenerationID? = nil) |
| 1062 | public init<S>(properties: S, id: FoundationModels::GenerationID? = nil, uniquingKeysWith combine: (FoundationModels::GeneratedContent, FoundationModels::GeneratedContent) throws -> some ConvertibleToGeneratedContent) rethrows where S : Swift::Sequence, S.Element == (Swift::String, any FoundationModels::ConvertibleToGeneratedContent) |
| 1063 | public init<S>(elements: S, id: FoundationModels::GenerationID? = nil) where S : Swift::Sequence, S.Element == any FoundationModels::ConvertibleToGeneratedContent |
| 1064 | public init(_ value: some ConvertibleToGeneratedContent) |
| 1065 | public init(_ value: some ConvertibleToGeneratedContent, id: FoundationModels::GenerationID) |
| 1066 | public init(json: Swift::String) throws |
| 1067 | public static let null: FoundationModels::GeneratedContent |
| 1068 | public var jsonString: Swift::String { |
| 1069 | get |
| 1070 | } |
| 1071 | public func value<Value>(_ type: Value.Type = Value.self) throws -> Value where Value : FoundationModels::ConvertibleFromGeneratedContent |
| 1072 | public func value<Value>(_ type: Value.Type = Value.self, forProperty property: Swift::String) throws -> Value where Value : FoundationModels::ConvertibleFromGeneratedContent |
| 1073 | public func value<Value>(_ type: Value?.Type = Value?.self, forProperty property: Swift::String) throws -> Value? where Value : FoundationModels::ConvertibleFromGeneratedContent |
| 1074 | public var debugDescription: Swift::String { |
| 1075 | get |
| 1076 | } |
| 1077 | public var isComplete: Swift::Bool { |
| 1078 | get |
| 1079 | } |
| 1080 | public static func == (a: FoundationModels::GeneratedContent, b: FoundationModels::GeneratedContent) -> Swift::Bool |
| 1081 | } |
| 1082 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1083 | @available(tvOS, unavailable) |
| 1084 | extension FoundationModels::GeneratedContent { |
| 1085 | public enum Kind : Swift::Equatable, Swift::Sendable { |
| 1086 | case null |
| 1087 | case bool(Swift::Bool) |
| 1088 | case number(Swift::Double) |
| 1089 | case string(Swift::String) |
| 1090 | case array([FoundationModels::GeneratedContent]) |
| 1091 | case structure(properties: [Swift::String : FoundationModels::GeneratedContent], orderedKeys: [Swift::String]) |
| 1092 | public static func == (a: FoundationModels::GeneratedContent.FoundationModels::Kind, b: FoundationModels::GeneratedContent.FoundationModels::Kind) -> Swift::Bool |
| 1093 | } |
| 1094 | public init(kind: FoundationModels::GeneratedContent.FoundationModels::Kind, id: FoundationModels::GenerationID? = nil) |
| 1095 | public var kind: FoundationModels::GeneratedContent.FoundationModels::Kind { |
| 1096 | get |
| 1097 | } |
| 1098 | } |
| 1099 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1100 | @available(tvOS, unavailable) |
| 1101 | extension FoundationModels::GeneratedContent { |
| 1102 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1103 | @available(tvOS, unavailable) |
| 1104 | public struct ParsingError : Foundation::LocalizedError, Swift::CustomDebugStringConvertible, Swift::Sendable { |
| 1105 | public var rawContent: Swift::String |
| 1106 | public var underlyingError: (any Swift::Error)? |
| 1107 | public var debugDescription: Swift::String |
| 1108 | public init(rawContent: Swift::String, underlyingError: (any Swift::Error)? = nil, debugDescription: Swift::String) |
| 1109 | public var errorDescription: Swift::String? { |
| 1110 | get |
| 1111 | } |
| 1112 | } |
| 1113 | } |
| 1114 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1115 | @available(tvOS, unavailable) |
| 1116 | public struct GenerationGuide<Value> { |
| 1117 | } |
| 1118 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1119 | @available(tvOS, unavailable) |
| 1120 | extension FoundationModels::GenerationGuide where Value == Swift::String { |
| 1121 | public static func constant(_ value: Swift::String) -> FoundationModels::GenerationGuide<Swift::String> |
| 1122 | public static func anyOf(_ values: [Swift::String]) -> FoundationModels::GenerationGuide<Swift::String> |
| 1123 | public static func pattern<Output>(_ regex: _StringProcessing::Regex<Output>) -> FoundationModels::GenerationGuide<Swift::String> |
| 1124 | } |
| 1125 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1126 | @available(tvOS, unavailable) |
| 1127 | extension FoundationModels::GenerationGuide where Value == Swift::Int { |
| 1128 | public static func minimum(_ value: Swift::Int) -> FoundationModels::GenerationGuide<Swift::Int> |
| 1129 | public static func maximum(_ value: Swift::Int) -> FoundationModels::GenerationGuide<Swift::Int> |
| 1130 | public static func range(_ range: Swift::ClosedRange<Swift::Int>) -> FoundationModels::GenerationGuide<Swift::Int> |
| 1131 | } |
| 1132 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1133 | @available(tvOS, unavailable) |
| 1134 | extension FoundationModels::GenerationGuide where Value == Swift::Float { |
| 1135 | public static func minimum(_ value: Swift::Float) -> FoundationModels::GenerationGuide<Swift::Float> |
| 1136 | public static func maximum(_ value: Swift::Float) -> FoundationModels::GenerationGuide<Swift::Float> |
| 1137 | public static func range(_ range: Swift::ClosedRange<Swift::Float>) -> FoundationModels::GenerationGuide<Swift::Float> |
| 1138 | } |
| 1139 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1140 | @available(tvOS, unavailable) |
| 1141 | extension FoundationModels::GenerationGuide where Value == Foundation::Decimal { |
| 1142 | public static func minimum(_ value: Foundation::Decimal) -> FoundationModels::GenerationGuide<Foundation::Decimal> |
| 1143 | public static func maximum(_ value: Foundation::Decimal) -> FoundationModels::GenerationGuide<Foundation::Decimal> |
| 1144 | public static func range(_ range: Swift::ClosedRange<Foundation::Decimal>) -> FoundationModels::GenerationGuide<Foundation::Decimal> |
| 1145 | } |
| 1146 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1147 | @available(tvOS, unavailable) |
| 1148 | extension FoundationModels::GenerationGuide where Value == Swift::Double { |
| 1149 | public static func minimum(_ value: Swift::Double) -> FoundationModels::GenerationGuide<Swift::Double> |
| 1150 | public static func maximum(_ value: Swift::Double) -> FoundationModels::GenerationGuide<Swift::Double> |
| 1151 | public static func range(_ range: Swift::ClosedRange<Swift::Double>) -> FoundationModels::GenerationGuide<Swift::Double> |
| 1152 | } |
| 1153 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1154 | @available(tvOS, unavailable) |
| 1155 | extension FoundationModels::GenerationGuide { |
| 1156 | public static func minimumCount<Element>(_ count: Swift::Int) -> FoundationModels::GenerationGuide<[Element]> where Value == [Element] |
| 1157 | public static func maximumCount<Element>(_ count: Swift::Int) -> FoundationModels::GenerationGuide<[Element]> where Value == [Element] |
| 1158 | public static func count<Element>(_ range: Swift::ClosedRange<Swift::Int>) -> FoundationModels::GenerationGuide<[Element]> where Value == [Element] |
| 1159 | public static func count<Element>(_ count: Swift::Int) -> FoundationModels::GenerationGuide<[Element]> where Value == [Element] |
| 1160 | public static func element<Element>(_ guide: FoundationModels::GenerationGuide<Element>) -> FoundationModels::GenerationGuide<[Element]> where Value == [Element] |
| 1161 | } |
| 1162 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1163 | @available(tvOS, unavailable) |
| 1164 | @_documentation(visibility: private) extension FoundationModels::GenerationGuide where Value == [Swift::Never] { |
| 1165 | @_documentation(visibility: private) @_alwaysEmitIntoClient public static func minimumCount(_ count: Swift::Int) -> FoundationModels::GenerationGuide<Value> { |
| 1166 | fatalError("GenerationGuide<[Never]>.\(#function) should not be called.") |
| 1167 | } |
| 1168 | @_documentation(visibility: private) @_alwaysEmitIntoClient public static func maximumCount(_ count: Swift::Int) -> FoundationModels::GenerationGuide<Value> { |
| 1169 | fatalError("GenerationGuide<[Never]>.\(#function) should not be called.") |
| 1170 | } |
| 1171 | @_documentation(visibility: private) @_alwaysEmitIntoClient public static func count(_ range: Swift::ClosedRange<Swift::Int>) -> FoundationModels::GenerationGuide<Value> { |
| 1172 | fatalError("GenerationGuide<[Never]>.\(#function) should not be called.") |
| 1173 | } |
| 1174 | @_documentation(visibility: private) @_disfavoredOverload @_alwaysEmitIntoClient public static func count(_ count: Swift::Int) -> FoundationModels::GenerationGuide<Value> { |
| 1175 | fatalError("GenerationGuide<[Never]>.\(#function) should not be called.") |
| 1176 | } |
| 1177 | } |
| 1178 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1179 | @available(tvOS, unavailable) |
| 1180 | public protocol LanguageModel : Swift::Sendable { |
| 1181 | associatedtype Executor : FoundationModels::LanguageModelExecutor where Self == Self.Executor.Model |
| 1182 | var capabilities: FoundationModels::LanguageModelCapabilities { get } |
| 1183 | var executorConfiguration: Self.Executor.Configuration { get } |
| 1184 | } |
| 1185 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1186 | @available(tvOS, unavailable) |
| 1187 | public struct LanguageModelCapabilities : Swift::Sendable { |
| 1188 | public func contains(_ capability: FoundationModels::LanguageModelCapabilities.FoundationModels::Capability) -> Swift::Bool |
| 1189 | public init(capabilities: [FoundationModels::LanguageModelCapabilities.FoundationModels::Capability]) |
| 1190 | public struct Capability : Swift::Sendable, Swift::Hashable { |
| 1191 | public static var vision: FoundationModels::LanguageModelCapabilities.FoundationModels::Capability { |
| 1192 | get |
| 1193 | } |
| 1194 | public static var guidedGeneration: FoundationModels::LanguageModelCapabilities.FoundationModels::Capability { |
| 1195 | get |
| 1196 | } |
| 1197 | public static var reasoning: FoundationModels::LanguageModelCapabilities.FoundationModels::Capability { |
| 1198 | get |
| 1199 | } |
| 1200 | public static var toolCalling: FoundationModels::LanguageModelCapabilities.FoundationModels::Capability { |
| 1201 | get |
| 1202 | } |
| 1203 | public static func == (a: FoundationModels::LanguageModelCapabilities.FoundationModels::Capability, b: FoundationModels::LanguageModelCapabilities.FoundationModels::Capability) -> Swift::Bool |
| 1204 | public func hash(into hasher: inout Swift::Hasher) |
| 1205 | public var hashValue: Swift::Int { |
| 1206 | get |
| 1207 | } |
| 1208 | } |
| 1209 | } |
| 1210 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1211 | @available(tvOS, unavailable) |
| 1212 | public enum LanguageModelError : Foundation::LocalizedError, Swift::CustomDebugStringConvertible { |
| 1213 | case contextSizeExceeded(FoundationModels::LanguageModelError.FoundationModels::ContextSizeExceeded) |
| 1214 | case rateLimited(FoundationModels::LanguageModelError.FoundationModels::RateLimited) |
| 1215 | case guardrailViolation(FoundationModels::LanguageModelError.FoundationModels::GuardrailViolation) |
| 1216 | case refusal(FoundationModels::LanguageModelError.FoundationModels::Refusal) |
| 1217 | case unsupportedCapability(FoundationModels::LanguageModelError.FoundationModels::UnsupportedCapability) |
| 1218 | case unsupportedTranscriptContent(FoundationModels::LanguageModelError.FoundationModels::UnsupportedTranscriptContent) |
| 1219 | case unsupportedGenerationGuide(FoundationModels::LanguageModelError.FoundationModels::UnsupportedGenerationGuide) |
| 1220 | case unsupportedLanguageOrLocale(FoundationModels::LanguageModelError.FoundationModels::UnsupportedLanguageOrLocale) |
| 1221 | case timeout(FoundationModels::LanguageModelError.FoundationModels::Timeout) |
| 1222 | public struct ContextSizeExceeded : Swift::Sendable { |
| 1223 | public var contextSize: Swift::Int |
| 1224 | public var tokenCount: Swift::Int |
| 1225 | public var debugDescription: Swift::String |
| 1226 | public var metadata: [Swift::String : any Swift::Sendable] |
| 1227 | public init(contextSize: Swift::Int, tokenCount: Swift::Int, debugDescription: Swift::String, metadata: [Swift::String : any Swift::Sendable] = [:]) |
| 1228 | } |
| 1229 | public struct RateLimited : Swift::Sendable { |
| 1230 | public var resetDate: Foundation::Date? |
| 1231 | public var debugDescription: Swift::String |
| 1232 | public var metadata: [Swift::String : any Swift::Sendable] |
| 1233 | public init(resetDate: Foundation::Date?, debugDescription: Swift::String, metadata: [Swift::String : any Swift::Sendable] = [:]) |
| 1234 | } |
| 1235 | public struct GuardrailViolation : Swift::Sendable { |
| 1236 | public var debugDescription: Swift::String |
| 1237 | public var metadata: [Swift::String : any Swift::Sendable] |
| 1238 | public init(debugDescription: Swift::String, metadata: [Swift::String : any Swift::Sendable] = [:]) |
| 1239 | } |
| 1240 | public struct Refusal : Swift::Sendable { |
| 1241 | public var debugDescription: Swift::String |
| 1242 | public var metadata: [Swift::String : any Swift::Sendable] |
| 1243 | public init(debugDescription: Swift::String, metadata: [Swift::String : any Swift::Sendable] = [:]) |
| 1244 | } |
| 1245 | public struct UnsupportedCapability : Swift::Sendable { |
| 1246 | public var capability: FoundationModels::LanguageModelCapabilities.FoundationModels::Capability |
| 1247 | public var debugDescription: Swift::String |
| 1248 | public var metadata: [Swift::String : any Swift::Sendable] |
| 1249 | public init(capability: FoundationModels::LanguageModelCapabilities.FoundationModels::Capability, debugDescription: Swift::String, metadata: [Swift::String : any Swift::Sendable] = [:]) |
| 1250 | } |
| 1251 | public struct UnsupportedTranscriptContent : Swift::Sendable { |
| 1252 | public var unsupportedContent: [FoundationModels::Transcript.FoundationModels::Entry] |
| 1253 | public var debugDescription: Swift::String |
| 1254 | public var metadata: [Swift::String : any Swift::Sendable] |
| 1255 | public init(unsupportedContent: [FoundationModels::Transcript.FoundationModels::Entry], debugDescription: Swift::String, metadata: [Swift::String : any Swift::Sendable] = [:]) |
| 1256 | } |
| 1257 | public struct UnsupportedGenerationGuide : Swift::Sendable { |
| 1258 | public var schemaName: Swift::String? |
| 1259 | public var debugDescription: Swift::String |
| 1260 | public var metadata: [Swift::String : any Swift::Sendable] |
| 1261 | public init(schemaName: Swift::String?, debugDescription: Swift::String, metadata: [Swift::String : any Swift::Sendable] = [:]) |
| 1262 | } |
| 1263 | public struct UnsupportedLanguageOrLocale : Swift::Sendable { |
| 1264 | public var languageCode: Foundation::Locale.Foundation::LanguageCode |
| 1265 | public var debugDescription: Swift::String |
| 1266 | public var metadata: [Swift::String : any Swift::Sendable] |
| 1267 | public init(languageCode: Foundation::Locale.Foundation::LanguageCode, debugDescription: Swift::String, metadata: [Swift::String : any Swift::Sendable] = [:]) |
| 1268 | } |
| 1269 | public struct Timeout : Swift::Sendable { |
| 1270 | public var debugDescription: Swift::String |
| 1271 | public var metadata: [Swift::String : any Swift::Sendable] |
| 1272 | public init(debugDescription: Swift::String, metadata: [Swift::String : any Swift::Sendable] = [:]) |
| 1273 | } |
| 1274 | public var debugDescription: Swift::String { |
| 1275 | get |
| 1276 | } |
| 1277 | public var errorDescription: Swift::String? { |
| 1278 | get |
| 1279 | } |
| 1280 | } |
| 1281 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 1282 | @available(tvOS, unavailable) |
| 1283 | @available(watchOS, unavailable) |
| 1284 | extension FoundationModels::LanguageModelSession { |
| 1285 | @available(iOS, introduced: 26.0, deprecated: 27.0) |
| 1286 | @available(macOS, introduced: 26.0, deprecated: 27.0) |
| 1287 | @available(visionOS, introduced: 26.0, deprecated: 27.0) |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 1288 | @available(tvOS, unavailable) |
| 1289 | @available(watchOS, unavailable) |
| 1290 | public enum GenerationError : Swift::Error, Foundation::LocalizedError { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 1291 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 1292 | @available(tvOS, unavailable) |
| 1293 | @available(watchOS, unavailable) |
| 1294 | public struct Context : Swift::Sendable { |
| 1295 | public let debugDescription: Swift::String |
| 1296 | public init(debugDescription: Swift::String) |
| 1297 | } |
| 1298 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 1299 | @available(tvOS, unavailable) |
| 1300 | @available(watchOS, unavailable) |
| 1301 | public struct Refusal : Swift::Sendable { |
| 1302 | public init(transcriptEntries: [FoundationModels::Transcript.FoundationModels::Entry]) |
| 1303 | } |
| 1304 | @available(iOS, deprecated: 27.0, message: "Use ``LanguageModelError/contextSizeExceeded(_:)`` instead.") |
| 1305 | @available(macOS, deprecated: 27.0, message: "Use ``LanguageModelError/contextSizeExceeded(_:)`` instead.") |
| 1306 | @available(visionOS, deprecated: 27.0, message: "Use ``LanguageModelError/contextSizeExceeded(_:)`` instead.") |
| 1307 | case exceededContextWindowSize(FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Context) |
| 1308 | @available(iOS, deprecated: 27.0, message: "Use ``SystemLanguageModel/Error/assetsUnavailable(_:)`` instead.") |
| 1309 | @available(macOS, deprecated: 27.0, message: "Use ``SystemLanguageModel/Error/assetsUnavailable(_:)`` instead.") |
| 1310 | @available(visionOS, deprecated: 27.0, message: "Use ``SystemLanguageModel/Error/assetsUnavailable(_:)`` instead.") |
| 1311 | case assetsUnavailable(FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Context) |
| 1312 | @available(iOS, deprecated: 27.0, message: "Use ``LanguageModelError/guardrailViolation(_:)`` instead.") |
| 1313 | @available(macOS, deprecated: 27.0, message: "Use ``LanguageModelError/guardrailViolation(_:)`` instead.") |
| 1314 | @available(visionOS, deprecated: 27.0, message: "Use ``LanguageModelError/guardrailViolation(_:)`` instead.") |
| 1315 | case guardrailViolation(FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Context) |
| 1316 | @available(iOS, deprecated: 27.0, message: "Use ``LanguageModelError/unsupportedGenerationGuide(_:)`` instead.") |
| 1317 | @available(macOS, deprecated: 27.0, message: "Use ``LanguageModelError/unsupportedGenerationGuide(_:)`` instead.") |
| 1318 | @available(visionOS, deprecated: 27.0, message: "Use ``LanguageModelError/unsupportedGenerationGuide(_:)`` instead.") |
| 1319 | case unsupportedGuide(FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Context) |
| 1320 | @available(iOS, deprecated: 27.0, message: "Use ``LanguageModelError/unsupportedLanguageOrLocale(_:)`` instead.") |
| 1321 | @available(macOS, deprecated: 27.0, message: "Use ``LanguageModelError/unsupportedLanguageOrLocale(_:)`` instead.") |
| 1322 | @available(visionOS, deprecated: 27.0, message: "Use ``LanguageModelError/unsupportedLanguageOrLocale(_:)`` instead.") |
| 1323 | case unsupportedLanguageOrLocale(FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Context) |
| 1324 | @available(iOS, deprecated: 27.0, message: "Use ``GeneratedContent/ParsingError`` instead.") |
| 1325 | @available(macOS, deprecated: 27.0, message: "Use ``GeneratedContent/ParsingError`` instead.") |
| 1326 | @available(visionOS, deprecated: 27.0, message: "Use ``GeneratedContent/ParsingError`` instead.") |
| 1327 | case decodingFailure(FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Context) |
| 1328 | @available(iOS, deprecated: 27.0, message: "Use ``LanguageModelError/rateLimited(_:)`` instead.") |
| 1329 | @available(macOS, deprecated: 27.0, message: "Use ``LanguageModelError/rateLimited(_:)`` instead.") |
| 1330 | @available(visionOS, deprecated: 27.0, message: "Use ``LanguageModelError/rateLimited(_:)`` instead.") |
| 1331 | case rateLimited(FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Context) |
| 1332 | @available(iOS, deprecated: 27.0, message: "Use ``LanguageModelSession/Error/concurrentRequests`` instead.") |
| 1333 | @available(macOS, deprecated: 27.0, message: "Use ``LanguageModelSession/Error/concurrentRequests`` instead.") |
| 1334 | @available(visionOS, deprecated: 27.0, message: "Use ``LanguageModelSession/Error/concurrentRequests`` instead.") |
| 1335 | case concurrentRequests(FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Context) |
| 1336 | @available(iOS, deprecated: 27.0, message: "Use ``LanguageModelError/refusal(_:)`` instead.") |
| 1337 | @available(macOS, deprecated: 27.0, message: "Use ``LanguageModelError/refusal(_:)`` instead.") |
| 1338 | @available(visionOS, deprecated: 27.0, message: "Use ``LanguageModelError/refusal(_:)`` instead.") |
| 1339 | case refusal(FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Refusal, FoundationModels::LanguageModelSession.FoundationModels::GenerationError.FoundationModels::Context) |
| 1340 | public var errorDescription: Swift::String? { |
| 1341 | get |
| 1342 | } |
| 1343 | public var recoverySuggestion: Swift::String? { |
| 1344 | get |
| 1345 | } |
| 1346 | public var failureReason: Swift::String? { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 1347 | get |
| 1348 | } |
| 1349 | } |
| 1350 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 1351 | @available(tvOS, unavailable) |
| 1352 | @available(watchOS, unavailable) |
| 1353 | public struct ToolCallError : Swift::Error, Foundation::LocalizedError { |
| 1354 | public var tool: any FoundationModels::Tool |
| 1355 | public var underlyingError: any Swift::Error |
| 1356 | public init(tool: any FoundationModels::Tool, underlyingError: any Swift::Error) |
| 1357 | public var errorDescription: Swift::String? { |
| 1358 | get |
| 1359 | } |
| 1360 | } |
| 1361 | } |
| 1362 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1363 | @available(tvOS, unavailable) |
| 1364 | public protocol LanguageModelExecutor : Swift::Sendable { |
| 1365 | associatedtype Configuration : Swift::Hashable, Swift::Sendable |
| 1366 | associatedtype Model : FoundationModels::LanguageModel |
| 1367 | func prewarm(model: Self.Model, transcript: FoundationModels::Transcript) |
| 1368 | init(configuration: Self.Configuration) throws |
| 1369 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1370 | nonisolated(nonsending) func respond(to request: FoundationModels::LanguageModelExecutorGenerationRequest, model: Self.Model, streamingInto channel: FoundationModels::LanguageModelExecutorGenerationChannel) async throws |
| 1371 | #endif |
| 1372 | } |
| 1373 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1374 | @available(tvOS, unavailable) |
| 1375 | public struct LanguageModelExecutorGenerationChannel : _Concurrency::AsyncSequence, Swift::Sendable { |
| 1376 | public typealias Element = any FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Event |
| 1377 | public struct AsyncIterator : _Concurrency::AsyncIteratorProtocol { |
| 1378 | public mutating func next(isolation actor: isolated (any _Concurrency::Actor)?) async throws -> (any FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Event)? |
| 1379 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 1380 | @available(tvOS, unavailable) |
| 1381 | public typealias Element = any FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Event |
| 1382 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 1383 | @available(tvOS, unavailable) |
| 1384 | @_implements(_Concurrency::AsyncIteratorProtocol, Failure) public typealias __AsyncIteratorProtocol_Failure = any Swift::Error |
| 1385 | } |
| 1386 | public func makeAsyncIterator() -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::AsyncIterator |
| 1387 | public init() |
| 1388 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1389 | nonisolated(nonsending) public func send(_ event: some Event) async |
| 1390 | #endif |
| 1391 | public protocol Event : Swift::Sendable { |
| 1392 | var kind: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::EventKind { get } |
| 1393 | } |
| 1394 | public struct EventKind : Swift::Sendable { |
| 1395 | } |
| 1396 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 1397 | @available(tvOS, unavailable) |
| 1398 | @_implements(_Concurrency::AsyncSequence, Failure) public typealias __AsyncSequence_Failure = any Swift::Error |
| 1399 | } |
| 1400 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1401 | @available(tvOS, unavailable) |
| 1402 | extension FoundationModels::LanguageModelExecutorGenerationChannel { |
| 1403 | public struct Metadata : Swift::Sendable { |
| 1404 | public var values: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] |
| 1405 | } |
| 1406 | public struct Usage : Swift::Sendable { |
| 1407 | public var input: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage.FoundationModels::Input |
| 1408 | public var output: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage.FoundationModels::Output |
| 1409 | public struct Input : Swift::Sendable { |
| 1410 | public var totalTokenCount: Swift::Int |
| 1411 | public var cachedTokenCount: Swift::Int |
| 1412 | public init(totalTokenCount: Swift::Int, cachedTokenCount: Swift::Int) |
| 1413 | } |
| 1414 | public struct Output : Swift::Sendable { |
| 1415 | public var totalTokenCount: Swift::Int |
| 1416 | public var reasoningTokenCount: Swift::Int |
| 1417 | public init(totalTokenCount: Swift::Int, reasoningTokenCount: Swift::Int) |
| 1418 | } |
| 1419 | public init(input: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage.FoundationModels::Input, output: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage.FoundationModels::Output) |
| 1420 | } |
| 1421 | public struct TextFragment : Swift::Sendable { |
| 1422 | public var content: Swift::String |
| 1423 | public var segmentID: Swift::String? |
| 1424 | public var tokenCount: Swift::Int |
| 1425 | } |
| 1426 | public struct TextSegmentReplacement : Swift::Sendable { |
| 1427 | public var content: Swift::String |
| 1428 | public var segmentID: Swift::String? |
| 1429 | public var tokenCount: Swift::Int |
| 1430 | } |
| 1431 | public struct Response : FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Event { |
| 1432 | public var entryID: Swift::String? |
| 1433 | public var action: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Response.FoundationModels::Action |
| 1434 | public var kind: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::EventKind { |
| 1435 | get |
| 1436 | } |
| 1437 | public enum Action : Swift::Sendable { |
| 1438 | case appendText(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::TextFragment) |
| 1439 | case replaceTextSegment(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::TextSegmentReplacement) |
| 1440 | case updateCustomSegment(any FoundationModels::Transcript.FoundationModels::CustomSegment) |
| 1441 | case addAttachmentSegment(FoundationModels::Transcript.FoundationModels::AttachmentSegment) |
| 1442 | case removeAttachmentSegment(id: Swift::String) |
| 1443 | case updateMetadata(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Metadata) |
| 1444 | case updateUsage(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage) |
| 1445 | } |
| 1446 | } |
| 1447 | public struct Reasoning : FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Event { |
| 1448 | public var entryID: Swift::String? |
| 1449 | public var action: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Reasoning.FoundationModels::Action |
| 1450 | public var kind: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::EventKind { |
| 1451 | get |
| 1452 | } |
| 1453 | public enum Action : Swift::Sendable { |
| 1454 | case appendText(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::TextFragment) |
| 1455 | case replaceTextSegment(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::TextSegmentReplacement) |
| 1456 | case updateSignature(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ReasoningSignature) |
| 1457 | case updateMetadata(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Metadata) |
| 1458 | case updateUsage(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage) |
| 1459 | } |
| 1460 | } |
| 1461 | public struct ReasoningSignature : Swift::Sendable { |
| 1462 | public var signature: Foundation::Data |
| 1463 | public var tokenCount: Swift::Int |
| 1464 | } |
| 1465 | public struct ToolCalls : FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Event { |
| 1466 | public var entryID: Swift::String? |
| 1467 | public var action: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::Action |
| 1468 | public var kind: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::EventKind { |
| 1469 | get |
| 1470 | } |
| 1471 | public enum Action : Swift::Sendable { |
| 1472 | case toolCall(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::ToolCall) |
| 1473 | case removeToolCall(id: Swift::String) |
| 1474 | case updateMetadata(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Metadata) |
| 1475 | case updateUsage(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage) |
| 1476 | } |
| 1477 | public struct ToolCall : Swift::Sendable { |
| 1478 | public var id: Swift::String |
| 1479 | public var name: Swift::String |
| 1480 | public var action: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::ToolCall.FoundationModels::Action |
| 1481 | public enum Action : Swift::Sendable { |
| 1482 | case appendArguments(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::ToolCall.FoundationModels::ArgumentsFragment) |
| 1483 | case updateMetadata(FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Metadata) |
| 1484 | } |
| 1485 | public struct ArgumentsFragment : Swift::Sendable { |
| 1486 | public var content: Swift::String |
| 1487 | public var tokenCount: Swift::Int |
| 1488 | } |
| 1489 | } |
| 1490 | } |
| 1491 | } |
| 1492 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1493 | @available(tvOS, unavailable) |
| 1494 | extension FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Response.FoundationModels::Action { |
| 1495 | public static func appendText(_ text: Swift::String, segmentID: Swift::String? = nil, tokenCount: Swift::Int) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Response.FoundationModels::Action |
| 1496 | public static func replaceTextSegment(_ text: Swift::String, segmentID: Swift::String? = nil, tokenCount: Swift::Int) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Response.FoundationModels::Action |
| 1497 | public static func updateMetadata(_ values: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable]) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Response.FoundationModels::Action |
| 1498 | public static func updateUsage(input: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage.FoundationModels::Input, output: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage.FoundationModels::Output) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Response.FoundationModels::Action |
| 1499 | } |
| 1500 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1501 | @available(tvOS, unavailable) |
| 1502 | extension FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::Action { |
| 1503 | public static func toolCall(id: Swift::String, name: Swift::String, action: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::ToolCall.FoundationModels::Action) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::Action |
| 1504 | public static func updateMetadata(_ values: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable]) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::Action |
| 1505 | public static func updateUsage(input: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage.FoundationModels::Input, output: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage.FoundationModels::Output) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::Action |
| 1506 | } |
| 1507 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1508 | @available(tvOS, unavailable) |
| 1509 | extension FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::ToolCall.FoundationModels::Action { |
| 1510 | public static func appendArguments(_ content: Swift::String, tokenCount: Swift::Int) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::ToolCall.FoundationModels::Action |
| 1511 | public static func updateMetadata(_ values: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable]) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::ToolCall.FoundationModels::Action |
| 1512 | } |
| 1513 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1514 | @available(tvOS, unavailable) |
| 1515 | extension FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Reasoning.FoundationModels::Action { |
| 1516 | public static func appendText(_ text: Swift::String, segmentID: Swift::String? = nil, tokenCount: Swift::Int) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Reasoning.FoundationModels::Action |
| 1517 | public static func replaceTextSegment(_ text: Swift::String, segmentID: Swift::String? = nil, tokenCount: Swift::Int) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Reasoning.FoundationModels::Action |
| 1518 | public static func updateSignature(_ signature: Foundation::Data, tokenCount: Swift::Int) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Reasoning.FoundationModels::Action |
| 1519 | public static func updateMetadata(_ values: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable]) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Reasoning.FoundationModels::Action |
| 1520 | public static func updateUsage(input: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage.FoundationModels::Input, output: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Usage.FoundationModels::Output) -> FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Reasoning.FoundationModels::Action |
| 1521 | } |
| 1522 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1523 | @available(tvOS, unavailable) |
| 1524 | extension FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Event where Self == FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Response { |
| 1525 | public static func response(entryID: Swift::String? = nil, action: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Response.FoundationModels::Action) -> Self |
| 1526 | } |
| 1527 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1528 | @available(tvOS, unavailable) |
| 1529 | extension FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Event where Self == FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls { |
| 1530 | public static func toolCalls(entryID: Swift::String? = nil, action: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::ToolCalls.FoundationModels::Action) -> Self |
| 1531 | } |
| 1532 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1533 | @available(tvOS, unavailable) |
| 1534 | extension FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Event where Self == FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Reasoning { |
| 1535 | public static func reasoning(entryID: Swift::String? = nil, action: FoundationModels::LanguageModelExecutorGenerationChannel.FoundationModels::Reasoning.FoundationModels::Action) -> Self |
| 1536 | } |
| 1537 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1538 | @available(tvOS, unavailable) |
| 1539 | public struct LanguageModelExecutorGenerationRequest : Swift::Sendable { |
| 1540 | public var id: Foundation::UUID |
| 1541 | public var transcript: FoundationModels::Transcript |
| 1542 | public var enabledToolDefinitions: [FoundationModels::Transcript.FoundationModels::ToolDefinition] |
| 1543 | public var schema: FoundationModels::GenerationSchema? |
| 1544 | public var generationOptions: FoundationModels::GenerationOptions |
| 1545 | public var contextOptions: FoundationModels::ContextOptions |
| 1546 | public var metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] |
| 1547 | public init(id: Foundation::UUID, transcript: FoundationModels::Transcript, enabledTools: [FoundationModels::Transcript.FoundationModels::ToolDefinition], schema: FoundationModels::GenerationSchema? = nil, generationOptions: FoundationModels::GenerationOptions, contextOptions: FoundationModels::ContextOptions, metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable]) |
| 1548 | } |
| 1549 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1550 | @available(tvOS, unavailable) |
| 1551 | extension FoundationModels::LanguageModelExecutor { |
| 1552 | public func prewarm(model: Self.Model, transcript: FoundationModels::Transcript) |
| 1553 | } |
| 1554 | @_hasMissingDesignatedInitializers @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1555 | @available(tvOS, unavailable) |
| 1556 | final public class LanguageModelSession { |
| 1557 | final public var transcript: FoundationModels::Transcript { |
| 1558 | get |
| 1559 | } |
| 1560 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1561 | @available(tvOS, unavailable) |
| 1562 | final public var transcriptErrorHandlingPolicy: FoundationModels::TranscriptErrorHandlingPolicy? { |
| 1563 | get |
| 1564 | set |
| 1565 | } |
| 1566 | @objc deinit |
| 1567 | } |
| 1568 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1569 | @available(tvOS, unavailable) |
| 1570 | extension FoundationModels::LanguageModelSession : nonisolated Observation::Observable { |
| 1571 | } |
| 1572 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1573 | @available(tvOS, unavailable) |
| 1574 | extension FoundationModels::LanguageModelSession { |
| 1575 | final public var isResponding: Swift::Bool { |
| 1576 | get |
| 1577 | } |
| 1578 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1579 | @available(tvOS, unavailable) |
| 1580 | final public var usage: FoundationModels::LanguageModelSession.FoundationModels::Usage { |
| 1581 | get |
| 1582 | } |
| 1583 | } |
| 1584 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1585 | @available(tvOS, unavailable) |
| 1586 | extension FoundationModels::LanguageModelSession { |
| 1587 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1588 | @available(tvOS, unavailable) |
| 1589 | convenience public init<Failure>(model: some LanguageModel, tools: [any FoundationModels::Tool] = [], @FoundationModels::InstructionsBuilder instructions: () throws(Failure) -> FoundationModels::Instructions) throws(Failure) where Failure : Swift::Error |
| 1590 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1591 | @available(tvOS, unavailable) |
| 1592 | convenience public init(model: some LanguageModel, tools: [any FoundationModels::Tool] = [], transcript: FoundationModels::Transcript) |
| 1593 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1594 | @available(tvOS, unavailable) |
| 1595 | convenience public init(model: some LanguageModel, tools: [any FoundationModels::Tool] = [], instructions: FoundationModels::Instructions? = nil) |
| 1596 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1597 | @available(tvOS, unavailable) |
| 1598 | @_disfavoredOverload convenience public init(model: some LanguageModel, tools: [any FoundationModels::Tool] = [], instructions: Swift::String? = nil) |
| 1599 | final public func prewarm(promptPrefix: FoundationModels::Prompt? = nil) |
| 1600 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1601 | @available(tvOS, unavailable) |
| 1602 | public struct Response<Content> where Content : FoundationModels::Generable { |
| 1603 | public let content: Content |
| 1604 | public let rawContent: FoundationModels::GeneratedContent |
| 1605 | public let transcriptEntries: Swift::ArraySlice<FoundationModels::Transcript.FoundationModels::Entry> |
| 1606 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1607 | @available(tvOS, unavailable) |
| 1608 | public let usage: FoundationModels::LanguageModelSession.FoundationModels::Usage |
| 1609 | } |
| 1610 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1611 | @available(tvOS, unavailable) |
| 1612 | public struct Usage : Swift::Sendable { |
| 1613 | public var input: FoundationModels::LanguageModelSession.FoundationModels::Usage.FoundationModels::Input |
| 1614 | public var output: FoundationModels::LanguageModelSession.FoundationModels::Usage.FoundationModels::Output |
| 1615 | public var totalTokenCount: Swift::Int { |
| 1616 | get |
| 1617 | } |
| 1618 | public var metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] |
| 1619 | public struct Input : Swift::Sendable { |
| 1620 | public var totalTokenCount: Swift::Int |
| 1621 | public var cachedTokenCount: Swift::Int |
| 1622 | public init(totalTokenCount: Swift::Int, cachedTokenCount: Swift::Int) |
| 1623 | } |
| 1624 | public struct Output : Swift::Sendable { |
| 1625 | public var totalTokenCount: Swift::Int |
| 1626 | public var reasoningTokenCount: Swift::Int |
| 1627 | public init(totalTokenCount: Swift::Int, reasoningTokenCount: Swift::Int) |
| 1628 | } |
| 1629 | public init(input: FoundationModels::LanguageModelSession.FoundationModels::Usage.FoundationModels::Input, output: FoundationModels::LanguageModelSession.FoundationModels::Usage.FoundationModels::Output, metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) |
| 1630 | } |
| 1631 | } |
| 1632 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1633 | @available(tvOS, unavailable) |
| 1634 | extension FoundationModels::LanguageModelSession : @unchecked Swift::Sendable { |
| 1635 | } |
| 1636 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1637 | @available(tvOS, unavailable) |
| 1638 | extension FoundationModels::LanguageModelSession { |
| 1639 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1640 | @available(tvOS, unavailable) |
| 1641 | public enum Error : Foundation::LocalizedError, Swift::CustomDebugStringConvertible { |
| 1642 | case concurrentRequests |
| 1643 | case transcriptMutationWhileResponding |
| 1644 | public var debugDescription: Swift::String { |
| 1645 | get |
| 1646 | } |
| 1647 | public var errorDescription: Swift::String? { |
| 1648 | get |
| 1649 | } |
| 1650 | public static func == (a: FoundationModels::LanguageModelSession.FoundationModels::Error, b: FoundationModels::LanguageModelSession.FoundationModels::Error) -> Swift::Bool |
| 1651 | public func hash(into hasher: inout Swift::Hasher) |
| 1652 | public var hashValue: Swift::Int { |
| 1653 | get |
| 1654 | } |
| 1655 | } |
| 1656 | } |
| 1657 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1658 | @available(tvOS, unavailable) |
| 1659 | extension FoundationModels::LanguageModelSession { |
| 1660 | final public func streamResponse(to prompt: FoundationModels::Prompt, options: FoundationModels::GenerationOptions = GenerationOptions()) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Swift::String> |
| 1661 | @_disfavoredOverload final public func streamResponse(to prompt: Swift::String, options: FoundationModels::GenerationOptions = GenerationOptions()) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Swift::String> |
| 1662 | final public func streamResponse(options: FoundationModels::GenerationOptions = GenerationOptions(), @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) rethrows -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Swift::String> |
| 1663 | final public func streamResponse(to prompt: FoundationModels::Prompt, schema: FoundationModels::GenerationSchema, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions()) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<FoundationModels::GeneratedContent> |
| 1664 | @_disfavoredOverload final public func streamResponse(to prompt: Swift::String, schema: FoundationModels::GenerationSchema, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions()) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<FoundationModels::GeneratedContent> |
| 1665 | final public func streamResponse(schema: FoundationModels::GenerationSchema, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions(), @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) rethrows -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<FoundationModels::GeneratedContent> |
| 1666 | final public func streamResponse<Content>(to prompt: FoundationModels::Prompt, generating type: Content.Type = Content.self, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions()) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Content> where Content : FoundationModels::Generable |
| 1667 | @_disfavoredOverload final public func streamResponse<Content>(to prompt: Swift::String, generating type: Content.Type = Content.self, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions()) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Content> where Content : FoundationModels::Generable |
| 1668 | final public func streamResponse<Content>(generating type: Content.Type = Content.self, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions(), @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) rethrows -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Content> where Content : FoundationModels::Generable |
| 1669 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1670 | @available(tvOS, unavailable) |
| 1671 | final public func streamResponse(to prompt: FoundationModels::Prompt, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Swift::String> |
| 1672 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1673 | @available(tvOS, unavailable) |
| 1674 | @_disfavoredOverload final public func streamResponse(to prompt: Swift::String, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Swift::String> |
| 1675 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1676 | @available(tvOS, unavailable) |
| 1677 | final public func streamResponse(options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:], @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) rethrows -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Swift::String> |
| 1678 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1679 | @available(tvOS, unavailable) |
| 1680 | @_disfavoredOverload final public func streamResponse(to prompt: FoundationModels::Prompt, schema: FoundationModels::GenerationSchema, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<FoundationModels::GeneratedContent> |
| 1681 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1682 | @available(tvOS, unavailable) |
| 1683 | @_disfavoredOverload final public func streamResponse(to prompt: Swift::String, schema: FoundationModels::GenerationSchema, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<FoundationModels::GeneratedContent> |
| 1684 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1685 | @available(tvOS, unavailable) |
| 1686 | @_disfavoredOverload final public func streamResponse(schema: FoundationModels::GenerationSchema, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:], @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) rethrows -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<FoundationModels::GeneratedContent> |
| 1687 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1688 | @available(tvOS, unavailable) |
| 1689 | final public func streamResponse<Content>(to prompt: FoundationModels::Prompt, generating type: Content.Type = Content.self, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Content> where Content : FoundationModels::Generable |
| 1690 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1691 | @available(tvOS, unavailable) |
| 1692 | @_disfavoredOverload final public func streamResponse<Content>(to prompt: Swift::String, generating type: Content.Type = Content.self, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Content> where Content : FoundationModels::Generable |
| 1693 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1694 | @available(tvOS, unavailable) |
| 1695 | final public func streamResponse<Content>(generating type: Content.Type = Content.self, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:], @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) rethrows -> sending FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Content> where Content : FoundationModels::Generable |
| 1696 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1697 | @discardableResult |
| 1698 | nonisolated(nonsending) final public func respond(to prompt: FoundationModels::Prompt, options: FoundationModels::GenerationOptions = GenerationOptions()) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Swift::String> |
| 1699 | #endif |
| 1700 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1701 | @discardableResult |
| 1702 | @_disfavoredOverload nonisolated(nonsending) final public func respond(to prompt: Swift::String, options: FoundationModels::GenerationOptions = GenerationOptions()) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Swift::String> |
| 1703 | #endif |
| 1704 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1705 | @discardableResult |
| 1706 | nonisolated(nonsending) final public func respond(options: FoundationModels::GenerationOptions = GenerationOptions(), @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Swift::String> |
| 1707 | #endif |
| 1708 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1709 | @discardableResult |
| 1710 | nonisolated(nonsending) final public func respond(to prompt: FoundationModels::Prompt, schema: FoundationModels::GenerationSchema, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions()) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<FoundationModels::GeneratedContent> |
| 1711 | #endif |
| 1712 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1713 | @discardableResult |
| 1714 | @_disfavoredOverload nonisolated(nonsending) final public func respond(to prompt: Swift::String, schema: FoundationModels::GenerationSchema, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions()) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<FoundationModels::GeneratedContent> |
| 1715 | #endif |
| 1716 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1717 | @discardableResult |
| 1718 | nonisolated(nonsending) final public func respond(schema: FoundationModels::GenerationSchema, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions(), @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<FoundationModels::GeneratedContent> |
| 1719 | #endif |
| 1720 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1721 | @discardableResult |
| 1722 | nonisolated(nonsending) final public func respond<Content>(to prompt: FoundationModels::Prompt, generating type: Content.Type = Content.self, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions()) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Content> where Content : FoundationModels::Generable |
| 1723 | #endif |
| 1724 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1725 | @discardableResult |
| 1726 | @_disfavoredOverload nonisolated(nonsending) final public func respond<Content>(to prompt: Swift::String, generating type: Content.Type = Content.self, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions()) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Content> where Content : FoundationModels::Generable |
| 1727 | #endif |
| 1728 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1729 | @discardableResult |
| 1730 | nonisolated(nonsending) final public func respond<Content>(generating type: Content.Type = Content.self, includeSchemaInPrompt: Swift::Bool = true, options: FoundationModels::GenerationOptions = GenerationOptions(), @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Content> where Content : FoundationModels::Generable |
| 1731 | #endif |
| 1732 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1733 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1734 | @available(tvOS, unavailable) |
| 1735 | @discardableResult |
| 1736 | nonisolated(nonsending) final public func respond(to prompt: FoundationModels::Prompt, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Swift::String> |
| 1737 | #endif |
| 1738 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1739 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1740 | @available(tvOS, unavailable) |
| 1741 | @discardableResult |
| 1742 | @_disfavoredOverload nonisolated(nonsending) final public func respond(to prompt: Swift::String, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Swift::String> |
| 1743 | #endif |
| 1744 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1745 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1746 | @available(tvOS, unavailable) |
| 1747 | @discardableResult |
| 1748 | nonisolated(nonsending) final public func respond(options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:], @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Swift::String> |
| 1749 | #endif |
| 1750 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1751 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1752 | @available(tvOS, unavailable) |
| 1753 | @discardableResult |
| 1754 | @_disfavoredOverload nonisolated(nonsending) final public func respond(to prompt: FoundationModels::Prompt, schema: FoundationModels::GenerationSchema, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<FoundationModels::GeneratedContent> |
| 1755 | #endif |
| 1756 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1757 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1758 | @available(tvOS, unavailable) |
| 1759 | @discardableResult |
| 1760 | @_disfavoredOverload nonisolated(nonsending) final public func respond(to prompt: Swift::String, schema: FoundationModels::GenerationSchema, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<FoundationModels::GeneratedContent> |
| 1761 | #endif |
| 1762 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1763 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1764 | @available(tvOS, unavailable) |
| 1765 | @discardableResult |
| 1766 | @_disfavoredOverload nonisolated(nonsending) final public func respond(schema: FoundationModels::GenerationSchema, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:], @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<FoundationModels::GeneratedContent> |
| 1767 | #endif |
| 1768 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1769 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1770 | @available(tvOS, unavailable) |
| 1771 | @discardableResult |
| 1772 | nonisolated(nonsending) final public func respond<Content>(to prompt: FoundationModels::Prompt, generating type: Content.Type = Content.self, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Content> where Content : FoundationModels::Generable |
| 1773 | #endif |
| 1774 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1775 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1776 | @available(tvOS, unavailable) |
| 1777 | @discardableResult |
| 1778 | @_disfavoredOverload nonisolated(nonsending) final public func respond<Content>(to prompt: Swift::String, generating type: Content.Type = Content.self, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:]) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Content> where Content : FoundationModels::Generable |
| 1779 | #endif |
| 1780 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1781 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1782 | @available(tvOS, unavailable) |
| 1783 | @discardableResult |
| 1784 | nonisolated(nonsending) final public func respond<Content>(generating type: Content.Type = Content.self, options: FoundationModels::GenerationOptions = GenerationOptions(), contextOptions: FoundationModels::ContextOptions = ContextOptions(includeSchemaInPrompt: true), metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:], @FoundationModels::PromptBuilder prompt: () throws -> FoundationModels::Prompt) async throws -> FoundationModels::LanguageModelSession.FoundationModels::Response<Content> where Content : FoundationModels::Generable |
| 1785 | #endif |
| 1786 | } |
| 1787 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1788 | @available(tvOS, unavailable) |
| 1789 | extension FoundationModels::LanguageModelSession { |
| 1790 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1791 | @available(tvOS, unavailable) |
| 1792 | public struct ResponseStream<Content> where Content : FoundationModels::Generable { |
| 1793 | public struct Snapshot { |
| 1794 | public var content: Content.PartiallyGenerated |
| 1795 | public var rawContent: FoundationModels::GeneratedContent |
| 1796 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1797 | @available(tvOS, unavailable) |
| 1798 | public var transcriptEntries: Swift::ArraySlice<FoundationModels::Transcript.FoundationModels::Entry> |
| 1799 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1800 | @available(tvOS, unavailable) |
| 1801 | public var usage: FoundationModels::LanguageModelSession.FoundationModels::Usage |
| 1802 | } |
| 1803 | } |
| 1804 | } |
| 1805 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1806 | @available(tvOS, unavailable) |
| 1807 | extension FoundationModels::LanguageModelSession.FoundationModels::ResponseStream : _Concurrency::AsyncSequence { |
| 1808 | public typealias Element = FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Content>.FoundationModels::Snapshot |
| 1809 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1810 | @available(tvOS, unavailable) |
| 1811 | public struct AsyncIterator : _Concurrency::AsyncIteratorProtocol { |
| 1812 | public mutating func next(isolation actor: isolated (any _Concurrency::Actor)? = #isolation) async throws -> FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Content>.FoundationModels::Snapshot? |
| 1813 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 1814 | @available(tvOS, unavailable) |
| 1815 | public typealias Element = FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Content>.FoundationModels::Snapshot |
| 1816 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 1817 | @available(tvOS, unavailable) |
| 1818 | @_implements(_Concurrency::AsyncIteratorProtocol, Failure) public typealias __AsyncIteratorProtocol_Failure = any Swift::Error |
| 1819 | } |
| 1820 | public func makeAsyncIterator() -> FoundationModels::LanguageModelSession.FoundationModels::ResponseStream<Content>.FoundationModels::AsyncIterator |
| 1821 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 1822 | nonisolated(nonsending) public func collect() async throws -> sending FoundationModels::LanguageModelSession.FoundationModels::Response<Content> |
| 1823 | #endif |
| 1824 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 1825 | @available(tvOS, unavailable) |
| 1826 | @_implements(_Concurrency::AsyncSequence, Failure) public typealias __AsyncSequence_Failure = any Swift::Error |
| 1827 | } |
| 1828 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1829 | @available(tvOS, unavailable) |
| 1830 | public struct Transcript : Swift::Sendable, Swift::Equatable, Swift::RandomAccessCollection { |
| 1831 | public typealias Index = Swift::Int |
| 1832 | public subscript(index: FoundationModels::Transcript.FoundationModels::Index) -> FoundationModels::Transcript.FoundationModels::Entry { |
| 1833 | get |
| 1834 | set |
| 1835 | } |
| 1836 | public var startIndex: Swift::Int { |
| 1837 | get |
| 1838 | } |
| 1839 | public var endIndex: Swift::Int { |
| 1840 | get |
| 1841 | } |
| 1842 | public init(entries: some Sequence<Entry> = []) |
| 1843 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1844 | @available(tvOS, unavailable) |
| 1845 | public enum Entry : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 1846 | case instructions(FoundationModels::Transcript.FoundationModels::Instructions) |
| 1847 | case prompt(FoundationModels::Transcript.FoundationModels::Prompt) |
| 1848 | case toolCalls(FoundationModels::Transcript.FoundationModels::ToolCalls) |
| 1849 | case toolOutput(FoundationModels::Transcript.FoundationModels::ToolOutput) |
| 1850 | case response(FoundationModels::Transcript.FoundationModels::Response) |
| 1851 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1852 | @available(tvOS, unavailable) |
| 1853 | case reasoning(FoundationModels::Transcript.FoundationModels::Reasoning) |
| 1854 | public var id: Swift::String { |
| 1855 | get |
| 1856 | } |
| 1857 | public static func == (a: FoundationModels::Transcript.FoundationModels::Entry, b: FoundationModels::Transcript.FoundationModels::Entry) -> Swift::Bool |
| 1858 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 1859 | @available(tvOS, unavailable) |
| 1860 | public typealias ID = Swift::String |
| 1861 | } |
| 1862 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1863 | @available(tvOS, unavailable) |
| 1864 | public enum Segment : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 1865 | case text(FoundationModels::Transcript.FoundationModels::TextSegment) |
| 1866 | case structure(FoundationModels::Transcript.FoundationModels::StructuredSegment) |
| 1867 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1868 | @available(tvOS, unavailable) |
| 1869 | case attachment(FoundationModels::Transcript.FoundationModels::AttachmentSegment) |
| 1870 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1871 | @available(tvOS, unavailable) |
| 1872 | case custom(any FoundationModels::Transcript.FoundationModels::CustomSegment) |
| 1873 | public var id: Swift::String { |
| 1874 | get |
| 1875 | } |
| 1876 | public static func == (lhs: FoundationModels::Transcript.FoundationModels::Segment, rhs: FoundationModels::Transcript.FoundationModels::Segment) -> Swift::Bool |
| 1877 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 1878 | @available(tvOS, unavailable) |
| 1879 | public typealias ID = Swift::String |
| 1880 | } |
| 1881 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1882 | @available(tvOS, unavailable) |
| 1883 | public struct TextSegment : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 1884 | public var id: Swift::String |
| 1885 | public var content: Swift::String |
| 1886 | public init(id: Swift::String = UUID().uuidString, content: Swift::String) |
| 1887 | public static func == (a: FoundationModels::Transcript.FoundationModels::TextSegment, b: FoundationModels::Transcript.FoundationModels::TextSegment) -> Swift::Bool |
| 1888 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 1889 | @available(tvOS, unavailable) |
| 1890 | public typealias ID = Swift::String |
| 1891 | } |
| 1892 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1893 | @available(tvOS, unavailable) |
| 1894 | public struct StructuredSegment : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 1895 | public var id: Swift::String |
| 1896 | @available(iOS, deprecated: 27.0, renamed: "schemaName") |
| 1897 | @available(macOS, deprecated: 27.0, renamed: "schemaName") |
| 1898 | @available(visionOS, deprecated: 27.0, renamed: "schemaName") |
| 1899 | public var source: Swift::String |
| 1900 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1901 | @backDeployed(before: iOS 27.0, macOS 27.0, visionOS 27.0) |
| 1902 | @available(tvOS, unavailable) |
| 1903 | public var schemaName: Swift::String { |
| 1904 | get { source } |
| 1905 | set { source = newValue } |
| 1906 | } |
| 1907 | public var content: FoundationModels::GeneratedContent { |
| 1908 | get |
| 1909 | set |
| 1910 | } |
| 1911 | @available(iOS, deprecated: 27.0, renamed: "init(id:schemaName:content:)") |
| 1912 | @available(macOS, deprecated: 27.0, renamed: "init(id:schemaName:content:)") |
| 1913 | @available(visionOS, deprecated: 27.0, renamed: "init(id:schemaName:content:)") |
| 1914 | public init(id: Swift::String = UUID().uuidString, source: Swift::String, content: FoundationModels::GeneratedContent) |
| 1915 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1916 | @available(tvOS, unavailable) |
| 1917 | public init(id: Swift::String = UUID().uuidString, schemaName: Swift::String, content: FoundationModels::GeneratedContent) |
| 1918 | public static func == (a: FoundationModels::Transcript.FoundationModels::StructuredSegment, b: FoundationModels::Transcript.FoundationModels::StructuredSegment) -> Swift::Bool |
| 1919 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 1920 | @available(tvOS, unavailable) |
| 1921 | public typealias ID = Swift::String |
| 1922 | } |
| 1923 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1924 | @available(tvOS, unavailable) |
| 1925 | public struct AttachmentSegment : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 1926 | public var id: Swift::String |
| 1927 | public var content: FoundationModels::Transcript.FoundationModels::Attachment |
| 1928 | public var label: Swift::String? |
| 1929 | public init(id: Swift::String = UUID().uuidString, content: FoundationModels::Transcript.FoundationModels::Attachment, label: Swift::String? = nil) |
| 1930 | public static func == (a: FoundationModels::Transcript.FoundationModels::AttachmentSegment, b: FoundationModels::Transcript.FoundationModels::AttachmentSegment) -> Swift::Bool |
| 1931 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 1932 | @available(tvOS, unavailable) |
| 1933 | public typealias ID = Swift::String |
| 1934 | } |
| 1935 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1936 | @available(tvOS, unavailable) |
| 1937 | public enum Attachment : Swift::Sendable, Swift::Equatable { |
| 1938 | case image(FoundationModels::Transcript.FoundationModels::ImageAttachment) |
| 1939 | public static func == (a: FoundationModels::Transcript.FoundationModels::Attachment, b: FoundationModels::Transcript.FoundationModels::Attachment) -> Swift::Bool |
| 1940 | } |
| 1941 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1942 | @available(tvOS, unavailable) |
| 1943 | public struct ImageAttachment : Swift::Sendable, Swift::Equatable { |
| 1944 | public var cgImage: CoreGraphics::CGImage { |
| 1945 | get |
| 1946 | } |
| 1947 | public var ciImage: CoreImage::CIImage { |
| 1948 | get |
| 1949 | } |
| 1950 | public func pixelBuffer(resolution: CoreFoundation::CGSize? = nil, pixelFormat: Darwin::OSType? = nil) throws -> CoreVideo::CVReadOnlyPixelBuffer |
| 1951 | public var orientation: ImageIO::CGImagePropertyOrientation { |
| 1952 | get |
| 1953 | } |
| 1954 | public var url: Foundation::URL? { |
| 1955 | get |
| 1956 | } |
| 1957 | public init(_ cgImage: CoreGraphics::CGImage, orientation: ImageIO::CGImagePropertyOrientation? = nil) |
| 1958 | public init(_ ciImage: CoreImage::CIImage, orientation: ImageIO::CGImagePropertyOrientation? = nil) |
| 1959 | public init(_ pixelBuffer: CoreVideo::CVPixelBuffer, orientation: ImageIO::CGImagePropertyOrientation? = nil) |
| 1960 | public init(imageURL: Foundation::URL, orientation: ImageIO::CGImagePropertyOrientation? = nil) |
| 1961 | public static func == (a: FoundationModels::Transcript.FoundationModels::ImageAttachment, b: FoundationModels::Transcript.FoundationModels::ImageAttachment) -> Swift::Bool |
| 1962 | } |
| 1963 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1964 | @available(tvOS, unavailable) |
| 1965 | public struct Instructions : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 1966 | public var id: Swift::String |
| 1967 | public var segments: [FoundationModels::Transcript.FoundationModels::Segment] |
| 1968 | public var toolDefinitions: [FoundationModels::Transcript.FoundationModels::ToolDefinition] |
| 1969 | public init(id: Swift::String = UUID().uuidString, segments: [FoundationModels::Transcript.FoundationModels::Segment], toolDefinitions: [FoundationModels::Transcript.FoundationModels::ToolDefinition]) |
| 1970 | public static func == (a: FoundationModels::Transcript.FoundationModels::Instructions, b: FoundationModels::Transcript.FoundationModels::Instructions) -> Swift::Bool |
| 1971 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 1972 | @available(tvOS, unavailable) |
| 1973 | public typealias ID = Swift::String |
| 1974 | } |
| 1975 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1976 | @available(tvOS, unavailable) |
| 1977 | public struct ToolDefinition : Swift::Sendable, Swift::Equatable { |
| 1978 | public var name: Swift::String |
| 1979 | public var description: Swift::String |
| 1980 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1981 | @available(tvOS, unavailable) |
| 1982 | public var parameters: FoundationModels::GenerationSchema { |
| 1983 | get |
| 1984 | set |
| 1985 | } |
| 1986 | public init(name: Swift::String, description: Swift::String, parameters: FoundationModels::GenerationSchema) |
| 1987 | public init(tool: some Tool) |
| 1988 | public static func == (lhs: FoundationModels::Transcript.FoundationModels::ToolDefinition, rhs: FoundationModels::Transcript.FoundationModels::ToolDefinition) -> Swift::Bool |
| 1989 | } |
| 1990 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 1991 | @available(tvOS, unavailable) |
| 1992 | public struct Prompt : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 1993 | public var id: Swift::String |
| 1994 | public var segments: [FoundationModels::Transcript.FoundationModels::Segment] |
| 1995 | public var options: FoundationModels::GenerationOptions |
| 1996 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 1997 | @available(tvOS, unavailable) |
| 1998 | public var contextOptions: FoundationModels::ContextOptions |
| 1999 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2000 | @available(tvOS, unavailable) |
| 2001 | public var metadata: [Swift::String : any Swift::Codable & Swift::Sendable & Swift::Equatable] |
| 2002 | public var responseFormat: FoundationModels::Transcript.FoundationModels::ResponseFormat? |
| 2003 | public init(id: Swift::String = UUID().uuidString, segments: [FoundationModels::Transcript.FoundationModels::Segment], options: FoundationModels::GenerationOptions = GenerationOptions(), responseFormat: FoundationModels::Transcript.FoundationModels::ResponseFormat? = nil) |
| 2004 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2005 | @available(tvOS, unavailable) |
| 2006 | public init(id: Swift::String = UUID().uuidString, metadata: [Swift::String : any Swift::Codable & Swift::Sendable & Swift::Equatable] = [:], segments: [FoundationModels::Transcript.FoundationModels::Segment], options: FoundationModels::GenerationOptions = GenerationOptions(), responseFormat: FoundationModels::Transcript.FoundationModels::ResponseFormat? = nil, contextOptions: FoundationModels::ContextOptions = ContextOptions()) |
| 2007 | public static func == (lhs: FoundationModels::Transcript.FoundationModels::Prompt, rhs: FoundationModels::Transcript.FoundationModels::Prompt) -> Swift::Bool |
| 2008 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2009 | @available(tvOS, unavailable) |
| 2010 | public typealias ID = Swift::String |
| 2011 | } |
| 2012 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2013 | @available(tvOS, unavailable) |
| 2014 | public struct ResponseFormat : Swift::Sendable, Swift::Equatable { |
| 2015 | public var name: Swift::String { |
| 2016 | get |
| 2017 | } |
| 2018 | public init<Content>(type: Content.Type) where Content : FoundationModels::Generable |
| 2019 | public init(schema: FoundationModels::GenerationSchema) |
| 2020 | public static func == (a: FoundationModels::Transcript.FoundationModels::ResponseFormat, b: FoundationModels::Transcript.FoundationModels::ResponseFormat) -> Swift::Bool |
| 2021 | } |
| 2022 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2023 | @available(tvOS, unavailable) |
| 2024 | public struct ToolCalls : Swift::Sendable, Swift::Identifiable, Swift::Equatable, Swift::RandomAccessCollection { |
| 2025 | public var id: Swift::String |
| 2026 | public init<S>(id: Swift::String = UUID().uuidString, _ calls: S) where S : Swift::Sequence, S.Element == FoundationModels::Transcript.FoundationModels::ToolCall |
| 2027 | public subscript(position: Swift::Int) -> FoundationModels::Transcript.FoundationModels::ToolCall { |
| 2028 | get |
| 2029 | } |
| 2030 | public var startIndex: Swift::Int { |
| 2031 | get |
| 2032 | } |
| 2033 | public var endIndex: Swift::Int { |
| 2034 | get |
| 2035 | } |
| 2036 | public static func == (a: FoundationModels::Transcript.FoundationModels::ToolCalls, b: FoundationModels::Transcript.FoundationModels::ToolCalls) -> Swift::Bool |
| 2037 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2038 | @available(tvOS, unavailable) |
| 2039 | public typealias Element = FoundationModels::Transcript.FoundationModels::ToolCall |
| 2040 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2041 | @available(tvOS, unavailable) |
| 2042 | public typealias ID = Swift::String |
| 2043 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2044 | @available(tvOS, unavailable) |
| 2045 | public typealias Index = Swift::Int |
| 2046 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2047 | @available(tvOS, unavailable) |
| 2048 | public typealias Indices = Swift::Range<Swift::Int> |
| 2049 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2050 | @available(tvOS, unavailable) |
| 2051 | public typealias Iterator = Swift::IndexingIterator<FoundationModels::Transcript.FoundationModels::ToolCalls> |
| 2052 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2053 | @available(tvOS, unavailable) |
| 2054 | public typealias SubSequence = Swift::Slice<FoundationModels::Transcript.FoundationModels::ToolCalls> |
| 2055 | } |
| 2056 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2057 | @available(tvOS, unavailable) |
| 2058 | public struct ToolCall : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 2059 | public var id: Swift::String |
| 2060 | public var toolName: Swift::String |
| 2061 | public var arguments: FoundationModels::GeneratedContent { |
| 2062 | get |
| 2063 | set |
| 2064 | } |
| 2065 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2066 | @available(tvOS, unavailable) |
| 2067 | public var metadata: [Swift::String : any Swift::Codable & Swift::Sendable & Swift::Equatable] |
| 2068 | public init(id: Swift::String, toolName: Swift::String, arguments: FoundationModels::GeneratedContent) |
| 2069 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2070 | @available(tvOS, unavailable) |
| 2071 | public init(id: Swift::String, metadata: [Swift::String : any Swift::Codable & Swift::Sendable & Swift::Equatable], toolName: Swift::String, arguments: FoundationModels::GeneratedContent) |
| 2072 | public static func == (lhs: FoundationModels::Transcript.FoundationModels::ToolCall, rhs: FoundationModels::Transcript.FoundationModels::ToolCall) -> Swift::Bool |
| 2073 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2074 | @available(tvOS, unavailable) |
| 2075 | public typealias ID = Swift::String |
| 2076 | } |
| 2077 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2078 | @available(tvOS, unavailable) |
| 2079 | public struct ToolOutput : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 2080 | public var id: Swift::String |
| 2081 | public var toolName: Swift::String |
| 2082 | public var segments: [FoundationModels::Transcript.FoundationModels::Segment] |
| 2083 | public init(id: Swift::String, toolName: Swift::String, segments: [FoundationModels::Transcript.FoundationModels::Segment]) |
| 2084 | public static func == (a: FoundationModels::Transcript.FoundationModels::ToolOutput, b: FoundationModels::Transcript.FoundationModels::ToolOutput) -> Swift::Bool |
| 2085 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2086 | @available(tvOS, unavailable) |
| 2087 | public typealias ID = Swift::String |
| 2088 | } |
| 2089 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2090 | @available(tvOS, unavailable) |
| 2091 | public struct Response : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 2092 | public var id: Swift::String |
| 2093 | public var assetIDs: [Swift::String] |
| 2094 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, *) |
| 2095 | @usableFromInline |
| 2096 | internal var _metadata: [Swift::String : any Swift::Codable & Swift::Sendable & Swift::Equatable] |
| 2097 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2098 | @backDeployed(before: iOS 27.0, macOS 27.0, visionOS 27.0) |
| 2099 | @available(tvOS, unavailable) |
| 2100 | public var metadata: [Swift::String : any Swift::Codable & Swift::Sendable & Swift::Equatable] { |
| 2101 | get { |
| 2102 | if #available(iOS 27.0, macOS 27.0, visionOS 27.0, *) { |
| 2103 | _metadata |
| 2104 | } else { |
| 2105 | ["assetIDs": assetIDs] |
| 2106 | } |
| 2107 | } |
| 2108 | } |
| 2109 | public var segments: [FoundationModels::Transcript.FoundationModels::Segment] |
| 2110 | public init(id: Swift::String = UUID().uuidString, assetIDs: [Swift::String], segments: [FoundationModels::Transcript.FoundationModels::Segment]) |
| 2111 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2112 | @available(tvOS, unavailable) |
| 2113 | public init(id: Swift::String = UUID().uuidString, metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:], segments: [FoundationModels::Transcript.FoundationModels::Segment]) |
| 2114 | public static func == (lhs: FoundationModels::Transcript.FoundationModels::Response, rhs: FoundationModels::Transcript.FoundationModels::Response) -> Swift::Bool |
| 2115 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2116 | @available(tvOS, unavailable) |
| 2117 | public typealias ID = Swift::String |
| 2118 | } |
| 2119 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2120 | @available(tvOS, unavailable) |
| 2121 | public protocol CustomSegment : FoundationModels::InstructionsRepresentable, FoundationModels::PromptRepresentable, Swift::CustomStringConvertible, Swift::Equatable, Swift::Identifiable, Swift::Sendable { |
| 2122 | associatedtype Content : Swift::Decodable, Swift::Encodable, Swift::Equatable, Swift::Sendable |
| 2123 | var id: Swift::String { get } |
| 2124 | var content: Self.Content { get } |
| 2125 | } |
| 2126 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2127 | @available(tvOS, unavailable) |
| 2128 | public struct Reasoning : Swift::Sendable, Swift::Identifiable, Swift::Equatable { |
| 2129 | public var id: Swift::String |
| 2130 | public var segments: [FoundationModels::Transcript.FoundationModels::Segment] |
| 2131 | public var signature: Foundation::Data? |
| 2132 | public var metadata: [Swift::String : any Swift::Codable & Swift::Sendable & Swift::Equatable] |
| 2133 | public init(id: Swift::String = UUID().uuidString, metadata: [Swift::String : any Swift::Sendable & Swift::Codable & Swift::Equatable] = [:], segments: [FoundationModels::Transcript.FoundationModels::Segment], signature: Foundation::Data? = nil) |
| 2134 | public static func == (lhs: FoundationModels::Transcript.FoundationModels::Reasoning, rhs: FoundationModels::Transcript.FoundationModels::Reasoning) -> Swift::Bool |
| 2135 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 2136 | @available(tvOS, unavailable) |
| 2137 | public typealias ID = Swift::String |
| 2138 | } |
| 2139 | public static func == (a: FoundationModels::Transcript, b: FoundationModels::Transcript) -> Swift::Bool |
| 2140 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2141 | @available(tvOS, unavailable) |
| 2142 | public typealias Indices = Swift::Range<FoundationModels::Transcript.FoundationModels::Index> |
| 2143 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2144 | @available(tvOS, unavailable) |
| 2145 | public typealias Iterator = Swift::IndexingIterator<FoundationModels::Transcript> |
| 2146 | } |
| 2147 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2148 | @available(tvOS, unavailable) |
| 2149 | extension FoundationModels::Transcript : Swift::MutableCollection { |
| 2150 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 2151 | @available(tvOS, unavailable) |
| 2152 | public typealias Element = FoundationModels::Transcript.FoundationModels::Entry |
| 2153 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 2154 | @available(tvOS, unavailable) |
| 2155 | public typealias SubSequence = Swift::Slice<FoundationModels::Transcript> |
| 2156 | } |
| 2157 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2158 | @available(tvOS, unavailable) |
| 2159 | extension FoundationModels::Transcript : Swift::RangeReplaceableCollection { |
| 2160 | public init() |
| 2161 | public mutating func replaceSubrange<C>(_ subrange: Swift::Range<Swift::Int>, with newElements: consuming C) where C : Swift::Collection, C.Element == FoundationModels::Transcript.FoundationModels::Entry |
| 2162 | } |
| 2163 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2164 | @available(tvOS, unavailable) |
| 2165 | extension FoundationModels::Transcript.FoundationModels::CustomSegment { |
| 2166 | public var promptRepresentation: FoundationModels::Prompt { |
| 2167 | get |
| 2168 | } |
| 2169 | } |
| 2170 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2171 | @available(tvOS, unavailable) |
| 2172 | extension FoundationModels::Transcript.FoundationModels::CustomSegment { |
| 2173 | public func isEqual(to other: some Transcript.CustomSegment) -> Swift::Bool |
| 2174 | } |
| 2175 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2176 | @available(tvOS, unavailable) |
| 2177 | extension FoundationModels::Transcript { |
| 2178 | public var history: Swift::ArraySlice<FoundationModels::Transcript.FoundationModels::Entry> { |
| 2179 | _read |
| 2180 | set |
| 2181 | _modify |
| 2182 | } |
| 2183 | } |
| 2184 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2185 | @available(tvOS, unavailable) |
| 2186 | extension FoundationModels::Transcript : Swift::Codable { |
| 2187 | public init(from decoder: any Swift::Decoder) throws |
| 2188 | public func encode(to encoder: any Swift::Encoder) throws |
| 2189 | } |
| 2190 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2191 | @available(tvOS, unavailable) |
| 2192 | extension FoundationModels::Transcript.FoundationModels::Entry : Swift::CustomStringConvertible { |
| 2193 | public var description: Swift::String { |
| 2194 | get |
| 2195 | } |
| 2196 | } |
| 2197 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2198 | @available(tvOS, unavailable) |
| 2199 | extension FoundationModels::Transcript.FoundationModels::TextSegment : Swift::CustomStringConvertible { |
| 2200 | public var description: Swift::String { |
| 2201 | get |
| 2202 | } |
| 2203 | } |
| 2204 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2205 | @available(tvOS, unavailable) |
| 2206 | extension FoundationModels::Transcript.FoundationModels::StructuredSegment : Swift::CustomStringConvertible { |
| 2207 | public var description: Swift::String { |
| 2208 | get |
| 2209 | } |
| 2210 | } |
| 2211 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2212 | @available(tvOS, unavailable) |
| 2213 | extension FoundationModels::Transcript.FoundationModels::AttachmentSegment : Swift::CustomStringConvertible { |
| 2214 | public var description: Swift::String { |
| 2215 | get |
| 2216 | } |
| 2217 | } |
| 2218 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2219 | @available(tvOS, unavailable) |
| 2220 | extension FoundationModels::Transcript.FoundationModels::CustomSegment { |
| 2221 | public var description: Swift::String { |
| 2222 | get |
| 2223 | } |
| 2224 | } |
| 2225 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, *) |
| 2226 | @available(watchOS, unavailable) |
| 2227 | @available(tvOS, unavailable) |
| 2228 | extension FoundationModels::Transcript.FoundationModels::Reasoning { |
| 2229 | public var description: Swift::String { |
| 2230 | get |
| 2231 | } |
| 2232 | } |
| 2233 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2234 | @available(tvOS, unavailable) |
| 2235 | extension FoundationModels::Transcript.FoundationModels::Segment : Swift::CustomStringConvertible { |
| 2236 | public var description: Swift::String { |
| 2237 | get |
| 2238 | } |
| 2239 | } |
| 2240 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2241 | @available(tvOS, unavailable) |
| 2242 | extension FoundationModels::Transcript.FoundationModels::Instructions : Swift::CustomStringConvertible { |
| 2243 | public var description: Swift::String { |
| 2244 | get |
| 2245 | } |
| 2246 | } |
| 2247 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2248 | @available(tvOS, unavailable) |
| 2249 | extension FoundationModels::Transcript.FoundationModels::Prompt : Swift::CustomStringConvertible { |
| 2250 | public var description: Swift::String { |
| 2251 | get |
| 2252 | } |
| 2253 | } |
| 2254 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2255 | @available(tvOS, unavailable) |
| 2256 | extension FoundationModels::Transcript.FoundationModels::ResponseFormat : Swift::CustomStringConvertible { |
| 2257 | public var description: Swift::String { |
| 2258 | get |
| 2259 | } |
| 2260 | } |
| 2261 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2262 | @available(tvOS, unavailable) |
| 2263 | extension FoundationModels::Transcript.FoundationModels::ToolCalls : Swift::CustomStringConvertible { |
| 2264 | public var description: Swift::String { |
| 2265 | get |
| 2266 | } |
| 2267 | } |
| 2268 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2269 | @available(tvOS, unavailable) |
| 2270 | extension FoundationModels::Transcript.FoundationModels::ToolCall : Swift::CustomStringConvertible { |
| 2271 | public var description: Swift::String { |
| 2272 | get |
| 2273 | } |
| 2274 | } |
| 2275 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2276 | @available(tvOS, unavailable) |
| 2277 | extension FoundationModels::Transcript.FoundationModels::ToolOutput : Swift::CustomStringConvertible { |
| 2278 | public var description: Swift::String { |
| 2279 | get |
| 2280 | } |
| 2281 | } |
| 2282 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2283 | @available(tvOS, unavailable) |
| 2284 | extension FoundationModels::Transcript.FoundationModels::Response : Swift::CustomStringConvertible { |
| 2285 | public var description: Swift::String { |
| 2286 | get |
| 2287 | } |
| 2288 | } |
| 2289 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2290 | @available(tvOS, unavailable) |
| 2291 | public struct TranscriptErrorHandlingPolicy : Swift::Sendable { |
| 2292 | public static let revertTranscript: FoundationModels::TranscriptErrorHandlingPolicy |
| 2293 | public static let preserveTranscript: FoundationModels::TranscriptErrorHandlingPolicy |
| 2294 | } |
| 2295 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2296 | @available(tvOS, unavailable) |
| 2297 | public protocol AttachmentContent { |
| 2298 | } |
| 2299 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2300 | @available(tvOS, unavailable) |
| 2301 | public struct Attachment<Content> where Content : FoundationModels::AttachmentContent { |
| 2302 | public func label(_ label: Swift::String) -> FoundationModels::Attachment<Content> |
| 2303 | } |
| 2304 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2305 | @available(tvOS, unavailable) |
| 2306 | public struct ImageAttachmentContent : FoundationModels::AttachmentContent, Swift::Sendable, Swift::Equatable { |
| 2307 | public static func == (a: FoundationModels::ImageAttachmentContent, b: FoundationModels::ImageAttachmentContent) -> Swift::Bool |
| 2308 | } |
| 2309 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2310 | @available(tvOS, unavailable) |
| 2311 | extension FoundationModels::Attachment : FoundationModels::PromptRepresentable, FoundationModels::InstructionsRepresentable where Content == FoundationModels::ImageAttachmentContent { |
| 2312 | public var promptRepresentation: FoundationModels::Prompt { |
| 2313 | get |
| 2314 | } |
| 2315 | public var instructionsRepresentation: FoundationModels::Instructions { |
| 2316 | get |
| 2317 | } |
| 2318 | } |
| 2319 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2320 | @available(tvOS, unavailable) |
| 2321 | extension FoundationModels::Attachment where Content == FoundationModels::ImageAttachmentContent { |
| 2322 | public init(_ cgImage: CoreGraphics::CGImage, orientation: ImageIO::CGImagePropertyOrientation? = nil) |
| 2323 | public init(_ ciImage: CoreImage::CIImage, orientation: ImageIO::CGImagePropertyOrientation? = nil) |
| 2324 | public init(_ pixelBuffer: CoreVideo::CVPixelBuffer, orientation: ImageIO::CGImagePropertyOrientation? = nil) |
| 2325 | public init(imageURL: Foundation::URL, orientation: ImageIO::CGImagePropertyOrientation? = nil) |
| 2326 | } |
| 2327 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2328 | @available(tvOS, unavailable) |
| 2329 | public struct Instructions : Swift::Sendable { |
| 2330 | public init(_ content: some InstructionsRepresentable) |
| 2331 | @usableFromInline |
| 2332 | internal init<each I>(_ components: repeat each I) where repeat each I : FoundationModels::InstructionsRepresentable |
| 2333 | } |
| 2334 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2335 | @available(tvOS, unavailable) |
| 2336 | public protocol InstructionsRepresentable { |
| 2337 | @FoundationModels::InstructionsBuilder var instructionsRepresentation: FoundationModels::Instructions { get } |
| 2338 | } |
| 2339 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2340 | @available(tvOS, unavailable) |
| 2341 | extension FoundationModels::Instructions : FoundationModels::InstructionsRepresentable { |
| 2342 | public var instructionsRepresentation: FoundationModels::Instructions { |
| 2343 | get |
| 2344 | } |
| 2345 | } |
| 2346 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2347 | @available(tvOS, unavailable) |
| 2348 | extension Swift::String : FoundationModels::InstructionsRepresentable { |
| 2349 | public var instructionsRepresentation: FoundationModels::Instructions { |
| 2350 | get |
| 2351 | } |
| 2352 | } |
| 2353 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2354 | @available(tvOS, unavailable) |
| 2355 | extension Swift::Array : FoundationModels::InstructionsRepresentable where Element : FoundationModels::InstructionsRepresentable { |
| 2356 | public var instructionsRepresentation: FoundationModels::Instructions { |
| 2357 | get |
| 2358 | } |
| 2359 | } |
| 2360 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2361 | @available(tvOS, unavailable) |
| 2362 | extension FoundationModels::Transcript.FoundationModels::CustomSegment { |
| 2363 | public var instructionsRepresentation: FoundationModels::Instructions { |
| 2364 | get |
| 2365 | } |
| 2366 | } |
| 2367 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2368 | @available(tvOS, unavailable) |
| 2369 | @_functionBuilder public struct InstructionsBuilder { |
| 2370 | @_alwaysEmitIntoClient public static func buildBlock<each I>(_ components: repeat each I) -> FoundationModels::Instructions where repeat each I : FoundationModels::InstructionsRepresentable { |
| 2371 | Instructions(repeat each components) |
| 2372 | } |
| 2373 | @_alwaysEmitIntoClient public static func buildArray(_ instructions: [some InstructionsRepresentable]) -> FoundationModels::Instructions { |
| 2374 | Instructions(instructions) |
| 2375 | } |
| 2376 | @_alwaysEmitIntoClient public static func buildEither(first component: some InstructionsRepresentable) -> FoundationModels::Instructions { |
| 2377 | Instructions(component) |
| 2378 | } |
| 2379 | @_alwaysEmitIntoClient public static func buildEither(second component: some InstructionsRepresentable) -> FoundationModels::Instructions { |
| 2380 | Instructions(component) |
| 2381 | } |
| 2382 | @_alwaysEmitIntoClient public static func buildOptional(_ instructions: FoundationModels::Instructions?) -> FoundationModels::Instructions { |
| 2383 | instructions ?? Instructions() |
| 2384 | } |
| 2385 | @_alwaysEmitIntoClient public static func buildLimitedAvailability(_ instructions: some InstructionsRepresentable) -> FoundationModels::Instructions { |
| 2386 | Instructions(instructions) |
| 2387 | } |
| 2388 | @_disfavoredOverload @_alwaysEmitIntoClient public static func buildExpression<I>(_ expression: I) -> I where I : FoundationModels::InstructionsRepresentable { |
| 2389 | expression |
| 2390 | } |
| 2391 | @_alwaysEmitIntoClient public static func buildExpression(_ expression: FoundationModels::Instructions) -> FoundationModels::Instructions { |
| 2392 | expression |
| 2393 | } |
| 2394 | @available(*, unavailable, message: "Only `Instructions` and `InstructionsRepresentable` are supported.") |
| 2395 | @_alwaysEmitIntoClient public static func buildExpression<T>(_ expression: T) -> FoundationModels::Instructions { |
| 2396 | fatalError() |
| 2397 | } |
| 2398 | } |
| 2399 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2400 | @available(tvOS, unavailable) |
| 2401 | extension FoundationModels::Instructions { |
| 2402 | public init(@FoundationModels::InstructionsBuilder _ content: () throws -> FoundationModels::Instructions) rethrows |
| 2403 | } |
| 2404 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2405 | @available(tvOS, unavailable) |
| 2406 | public struct Prompt : Swift::Sendable { |
| 2407 | public init(_ content: some PromptRepresentable) |
| 2408 | @usableFromInline |
| 2409 | internal init<each P>(_ components: repeat each P) where repeat each P : FoundationModels::PromptRepresentable |
| 2410 | } |
| 2411 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2412 | @available(tvOS, unavailable) |
| 2413 | public protocol PromptRepresentable { |
| 2414 | @FoundationModels::PromptBuilder var promptRepresentation: FoundationModels::Prompt { get } |
| 2415 | } |
| 2416 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2417 | @available(tvOS, unavailable) |
| 2418 | extension FoundationModels::Prompt : FoundationModels::PromptRepresentable { |
| 2419 | public var promptRepresentation: FoundationModels::Prompt { |
| 2420 | get |
| 2421 | } |
| 2422 | } |
| 2423 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2424 | @available(tvOS, unavailable) |
| 2425 | extension Swift::String : FoundationModels::PromptRepresentable { |
| 2426 | public var promptRepresentation: FoundationModels::Prompt { |
| 2427 | get |
| 2428 | } |
| 2429 | } |
| 2430 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2431 | @available(tvOS, unavailable) |
| 2432 | extension Swift::Array : FoundationModels::PromptRepresentable where Element : FoundationModels::PromptRepresentable { |
| 2433 | public var promptRepresentation: FoundationModels::Prompt { |
| 2434 | get |
| 2435 | } |
| 2436 | } |
| 2437 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2438 | @available(tvOS, unavailable) |
| 2439 | @_functionBuilder public struct PromptBuilder { |
| 2440 | @_alwaysEmitIntoClient public static func buildBlock<each P>(_ components: repeat each P) -> FoundationModels::Prompt where repeat each P : FoundationModels::PromptRepresentable { |
| 2441 | Prompt(repeat each components) |
| 2442 | } |
| 2443 | @_alwaysEmitIntoClient public static func buildArray(_ prompts: [some PromptRepresentable]) -> FoundationModels::Prompt { |
| 2444 | Prompt(prompts) |
| 2445 | } |
| 2446 | @_alwaysEmitIntoClient public static func buildEither(first component: some PromptRepresentable) -> FoundationModels::Prompt { |
| 2447 | Prompt(component) |
| 2448 | } |
| 2449 | @_alwaysEmitIntoClient public static func buildEither(second component: some PromptRepresentable) -> FoundationModels::Prompt { |
| 2450 | Prompt(component) |
| 2451 | } |
| 2452 | @_alwaysEmitIntoClient public static func buildOptional(_ component: FoundationModels::Prompt?) -> FoundationModels::Prompt { |
| 2453 | component ?? Prompt() |
| 2454 | } |
| 2455 | @_alwaysEmitIntoClient public static func buildLimitedAvailability(_ prompt: some PromptRepresentable) -> FoundationModels::Prompt { |
| 2456 | Prompt(prompt) |
| 2457 | } |
| 2458 | @_disfavoredOverload @_alwaysEmitIntoClient public static func buildExpression<P>(_ expression: P) -> P where P : FoundationModels::PromptRepresentable { |
| 2459 | expression |
| 2460 | } |
| 2461 | @_alwaysEmitIntoClient public static func buildExpression(_ expression: FoundationModels::Prompt) -> FoundationModels::Prompt { |
| 2462 | expression |
| 2463 | } |
| 2464 | @available(*, unavailable, message: "Only `Prompt` and `PromptRepresentable` are supported.") |
| 2465 | @_alwaysEmitIntoClient public static func buildExpression<T>(_ expression: T) -> FoundationModels::Prompt { |
| 2466 | fatalError() |
| 2467 | } |
| 2468 | } |
| 2469 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2470 | @available(tvOS, unavailable) |
| 2471 | extension FoundationModels::Prompt { |
| 2472 | public init(@FoundationModels::PromptBuilder _ content: () throws -> FoundationModels::Prompt) rethrows |
| 2473 | } |
| 2474 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2475 | @available(tvOS, unavailable) |
| 2476 | public struct ImageReference : Swift::Sendable, Swift::Equatable { |
| 2477 | public let attachmentLabel: Swift::String |
| 2478 | public func resolve(in transcript: FoundationModels::Transcript) -> FoundationModels::Transcript.FoundationModels::ImageAttachment? |
| 2479 | nonisolated public static var generationSchema: FoundationModels::GenerationSchema { |
| 2480 | get |
| 2481 | } |
| 2482 | nonisolated public var generatedContent: FoundationModels::GeneratedContent { |
| 2483 | get |
| 2484 | } |
| 2485 | nonisolated public struct PartiallyGenerated : Swift::Identifiable, nonisolated FoundationModels::ConvertibleFromGeneratedContent, Swift::Equatable { |
| 2486 | public var id: FoundationModels::GenerationID |
| 2487 | public var attachmentLabel: Swift::String.FoundationModels::PartiallyGenerated? |
| 2488 | nonisolated public init(_ content: FoundationModels::GeneratedContent) throws |
| 2489 | public static func == (a: FoundationModels::ImageReference.FoundationModels::PartiallyGenerated, b: FoundationModels::ImageReference.FoundationModels::PartiallyGenerated) -> Swift::Bool |
| 2490 | @available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *) |
| 2491 | @available(tvOS, unavailable) |
| 2492 | public typealias ID = FoundationModels::GenerationID |
| 2493 | } |
| 2494 | public static func == (a: FoundationModels::ImageReference, b: FoundationModels::ImageReference) -> Swift::Bool |
| 2495 | } |
| 2496 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2497 | @available(tvOS, unavailable) |
| 2498 | extension FoundationModels::ImageReference : nonisolated FoundationModels::Generable { |
| 2499 | nonisolated public init(_ content: FoundationModels::GeneratedContent) throws |
| 2500 | } |
| 2501 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2502 | @available(tvOS, unavailable) |
| 2503 | public protocol Tool<Arguments, Output> : Swift::Sendable { |
| 2504 | associatedtype Output : FoundationModels::PromptRepresentable |
| 2505 | associatedtype Arguments : FoundationModels::ConvertibleFromGeneratedContent |
| 2506 | var name: Swift::String { get } |
| 2507 | var description: Swift::String { get } |
| 2508 | var parameters: FoundationModels::GenerationSchema { get } |
| 2509 | var includesSchemaInInstructions: Swift::Bool { get } |
| 2510 | #if compiler(>=5.3) && $AsyncExecutionBehaviorAttributes |
| 2511 | @concurrent func call(arguments: Self.Arguments) async throws -> Self.Output |
| 2512 | #endif |
| 2513 | } |
| 2514 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2515 | @available(tvOS, unavailable) |
| 2516 | extension FoundationModels::Tool { |
| 2517 | public var name: Swift::String { |
| 2518 | get |
| 2519 | } |
| 2520 | public var includesSchemaInInstructions: Swift::Bool { |
| 2521 | get |
| 2522 | } |
| 2523 | } |
| 2524 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2525 | @available(tvOS, unavailable) |
| 2526 | extension FoundationModels::Tool where Self.Arguments : FoundationModels::Generable { |
| 2527 | public var parameters: FoundationModels::GenerationSchema { |
| 2528 | get |
| 2529 | } |
| 2530 | } |
| 2531 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2532 | @available(tvOS, unavailable) |
| 2533 | extension FoundationModels::Tool where Self.Arguments == Swift::String { |
| 2534 | @available(*, unavailable, message: "'Tool' that uses 'String' as 'Arguments' type is unsupported. Use '@Generable' struct instead.") |
| 2535 | public var parameters: FoundationModels::GenerationSchema { |
| 2536 | get |
| 2537 | } |
| 2538 | } |
| 2539 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2540 | @available(tvOS, unavailable) |
| 2541 | extension FoundationModels::Tool where Self.Arguments == Swift::Int { |
| 2542 | @available(*, unavailable, message: "'Tool' that uses 'Int' as 'Arguments' type is unsupported. Use '@Generable' struct instead.") |
| 2543 | public var parameters: FoundationModels::GenerationSchema { |
| 2544 | get |
| 2545 | } |
| 2546 | } |
| 2547 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2548 | @available(tvOS, unavailable) |
| 2549 | extension FoundationModels::Tool where Self.Arguments == Swift::Double { |
| 2550 | @available(*, unavailable, message: "'Tool' that uses 'Double' as 'Arguments' type is unsupported. Use '@Generable' struct instead.") |
| 2551 | public var parameters: FoundationModels::GenerationSchema { |
| 2552 | get |
| 2553 | } |
| 2554 | } |
| 2555 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2556 | @available(tvOS, unavailable) |
| 2557 | extension FoundationModels::Tool where Self.Arguments == Swift::Float { |
| 2558 | @available(*, unavailable, message: "'Tool' that uses 'Float' as 'Arguments' type is unsupported. Use '@Generable' struct instead.") |
| 2559 | public var parameters: FoundationModels::GenerationSchema { |
| 2560 | get |
| 2561 | } |
| 2562 | } |
| 2563 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2564 | @available(tvOS, unavailable) |
| 2565 | extension FoundationModels::Tool where Self.Arguments == Foundation::Decimal { |
| 2566 | @available(*, unavailable, message: "'Tool' that uses 'Decimal' as 'Arguments' type is unsupported. Use '@Generable' struct instead.") |
| 2567 | public var parameters: FoundationModels::GenerationSchema { |
| 2568 | get |
| 2569 | } |
| 2570 | } |
| 2571 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2572 | @available(tvOS, unavailable) |
| 2573 | extension FoundationModels::Tool where Self.Arguments == Swift::Bool { |
| 2574 | @available(*, unavailable, message: "'Tool' that uses 'Bool' as 'Arguments' type is unsupported. Use '@Generable' struct instead.") |
| 2575 | public var parameters: FoundationModels::GenerationSchema { |
| 2576 | get |
| 2577 | } |
| 2578 | } |
| 2579 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2580 | @available(tvOS, unavailable) |
| 2581 | public struct _ResolvedToolList { |
| 2582 | } |
| 2583 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, watchOS 27.0, *) |
| 2584 | @available(tvOS, unavailable) |
| 2585 | extension Swift::Result : FoundationModels::PromptRepresentable where Success : FoundationModels::PromptRepresentable, Failure : FoundationModels::PromptRepresentable { |
| 2586 | public var promptRepresentation: FoundationModels::Prompt { |
| 2587 | get |
| 2588 | } |
| 2589 | } |
| 2590 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2591 | @available(tvOS, unavailable) |
| 2592 | public struct ContextOptions : Swift::Sendable, Swift::Equatable { |
| 2593 | public enum ReasoningLevel : Swift::Sendable, Swift::Equatable { |
| 2594 | case light |
| 2595 | case moderate |
| 2596 | case deep |
| 2597 | case custom(Swift::String) |
| 2598 | public static func == (a: FoundationModels::ContextOptions.FoundationModels::ReasoningLevel, b: FoundationModels::ContextOptions.FoundationModels::ReasoningLevel) -> Swift::Bool |
| 2599 | } |
| 2600 | public var includeSchemaInPrompt: Swift::Bool? |
| 2601 | public var reasoningLevel: FoundationModels::ContextOptions.FoundationModels::ReasoningLevel? |
| 2602 | public init(includeSchemaInPrompt: Swift::Bool? = nil, reasoningLevel: FoundationModels::ContextOptions.FoundationModels::ReasoningLevel? = nil) |
| 2603 | public static func == (a: FoundationModels::ContextOptions, b: FoundationModels::ContextOptions) -> Swift::Bool |
| 2604 | } |
| 2605 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2606 | @available(tvOS, unavailable) |
| 2607 | public struct DynamicGenerationSchema : Swift::Sendable { |
| 2608 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, watchOS 27.0, *) |
| 2609 | @available(tvOS, unavailable) |
| 2610 | public static var null: FoundationModels::DynamicGenerationSchema { |
| 2611 | get |
| 2612 | } |
| 2613 | public init(name: Swift::String, description: Swift::String? = nil, properties: [FoundationModels::DynamicGenerationSchema.FoundationModels::Property]) |
| 2614 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, watchOS 27.0, *) |
| 2615 | @available(tvOS, unavailable) |
| 2616 | public init(name: Swift::String, description: Swift::String? = nil, representNilExplicitlyInGeneratedContent explicitNil: Swift::Bool, properties: [FoundationModels::DynamicGenerationSchema.FoundationModels::Property]) |
| 2617 | public init(name: Swift::String, description: Swift::String? = nil, anyOf choices: [FoundationModels::DynamicGenerationSchema]) |
| 2618 | public init(name: Swift::String, description: Swift::String? = nil, anyOf choices: [Swift::String]) |
| 2619 | public init(arrayOf itemSchema: FoundationModels::DynamicGenerationSchema, minimumElements: Swift::Int? = nil, maximumElements: Swift::Int? = nil) |
| 2620 | public init<Value>(type: Value.Type, guides: [FoundationModels::GenerationGuide<Value>] = []) where Value : FoundationModels::Generable |
| 2621 | public init(referenceTo name: Swift::String) |
| 2622 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2623 | @available(tvOS, unavailable) |
| 2624 | public struct Property : Swift::Sendable { |
| 2625 | public init(name: Swift::String, description: Swift::String? = nil, schema: FoundationModels::DynamicGenerationSchema, isOptional: Swift::Bool = false) |
| 2626 | } |
| 2627 | } |
| 2628 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2629 | @available(tvOS, unavailable) |
| 2630 | public struct GenerationID : Swift::Sendable, Swift::Hashable { |
| 2631 | public init() |
| 2632 | public static func == (a: FoundationModels::GenerationID, b: FoundationModels::GenerationID) -> Swift::Bool |
| 2633 | public func hash(into hasher: inout Swift::Hasher) |
| 2634 | public var hashValue: Swift::Int { |
| 2635 | get |
| 2636 | } |
| 2637 | } |
| 2638 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2639 | @available(tvOS, unavailable) |
| 2640 | public struct GenerationOptions : Swift::Sendable, Swift::Equatable { |
| 2641 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 2642 | @available(*, deprecated, renamed: "samplingMode") |
| 2643 | @available(tvOS, unavailable) |
| 2644 | @available(watchOS, unavailable) |
| 2645 | public var sampling: FoundationModels::GenerationOptions.FoundationModels::SamplingMode? |
| 2646 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2647 | @backDeployed(before: iOS 27.0, macOS 27.0, visionOS 27.0) |
| 2648 | @available(tvOS, unavailable) |
| 2649 | public var samplingMode: FoundationModels::GenerationOptions.FoundationModels::SamplingMode? { |
| 2650 | get { |
| 2651 | sampling |
| 2652 | } |
| 2653 | set { |
| 2654 | sampling = newValue |
| 2655 | } |
| 2656 | } |
| 2657 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2658 | @available(tvOS, unavailable) |
| 2659 | public var temperature: Swift::Double? |
| 2660 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2661 | @available(tvOS, unavailable) |
| 2662 | public var maximumResponseTokens: Swift::Int? |
| 2663 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2664 | @available(tvOS, unavailable) |
| 2665 | public var toolCallingMode: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode? |
| 2666 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, *) |
| 2667 | @available(*, deprecated, renamed: "init(samplingMode:temperature:maximumResponseTokens:)") |
| 2668 | @available(tvOS, unavailable) |
| 2669 | @available(watchOS, unavailable) |
| 2670 | public init(sampling: FoundationModels::GenerationOptions.FoundationModels::SamplingMode?, temperature: Swift::Double? = nil, maximumResponseTokens: Swift::Int? = nil) |
| 2671 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2672 | @backDeployed(before: iOS 27.0, macOS 27.0, visionOS 27.0) |
| 2673 | @available(tvOS, unavailable) |
| 2674 | public init(samplingMode: FoundationModels::GenerationOptions.FoundationModels::SamplingMode? = nil, temperature: Swift::Double? = nil, maximumResponseTokens: Swift::Int? = nil) { |
| 2675 | self.init( |
| 2676 | sampling: samplingMode, |
| 2677 | temperature: temperature, |
| 2678 | maximumResponseTokens: maximumResponseTokens |
| 2679 | ) |
| 2680 | } |
| 2681 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2682 | @available(tvOS, unavailable) |
| 2683 | public init(samplingMode: FoundationModels::GenerationOptions.FoundationModels::SamplingMode? = nil, temperature: Swift::Double? = nil, maximumResponseTokens: Swift::Int? = nil, toolCallingMode: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode?) |
| 2684 | public static func == (a: FoundationModels::GenerationOptions, b: FoundationModels::GenerationOptions) -> Swift::Bool |
| 2685 | } |
| 2686 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2687 | @available(tvOS, unavailable) |
| 2688 | extension FoundationModels::GenerationOptions { |
| 2689 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2690 | @available(tvOS, unavailable) |
| 2691 | public struct SamplingMode : Swift::Sendable, Swift::Equatable { |
| 2692 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2693 | @available(tvOS, unavailable) |
| 2694 | public static var greedy: FoundationModels::GenerationOptions.FoundationModels::SamplingMode { |
| 2695 | get |
| 2696 | } |
| 2697 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2698 | @available(tvOS, unavailable) |
| 2699 | public static func random(top k: Swift::Int, seed: Swift::UInt64? = nil) -> FoundationModels::GenerationOptions.FoundationModels::SamplingMode |
| 2700 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2701 | @available(tvOS, unavailable) |
| 2702 | public static func random(probabilityThreshold: Swift::Double, seed: Swift::UInt64? = nil) -> FoundationModels::GenerationOptions.FoundationModels::SamplingMode |
| 2703 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2704 | @available(tvOS, unavailable) |
| 2705 | public let kind: FoundationModels::GenerationOptions.FoundationModels::SamplingMode.FoundationModels::Kind |
| 2706 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2707 | @available(tvOS, unavailable) |
| 2708 | public enum Kind : Swift::Sendable, Swift::Equatable { |
| 2709 | case greedy |
| 2710 | case top(k: Swift::Int, seed: Swift::UInt64?) |
| 2711 | case nucleus(threshold: Swift::Double, seed: Swift::UInt64?) |
| 2712 | public static func == (a: FoundationModels::GenerationOptions.FoundationModels::SamplingMode.FoundationModels::Kind, b: FoundationModels::GenerationOptions.FoundationModels::SamplingMode.FoundationModels::Kind) -> Swift::Bool |
| 2713 | } |
| 2714 | public static func == (a: FoundationModels::GenerationOptions.FoundationModels::SamplingMode, b: FoundationModels::GenerationOptions.FoundationModels::SamplingMode) -> Swift::Bool |
| 2715 | } |
| 2716 | @available(iOS 27.0, macOS 27.0, visionOS 27.0, watchOS 27.0, *) |
| 2717 | @available(tvOS, unavailable) |
| 2718 | public struct ToolCallingMode : Swift::Sendable, Swift::Equatable { |
| 2719 | public static let allowed: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode |
| 2720 | public static let required: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode |
| 2721 | public static let disallowed: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode |
| 2722 | public enum Kind : Swift::Sendable, Swift::Equatable { |
| 2723 | case allowed |
| 2724 | case required |
| 2725 | case disallowed |
| 2726 | public static func == (a: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode.FoundationModels::Kind, b: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode.FoundationModels::Kind) -> Swift::Bool |
| 2727 | public func hash(into hasher: inout Swift::Hasher) |
| 2728 | public var hashValue: Swift::Int { |
| 2729 | get |
| 2730 | } |
| 2731 | } |
| 2732 | public var kind: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode.FoundationModels::Kind |
| 2733 | public static func == (a: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode, b: FoundationModels::GenerationOptions.FoundationModels::ToolCallingMode) -> Swift::Bool |
| 2734 | } |
| 2735 | } |
| 2736 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2737 | @available(tvOS, unavailable) |
| 2738 | public struct GenerationSchema : Swift::Sendable, Swift::Codable, Swift::CustomDebugStringConvertible { |
| 2739 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2740 | @available(tvOS, unavailable) |
| 2741 | public struct Property : Swift::Sendable { |
| 2742 | public init<Value>(name: Swift::String, description: Swift::String? = nil, type: Value.Type, guides: [FoundationModels::GenerationGuide<Value>] = []) where Value : FoundationModels::Generable |
| 2743 | public init<Value>(name: Swift::String, description: Swift::String? = nil, type: Value?.Type, guides: [FoundationModels::GenerationGuide<Value>] = []) where Value : FoundationModels::Generable |
| 2744 | public init<RegexOutput>(name: Swift::String, description: Swift::String? = nil, type: Swift::String.Type, guides: [_StringProcessing::Regex<RegexOutput>] = []) |
| 2745 | public init<RegexOutput>(name: Swift::String, description: Swift::String? = nil, type: Swift::String?.Type, guides: [_StringProcessing::Regex<RegexOutput>] = []) |
| 2746 | } |
| 2747 | public init(type: any FoundationModels::Generable.Type, description: Swift::String? = nil, properties: [FoundationModels::GenerationSchema.FoundationModels::Property]) |
| 2748 | public init(from decoder: any Swift::Decoder) throws |
| 2749 | public func encode(to encoder: any Swift::Encoder) throws |
| 2750 | public var debugDescription: Swift::String { |
| 2751 | get |
| 2752 | } |
| 2753 | @available(iOS 26.4, macOS 26.4, visionOS 26.4, watchOS 27.0, *) |
| 2754 | @available(tvOS, unavailable) |
| 2755 | public init(type: any FoundationModels::Generable.Type, description: Swift::String? = nil, representNilExplicitlyInGeneratedContent explicitNil: Swift::Bool, properties: [FoundationModels::GenerationSchema.FoundationModels::Property]) |
| 2756 | public init(type: any FoundationModels::Generable.Type, description: Swift::String? = nil, anyOf choices: [Swift::String]) |
| 2757 | public init(type: any FoundationModels::Generable.Type, description: Swift::String? = nil, anyOf types: [any FoundationModels::Generable.Type]) |
| 2758 | public init(root: FoundationModels::DynamicGenerationSchema, dependencies: [FoundationModels::DynamicGenerationSchema]) throws |
| 2759 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2760 | @available(tvOS, unavailable) |
| 2761 | public enum SchemaError : Swift::Error, Foundation::LocalizedError { |
| 2762 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2763 | @available(tvOS, unavailable) |
| 2764 | public struct Context : Swift::Sendable { |
| 2765 | public let debugDescription: Swift::String |
| 2766 | public init(debugDescription: Swift::String) |
| 2767 | } |
| 2768 | case duplicateType(schema: Swift::String?, type: Swift::String, context: FoundationModels::GenerationSchema.FoundationModels::SchemaError.FoundationModels::Context) |
| 2769 | case duplicateProperty(schema: Swift::String, property: Swift::String, context: FoundationModels::GenerationSchema.FoundationModels::SchemaError.FoundationModels::Context) |
| 2770 | case emptyTypeChoices(schema: Swift::String, context: FoundationModels::GenerationSchema.FoundationModels::SchemaError.FoundationModels::Context) |
| 2771 | case undefinedReferences(schema: Swift::String?, references: [Swift::String], context: FoundationModels::GenerationSchema.FoundationModels::SchemaError.FoundationModels::Context) |
| 2772 | public var errorDescription: Swift::String? { |
| 2773 | get |
| 2774 | } |
| 2775 | public var recoverySuggestion: Swift::String? { |
| 2776 | get |
| 2777 | } |
| 2778 | } |
| 2779 | } |
| 2780 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2781 | @available(tvOS, unavailable) |
| 2782 | public struct LanguageModelFeedback { |
| 2783 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2784 | @available(tvOS, unavailable) |
| 2785 | public enum Sentiment : Swift::Sendable, Swift::CaseIterable { |
| 2786 | case positive |
| 2787 | case negative |
| 2788 | case neutral |
| 2789 | public static func == (a: FoundationModels::LanguageModelFeedback.FoundationModels::Sentiment, b: FoundationModels::LanguageModelFeedback.FoundationModels::Sentiment) -> Swift::Bool |
| 2790 | @available(macOS 26.0, iOS 26.0, watchOS 27.0, visionOS 26.0, *) |
| 2791 | @available(tvOS, unavailable) |
| 2792 | public typealias AllCases = [FoundationModels::LanguageModelFeedback.FoundationModels::Sentiment] |
| 2793 | nonisolated public static var allCases: [FoundationModels::LanguageModelFeedback.FoundationModels::Sentiment] { |
| 2794 | get |
| 2795 | } |
| 2796 | public func hash(into hasher: inout Swift::Hasher) |
| 2797 | public var hashValue: Swift::Int { |
| 2798 | get |
| 2799 | } |
| 2800 | } |
| 2801 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2802 | @available(tvOS, unavailable) |
| 2803 | public struct Issue : Swift::Sendable { |
| 2804 | @available(iOS 26.0, macOS 26.0, visionOS 26.0, watchOS 27.0, *) |
| 2805 | @available(tvOS, unavailable) |
| 2806 | public enum Category : Swift::Sendable, Swift::CaseIterable { |
| 2807 | case unhelpful |
| 2808 | case tooVerbose |
| 2809 | case didNotFollowInstructions |