Skip to content

refactor!: drop isAvailable in favor of getModelInfo - #370

Merged
grabbou merged 3 commits into
mainfrom
refactor/android-drop-is-available
Nov 1, 2026
Merged

grabbou merged 3 commits into
mainfrom
refactor/android-drop-is-available

Conversation

@grabbou

@grabbou grabbou commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #367.

isAvailable() isn't an AI SDK API, and providers disagree on what it means mid-download: apple's language model says false, ADK says false while downloading but true when downloadable, and Android said true for both. ML Kit also has no synchronous status check, so Android's version answered from a cached status or from whether AICore is installed, which reports true on a Pixel 9 Pro where the Nano 4 preview and en-US speech recognition are unavailable.

I removed isAvailable() from the Android and Apple providers, their language and transcription models, and AppleTranscription, along with Android's status cache and AICore package query. getModelInfo() reports the exact state, which an app needs anyway to show a download or explain why the model is unavailable. Apple's transcription info keeps its isAvailable field. ADK is left alone since #368 removes it.

The example app now checks availability asynchronously through getModelInfo().

Breaking changes

apple.isAvailable(), apple.transcriptionModel().isAvailable() and AppleTranscription.isAvailable() are gone; use getModelInfo(), which rejects with UNSUPPORTED_OS before iOS 26.

Test plan

  • bun test (22 pass), typecheck, lint and the Kotlin compile pass.
  • Not run on a device and the iOS native build wasn't compiled; the harnesses no longer call isAvailable().

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ai Ready Ready Preview Nov 1, 2026 9:17am UTC

Request Review

@grabbou
grabbou added this pull request to stack #371 October 31, 2026 11:38
@grabbou grabbou changed the title refactor(android): drop isAvailable in favor of getModelInfo refactor!: drop isAvailable in favor of getModelInfo Oct 31, 2026
Base automatically changed from feat/android-mlkit-genai to main November 1, 2026 09:17
grabbou and others added 3 commits November 1, 2026 10:17
ML Kit has no synchronous status check, so isAvailable() answered from a
cached status or a guess, and it counted a downloading model as available
where apple and ADK don't. getModelInfo() reports the exact state.

Builds on #367.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t use

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removes isAvailable() from the provider, the transcription model and the
AppleTranscription module, matching the Android provider. getModelInfo()
reports availability and why the model is unavailable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@grabbou
grabbou force-pushed the refactor/android-drop-is-available branch from e4f03c4 to a905da6 Compare November 1, 2026 09:17
@grabbou
grabbou merged commit 3ab1699 into main Nov 1, 2026
9 of 10 checks passed
@grabbou
grabbou deleted the refactor/android-drop-is-available branch November 1, 2026 09:18

This branch was successfully deployed

1 active deployment
Preview — a905da66 Deployed Nov 1, 2026 by vercel[bot]
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.

1 participant