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
24 changes: 4 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ dictionary LanguageModelCreateOptions : LanguageModelCreateCoreOptions {
AbortSignal signal;
AICreateMonitorCallback monitor;

LanguageModelInitialPrompts initialPrompts;
sequence<LanguageModelMessage> initialPrompts;
};

dictionary LanguageModelPromptOptions {
Expand All @@ -769,32 +769,16 @@ dictionary LanguageModelExpected {
// The argument to the prompt() method and others like it

typedef (
// Canonical format
sequence<LanguageModelMessage>
// Shorthand per the below comment
or sequence<LanguageModelMessageShorthand>
// Shorthand for [{ role: "user", content: [{ type: "text", value: providedValue }] }]
// Shorthand for `[{ role: "user", content: [{ type: "text", value: providedValue }] }]`
or DOMString
) LanguageModelPrompt;

// The initialPrompts value omits the single string shorthand
typedef (
// Canonical format
sequence<LanguageModelMessage>
// Shorthand per the below comment
or sequence<LanguageModelMessageShorthand>
) LanguageModelInitialPrompts;


dictionary LanguageModelMessage {
required LanguageModelMessageRole role;
required sequence<LanguageModelMessageContent> content;
};

// Shorthand for { role: providedValue.role, content: [{ type: "text", value: providedValue.content }] }
dictionary LanguageModelMessageShorthand {
required LanguageModelMessageRole role;
required DOMString content;
// The DOMString branch is shorthand for `[{ type: "text", value: providedValue }]`
required (DOMString or sequence<LanguageModelMessageContent>) content;
};

dictionary LanguageModelMessageContent {
Expand Down