Adopt Foundation Models OS 27 surfaces: image attachments and capabilities - #241
Merged
Merged
Conversation
…es, context size (cherry picked from commit 052f18f)
`SystemLanguageModel.contextSize` is back-deployed to OS 26.0 but first declared in the 26.4 SDK, so Xcode 26.0 fails to compile the passthrough. It is also unavailable on tvOS and watchOS.
Both are used solely by the OS 27 `ImageAttachment` extension, so they belong inside its compiler gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carries @james-333i's commit from #206 on top of
main, with authorship preserved.On OS 27,
Transcriptimage segments now map toTranscript.Segment.attachmentwith anImageAttachment, built directly for file URLs and via ImageIO decoding for data sources.SystemLanguageModelexposescontextSizeandsupportsImageInput, which reports the OS 27visioncapability and returnsfalseon earlier OS versions. The OS 27 references are behind#if compiler(>=6.4)with runtime availability checks, so the deployment floor is unchanged. James verified the image path end to end on an iPhone running iOS 27.Two changes from #206:
maximumResponseTokenscommit is dropped. Forward all generation options to FoundationModels #230 already forwards every generation option.contextSizeis declared only on toolchains whose SDK has it. The property is back-deployed to OS 26.0 but first appears in the 26.4 SDK, and it is unavailable on tvOS and watchOS. That is why Adopt Foundation Models OS 27 surfaces: image attachments, capabilities, context size #206's Xcode 26.0 CI jobs failed.Closes #206.