Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul availability testing and add expected input languages #69

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

domenic
Copy link
Collaborator

@domenic domenic commented Dec 11, 2024

Remove the ai.languageModel.capabilities() method and its accompanying AILanguageModelCapabilities class. Instead, replace it with:

  • ai.languageModel.availability(options), which takes the same options as ai.languageModel.create(), and returns the corresponding availability.
  • ai.languageModel.params(), which returns the default and max params (currently top-K and temperature).

Additionally, add the expectedInputLanguages option to create() and availability(). The addition of this option to create() allows the web developer to signal the expected input languages ahead of time, allowing the downloading of additional material, or fast-failing if the additional material cannot be supported. The addition of this option to availability() replaces the (await ai.languageModel.capabilities()).languageAvailable() method.

Closes #29; see especially #29 (comment).

See also webmachinelearning/writing-assistance-apis#22 and webmachinelearning/translation-api#31.

Instead, we replace it with createOptionsAvailable() and params()
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.

Clarification on supportsLanguage API
2 participants