Skip to content

Commit 97db31f

Browse files
Fix missing iOS availability annotations in SystemLanguageModel extensions (#63)
Several @available annotations only specified macOS 26.0, * but were missing iOS 26.0 and other platforms. This causes build failures when targeting iOS 26.0 because the extensions use iOS 26-only APIs (GenerationSchema, GeneratedContent) but are marked available on all iOS versions due to the * wildcard. This fixes the 4 affected extensions to include all platforms, matching the pattern used elsewhere in the file (e.g., line 371).
1 parent 8503fd1 commit 97db31f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/AnyLanguageModel/Models/SystemLanguageModel.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@
317317
}
318318
}
319319

320-
@available(macOS 26.0, *)
320+
@available(macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0, *)
321321
extension FoundationModels.GenerationSchema {
322322
internal init(_ content: AnyLanguageModel.GenerationSchema) {
323323
let resolvedSchema = content.withResolvedRoot() ?? content
@@ -344,21 +344,21 @@
344344
}
345345
}
346346

347-
@available(macOS 26.0, *)
347+
@available(macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0, *)
348348
extension FoundationModels.GeneratedContent {
349349
internal init(_ content: AnyLanguageModel.GeneratedContent) throws {
350350
try self.init(json: content.jsonString)
351351
}
352352
}
353353

354-
@available(macOS 26.0, *)
354+
@available(macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0, *)
355355
extension AnyLanguageModel.GeneratedContent {
356356
internal init(_ content: FoundationModels.GeneratedContent) throws {
357357
try self.init(json: content.jsonString)
358358
}
359359
}
360360

361-
@available(macOS 26.0, *)
361+
@available(macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0, *)
362362
extension Tool {
363363
fileprivate func callFunction(arguments: FoundationModels.GeneratedContent) async throws
364364
-> any PromptRepresentable

0 commit comments

Comments
 (0)