Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ interface LanguageModel : EventTarget {
optional LanguageModelAppendOptions options = {}
);


Promise<double> measureContextUsage(
LanguageModelPrompt input,
optional LanguageModelPromptOptions options = {}
Expand All @@ -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<LanguageModel> 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;
Expand All @@ -104,7 +104,6 @@ interface LanguageModelParams {
readonly attribute float maxTemperature;
};


callback LanguageModelToolFunction = Promise<DOMString> (any... arguments);

// A description of a tool call that a language model can invoke.
Expand All @@ -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<LanguageModelExpected> expectedInputs;
sequence<LanguageModelExpected> expectedOutputs;

// Tools that the language model can use.
// **EXPERIMENTAL**: Only available in experimental contexts.
sequence<LanguageModelTool> tools;
};

Expand Down Expand Up @@ -814,7 +818,6 @@ When prompting fails, the following possible reasons may be surfaced to the web

<p class="note">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.


<div algorithm>
To <dfn>clone a language model</dfn> given a {{LanguageModel}} |model| and a {{LanguageModelCloneOptions}} |options|:

Expand Down
Loading