Repository navigation
Mark AnyLanguageModel's extensions to Foundation Models - #287
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The README’s compatibility claim is contradictory, and its purportedly exhaustive extension list omits several marked APIs.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Marks AnyLanguageModel-specific APIs and documents differences from Apple’s Foundation Models framework.
Changes:
- Adds compatibility notes to extended public APIs.
- Documents Foundation Models 27-aligned usage and image APIs.
- Adds a README comparison section.
| File | Description |
|---|---|
README.md |
Documents framework differences and extensions. |
Availability.swift |
Marks generic availability as an extension. |
GeneratedContent.swift |
Documents added conformances and errors. |
GenerationGuide.swift |
Marks the public initializer. |
GenerationID.swift |
Documents its added conformance. |
GenerationOptions.swift |
Marks custom provider options. |
LanguageModel.swift |
Documents the provider abstraction. |
LanguageModelFeedback.swift |
Marks public feedback APIs. |
LanguageModelSession.swift |
Documents session, usage, image, and provider APIs. |
Transcript.swift |
Marks image, metadata, and coding extensions. |
AnthropicLanguageModel.swift |
Identifies custom options. |
CoreMLLanguageModel.swift |
Marks provider errors. |
GeminiLanguageModel.swift |
Identifies custom options. |
LlamaLanguageModel.swift |
Documents custom options and errors. |
MLXLanguageModel.swift |
Documents custom options and errors. |
OllamaLanguageModel.swift |
Identifies custom options. |
OpenAILanguageModel.swift |
Documents custom options and errors. |
OpenResponsesLanguageModel.swift |
Documents custom options and errors. |
SystemLanguageModel.swift |
Marks image capability detection. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+548
to
+549
| - `JSONValue`: | ||
| JSON values for provider options such as `extraBody`. |
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 PR marks the public API that goes beyond Foundation Models 26 as AnyLanguageModel extensions, as planned for 1.0 in #210.
Each extension's documentation comment now ends with a note that it's exclusive to AnyLanguageModel, in the wording that
ToolExecutionDelegatealready used. APIs that follow a Foundation Models 27 API on OS 26, such as token usage, say which API they follow. The image input APIs note that they'll change to match Foundation Models 27 prompt attachments in 2.0.The README gets a "Differences from Foundation Models" section that lists the extensions, the behavior differences, and the Foundation Models 26 APIs that AnyLanguageModel doesn't implement yet. The Image Inputs and Tool Calling sections link to it.