Skip to content

Add substantive content for algorithms and definitions#199

Open
michaelwasserman wants to merge 18 commits intowebmachinelearning:mainfrom
michaelwasserman:ga_spec
Open

Add substantive content for algorithms and definitions#199
michaelwasserman wants to merge 18 commits intowebmachinelearning:mainfrom
michaelwasserman:ga_spec

Conversation

@michaelwasserman
Copy link
Copy Markdown
Collaborator

This PR brings a series of refinements to the Prompt API spec, building on draft edits by the spec author. See a preview of changes in from Bikeshed's spec-generator here

Major Changes:

  • Update introduction text using content from README.md
  • Define asynchronous, abortable algorithm for cloning models
  • Add modular helpers for content type availability checks
  • Validate capabilities and options proactively during creation
  • Enforce system message constraints using hasAppendedInput tracking
  • Compute initial context usage from starting messages
  • Standardize constraints measuring for optional model inputs
  • Gracefully normalize empty input arrays with empty strings
  • Split prompt sequences into prefill and generate steps
  • Map operational failures to standard named DOMExceptions

@michaelwasserman michaelwasserman changed the title Add substantive algorithm and definitions Add substantive content for algorithms and definitions Apr 1, 2026
<div algorithm>
The static <dfn method for="LanguageModel">create(|options|)</dfn> method steps are:

1. Return the result of [=creating an AI model object=] given |options|, "language-model", [=validate and canonicalize language model options=], [=compute language model options availability=], [=download the language model=], [=initialize the language model=], [=create a language model object=], and false.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Changing "language-model" -> "{{language-model}}" might link to the permission definition.

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.

3 participants