Adopt Foundation Models OS 27 surfaces: image attachments, capabilities, context size - #206
Open
james-333i wants to merge 1 commit into
Open
Adopt Foundation Models OS 27 surfaces: image attachments, capabilities, context size#206james-333i wants to merge 1 commit into
james-333i wants to merge 1 commit into
Conversation
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.
This updates the Foundation Models adapter for OS 27 while keeping the package building unchanged on Xcode 26.
Image input:
Transcriptimage segments were previously dropped when converting to a FoundationModels transcript. On OS 27 they now map toTranscript.Segment.attachmentwith anImageAttachment, built directly for URL sources and via ImageIO decoding for data sources. Verified end to end on an iPhone running iOS 27 (image prompt answered by the on-device model).Capabilities and context:
SystemLanguageModelnow exposescontextSize(back-deployed by Apple to OS 26) andsupportsImageInput, which reports the OS 27visioncapability and returns false on earlier OS versions.Generation options: the adapter now sets
maximumResponseTokensonFoundationModels.GenerationOptions. The property has existed since OS 26 but was never assigned, so response token limits were silently ignored on the Foundation Models backend. Verified on device: a capped request now terminates at the limit.The OS 27 references are behind
#if compiler(>=6.4)with runtime availability checks, so Xcode 26 builds still compile and the deployment floor is unchanged