Skip to content

Mark AnyLanguageModel's extensions to Foundation Models - #287

Merged
mattt merged 11 commits into
mainfrom
mattt/mark-extensions
Oct 3, 2026
Merged

mattt merged 11 commits into
mainfrom
mattt/mark-extensions

Conversation

@mattt

@mattt mattt commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

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 ToolExecutionDelegate already 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.

@mattt
mattt requested a balanced review from Copilot October 2, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Low severity

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 thread README.md Outdated
Comment thread README.md Outdated
@mattt
mattt requested a balanced review from Copilot October 2, 2026 15:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The documented extension list includes JSONValue, but its API documentation still lacks the promised compatibility note.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (2)

Comment thread README.md
Comment on lines +548 to +549
- `JSONValue`:
JSON values for provider options such as `extraBody`.
@mattt
mattt requested a balanced review from Copilot October 2, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The documentation changes consistently describe the implemented compatibility boundaries without altering runtime behavior.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

@mattt
mattt merged commit 51cfe49 into main Oct 3, 2026
8 checks passed
@mattt
mattt deleted the mattt/mark-extensions branch October 3, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants