Skip to content

Remove samplingMode default from IDL; update comments - #215

Merged
isaacahouma merged 1 commit into
webmachinelearning:mainfrom
michaelwasserman:main
Aug 11, 2026
Merged

isaacahouma merged 1 commit into
webmachinelearning:mainfrom
michaelwasserman:main

Conversation

@michaelwasserman

@michaelwasserman michaelwasserman commented Aug 11, 2026 •

Copy link
Copy Markdown
Collaborator

@isaacahouma
isaacahouma merged commit 7a0a7d7 into webmachinelearning:main Aug 11, 2026
2 checks passed
github-actions Bot added a commit that referenced this pull request Aug 11, 2026
SHA: 7a0a7d7
Reason: push, by isaacahouma

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
isaacahouma pushed a commit to isaacahouma/prompt-api that referenced this pull request Sep 22, 2026
Follow-up to webmachinelearning#206, webmachinelearning#210, and webmachinelearning#215. Those PRs updated the explainer and
added the LanguageModelSamplingMode WebIDL declarations, but left out
the algorithm steps in index.bs.

- Make LanguageModel.samplingMode nullable (LanguageModelSamplingMode?)
  in the IDL to match LanguageModelCreateCoreOptions.samplingMode and
  Chromium's behavior when samplingMode is omitted.
- Throw TypeError in validate and canonicalize language model options
  when both samplingMode and topK/temperature are provided.
- Wire sampling mode into LanguageModel's internal slots, getter,
  creation, prefill, generate, and clone steps alongside top K and
  temperature.

Bug: 561753033
michaelwasserman pushed a commit that referenced this pull request Sep 24, 2026
* Specify samplingMode algorithms and slot in index.bs

Follow-up to #206, #210, and #215. Those PRs updated the explainer and
added the LanguageModelSamplingMode WebIDL declarations, but left out
the algorithm steps in index.bs.

- Make LanguageModel.samplingMode nullable (LanguageModelSamplingMode?)
  in the IDL to match LanguageModelCreateCoreOptions.samplingMode and
  Chromium's behavior when samplingMode is omitted.
- Throw TypeError in validate and canonicalize language model options
  when both samplingMode and topK/temperature are provided.
- Wire sampling mode into LanguageModel's internal slots, getter,
  creation, prefill, generate, and clone steps alongside top K and
  temperature.

Bug: 561753033

* Default samplingMode to balanced unless legacy params are used

* Document null samplingMode when legacy params are used in README.md

---------

Co-authored-by: Isaac Ahouma <iahouma@google.com>
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