From eb417b333a6232a102b9a93b94a39e87de99084d Mon Sep 17 00:00:00 2001 From: Mike Wasserman Date: Tue, 11 Aug 2026 11:07:30 -0700 Subject: [PATCH] Remove samplingMode default from IDL; update comments --- index.bs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/index.bs b/index.bs index ad015c7..00abf4d 100644 --- a/index.bs +++ b/index.bs @@ -63,7 +63,6 @@ interface LanguageModel : EventTarget { optional LanguageModelAppendOptions options = {} ); - Promise measureContextUsage( LanguageModelPrompt input, optional LanguageModelPromptOptions options = {} @@ -84,18 +83,19 @@ interface LanguageModel : EventTarget { // **DEPRECATED**: This attribute is only available in extension contexts. attribute EventHandler onquotaoverflow; - // **EXPERIMENTAL**: Only available in extension and experimental contexts. + // **DEPRECATED**: This attribute is only available in extension contexts. readonly attribute unsigned long topK; - // **EXPERIMENTAL**: Only available in extension and experimental contexts. + // **DEPRECATED**: This attribute is only available in extension contexts. readonly attribute float temperature; + // **EXPERIMENTAL**: Only available in experimental contexts. readonly attribute LanguageModelSamplingMode samplingMode; Promise clone(optional LanguageModelCloneOptions options = {}); }; LanguageModel includes DestroyableModel; -// **EXPERIMENTAL**: Only available in extension and experimental contexts. +// **DEPRECATED**: Only available in extension contexts. [Exposed=Window, SecureContext] interface LanguageModelParams { readonly attribute unsigned long defaultTopK; @@ -104,7 +104,6 @@ interface LanguageModelParams { readonly attribute float maxTemperature; }; - callback LanguageModelToolFunction = Promise (any... arguments); // A description of a tool call that a language model can invoke. @@ -120,15 +119,20 @@ dictionary LanguageModelTool { dictionary LanguageModelCreateCoreOptions { // Note: these two have custom out-of-range handling behavior, not in the IDL layer. // They are unrestricted double so as to allow +Infinity without failing. - // **EXPERIMENTAL**: Only available in extension and experimental contexts. + // **DEPRECATED**: Only available in extension contexts. unrestricted double topK; - // **EXPERIMENTAL**: Only available in extension and experimental contexts. + // **DEPRECATED**: Only available in extension contexts. unrestricted double temperature; - LanguageModelSamplingMode samplingMode = "default"; + // **EXPERIMENTAL**: Only available in experimental contexts. + LanguageModelSamplingMode samplingMode; + // The expected types and languages for the session. sequence expectedInputs; sequence expectedOutputs; + + // Tools that the language model can use. + // **EXPERIMENTAL**: Only available in experimental contexts. sequence tools; }; @@ -814,7 +818,6 @@ When prompting fails, the following possible reasons may be surfaced to the web

This table does not give the complete list of exceptions that can be surfaced by the prompt API. It only contains those which can come from certain [=implementation-defined=] steps. -

To clone a language model given a {{LanguageModel}} |model| and a {{LanguageModelCloneOptions}} |options|: