[PromptAPI] Tool use IDL changes (v2 - no execution of tool by blink) [chromium/src : main]

0 views
Skip to first unread message

Frank Li (Gerrit)

unread,
Oct 29, 2025, 3:48:45 AMOct 29
to AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org

Frank Li added 1 comment

Commit Message
Line 10, Patchset 1:an agentic loop involving the JS App to recieve ToolCalls, execute
Frank Li . resolved

Please fix this WARNING reported by Spellchecker: "recieve" is a possible misspelling of "receive".

To bypass Spellchecker, add a...

"recieve" is a possible misspelling of "receive".

To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
Gerrit-Change-Number: 7092943
Gerrit-PatchSet: 7
Gerrit-Owner: Frank Li <fra...@microsoft.com>
Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Comment-Date: Wed, 29 Oct 2025 07:48:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Frank Li (Gerrit)

unread,
Oct 29, 2025, 2:02:13 PMOct 29
to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

Frank Li added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Frank Li . resolved

This IDL changes ('Tool use' v2) is ready for the review.

Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Jingyun Liu
  • Mike Wasserman
  • Sushanth Rajasankar
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
Gerrit-Change-Number: 7092943
Gerrit-PatchSet: 9
Gerrit-Owner: Frank Li <fra...@microsoft.com>
Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
Gerrit-Reviewer: Mike Wasserman <m...@google.com>
Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Etienne Noël <etien...@chromium.org>
Gerrit-CC: Kenji Baheux <kenji...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Mike Wasserman <m...@google.com>
Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
Gerrit-Attention: Jingyun Liu <jin...@google.com>
Gerrit-Comment-Date: Wed, 29 Oct 2025 18:02:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Frank Li (Gerrit)

unread,
Oct 29, 2025, 2:54:34 PMOct 29
to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

Frank Li added 1 comment

File third_party/blink/renderer/modules/ai/language_model.idl
Line 54, Patchset 9 (Latest): // When this object was created with LanguageModelToolDeclaration, this now
Frank Li . unresolved

and expectedOutputs has {"tool-call"}.

Same for the comment in promptStreaming().

Open in Gerrit

Related details

Attention is currently required from:
  • Jingyun Liu
  • Mike Wasserman
  • Sushanth Rajasankar
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
    Gerrit-Change-Number: 7092943
    Gerrit-PatchSet: 9
    Gerrit-Owner: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
    Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
    Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
    Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Etienne Noël <etien...@chromium.org>
    Gerrit-CC: Kenji Baheux <kenji...@google.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Mike Wasserman <m...@chromium.org>
    Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
    Gerrit-Attention: Jingyun Liu <jin...@google.com>
    Gerrit-Comment-Date: Wed, 29 Oct 2025 18:54:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jingyun Liu (Gerrit)

    unread,
    Oct 29, 2025, 6:54:34 PMOct 29
    to Frank Li, Mike Wasserman, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Frank Li, Mike Wasserman and Sushanth Rajasankar

    Jingyun Liu added 3 comments

    Patchset-level comments
    Jingyun Liu . resolved

    Thanks for the quick turnaround!

    File third_party/blink/renderer/modules/ai/language_model.idl
    Line 56, Patchset 9 (Latest): Promise<LanguageModelPromptResult> prompt(
    Jingyun Liu . unresolved

    when we change the return type from DOMString to PromptResult, will we break backward compatibility for existing users?

    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Line 75, Patchset 9 (Latest):typedef (LanguageModelToolSuccess or LanguageModelToolError) LanguageModelToolResponse;
    Jingyun Liu . unresolved

    are we also expecting to let model handle tool error (vs. application handles error)?

    Also in the current structure, LanguageModelMessageContent contains a
    LanguageModelMessageValue which can be a LanguageModelToolResponse which can contain LanguageModelMessageContent again...

    I'm thinking if we can just use a single struct for {string callID, string name, object result} as the LanguageModelToolResponse, and if we want model to handle it, developer can put error info in the "result" field.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Frank Li
    • Mike Wasserman
    • Sushanth Rajasankar
    Gerrit-Attention: Frank Li <fra...@microsoft.com>
    Gerrit-Comment-Date: Wed, 29 Oct 2025 22:54:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jingyun Liu (Gerrit)

    unread,
    Oct 29, 2025, 6:56:14 PMOct 29
    to Frank Li, Mike Wasserman, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Frank Li, Mike Wasserman and Sushanth Rajasankar

    Jingyun Liu added 1 comment

    File third_party/blink/renderer/modules/ai/language_model.idl
    Line 56, Patchset 9 (Latest): Promise<LanguageModelPromptResult> prompt(
    Jingyun Liu . resolved

    when we change the return type from DOMString to PromptResult, will we break backward compatibility for existing users?

    Jingyun Liu

    Oops, nevermind, I just found the def for LanguageModelPromptResult in the other IDL.

    Gerrit-Comment-Date: Wed, 29 Oct 2025 22:55:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Jingyun Liu <jin...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Frank Li (Gerrit)

    unread,
    Oct 29, 2025, 7:50:01 PMOct 29
    to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

    Frank Li added 1 comment

    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Line 75, Patchset 9 (Latest):typedef (LanguageModelToolSuccess or LanguageModelToolError) LanguageModelToolResponse;
    Jingyun Liu . unresolved

    are we also expecting to let model handle tool error (vs. application handles error)?

    Also in the current structure, LanguageModelMessageContent contains a
    LanguageModelMessageValue which can be a LanguageModelToolResponse which can contain LanguageModelMessageContent again...

    I'm thinking if we can just use a single struct for {string callID, string name, object result} as the LanguageModelToolResponse, and if we want model to handle it, developer can put error info in the "result" field.

    Frank Li

    Thanks for your comments and discussions.

    (1) Tool Error Handling
    Yes, we're expecting the application to handle tool errors and communicate them back to the model. The flow is:

    // Model requests tool → App executes → App reports result (success or error) -> Model reacts

    ~~~
    const response = await session.prompt([
    { role: "user", content: "What's the weather in SF?" },
    { role: "assistant", content: [
    { type: "tool-call", value: { callID: "1", name: "getWeather", arguments: {city: "SF"} }}
    ]},
    { role: "user", content: [
    { type: "tool-response", value: {
    callID: "1",
    name: "getWeather",
    errorMessage: "API rate limit exceeded" // App reports error.
    }}
    ]}
    ]);
    // Model can now see the error and react (e.g., ask user to try later)
    ~~~

    Both the app and model have knowledge of the error - the app decides how to report it, and the model can react accordingly (e.g., suggest alternatives, explain to user, etc.).

    (2) LanguageModelMessageContent Recursion

    You're right - we should create a non-recursive type for tool results.
    'object result' is something I would like to avoid because it is not
    structured.

    I would like to make the IDL change as:

    ~~~
    // Data-only value (no tools)
    typedef (
    ImageBitmapSource
    or AudioBuffer
    or HTMLAudioElement
    or BufferSource
    or DOMString
    ) LanguageModelDataValue;

    // Data-only type enum
    enum LanguageModelDataType { "text", "image", "audio" };

    // Data-only content (no tool-call, no tool-response)
    dictionary LanguageModelDataContent {
    required LanguageModelDataType type;
    required LanguageModelDataValue value;
    };
    // Successful tool execution result.
    dictionary LanguageModelToolSuccess {
    required DOMString callID;
    required DOMString name;
    required LanguageModelDataContent result;
    };
    // Failed tool execution result.
    dictionary LanguageModelToolError {
    required DOMString callID;
    required DOMString name;
    required DOMString errorMessage;
    };

    // The response from executing a tool call - either success or error.


    typedef (LanguageModelToolSuccess or LanguageModelToolError) LanguageModelToolResponse;

    ~~~

    JS App example of usage for just 1 Tool Call:

    ~~~
    const response = await session.prompt([
    { role: "user", content: "What's the weather in Paris?" },

    // Model makes tool call
    { role: "assistant", content: [
    { type: "tool-call", value: {
    callID: "call_1",
    name: "getWeather",
    arguments: {city: "Paris"}
    }}
    ]},

    // App returns tool result
    { role: "user", content: [
    { type: "tool-response", value: {
    callID: "call_1",
    name: "getWeather",
    result: {
    type: "text",
    value: "Sunny, 22°C"
    }
    }}
    ]}
    ]);
    ~~~
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jingyun Liu
    • Mike Wasserman
    • Sushanth Rajasankar
    Gerrit-Attention: Jingyun Liu <jin...@google.com>
    Gerrit-Comment-Date: Wed, 29 Oct 2025 23:49:47 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jingyun Liu (Gerrit)

    unread,
    Oct 29, 2025, 7:59:29 PMOct 29
    to Frank Li, Mike Wasserman, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Frank Li, Mike Wasserman and Sushanth Rajasankar

    Jingyun Liu added 1 comment

    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Jingyun Liu

    I actually feel "object" is like a base::Value in c++, it can have arbitrary structure is still a json.

    With LanguageModelData[Content|Type], how would we represent a map/dict? e.g, {"SFO": "22C", "LAX": false} is it always serialized to text? Also, our formatter works with a structured object (base::Value) below the chrome_ml_api layer.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Frank Li
    • Mike Wasserman
    • Sushanth Rajasankar
    Gerrit-Attention: Frank Li <fra...@microsoft.com>
    Gerrit-Comment-Date: Wed, 29 Oct 2025 23:59:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Frank Li <fra...@microsoft.com>
    Comment-In-Reply-To: Jingyun Liu <jin...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Frank Li (Gerrit)

    unread,
    Oct 29, 2025, 9:09:36 PMOct 29
    to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

    Frank Li added 1 comment

    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Frank Li

    JS APP will have to stringify it which is the Tool use v1 spec.
    I would think C++ base::Value cannot be used for "audio" or "image" - the multimodal tool result we would like to address.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jingyun Liu
    • Mike Wasserman
    • Sushanth Rajasankar
    Gerrit-Attention: Jingyun Liu <jin...@google.com>
    Gerrit-Comment-Date: Thu, 30 Oct 2025 01:09:26 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jingyun Liu (Gerrit)

    unread,
    Oct 30, 2025, 12:11:07 PMOct 30
    to Frank Li, Mike Wasserman, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Frank Li, Mike Wasserman and Sushanth Rajasankar

    Jingyun Liu added 1 comment

    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Jingyun Liu

    So when client pass a text string as tool result, we still require it to be serializable to a json object, and we throw error if it doesn't, correct?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Frank Li
    • Mike Wasserman
    • Sushanth Rajasankar
    Gerrit-Attention: Frank Li <fra...@microsoft.com>
    Gerrit-Comment-Date: Thu, 30 Oct 2025 16:10:57 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jingyun Liu (Gerrit)

    unread,
    Oct 30, 2025, 12:16:14 PMOct 30
    to Frank Li, Mike Wasserman, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Jingyun Liu

    And if client pass multimodal tool reuslt, I suppose we will check that the session is created with the correct "expectedInput" as well?

    Do you have any use case for multimodal tool results? I don't think server side APIs support multimodal tool results either.

    Gerrit-Comment-Date: Thu, 30 Oct 2025 16:16:04 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Frank Li (Gerrit)

    unread,
    Oct 30, 2025, 1:30:33 PMOct 30
    to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

    Frank Li added 1 comment

    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Frank Li

    It could be just plain text or a serialized JSON string. We do not need to enforce it.

    >...Do you have any use case for multimodal tool results?...

    It is somewhat similar to [multimodal input sample](https://github.com/webmachinelearning/prompt-api?tab=readme-ov-file#multimodal-inputs).

    [Add multimodal tool outputs #149](https://github.com/webmachinelearning/prompt-api/pull/149) has discussions in commit on getting a video frame with a ToolCall.

    >...don't think server side APIs support multimodal tool results ...

    Yes, plain text is expected at the moment.
    [Tool calling: return types? #138](https://github.com/webmachinelearning/prompt-api/issues/138) discussed about multimodal tool results.

    >...the correct "expectedInput" as well...
    I think so.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jingyun Liu
    • Mike Wasserman
    • Sushanth Rajasankar
    Gerrit-Attention: Jingyun Liu <jin...@google.com>
    Gerrit-Comment-Date: Thu, 30 Oct 2025 17:30:24 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jingyun Liu (Gerrit)

    unread,
    Oct 30, 2025, 5:33:25 PMOct 30
    to Frank Li, Mike Wasserman, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Frank Li, Mike Wasserman and Sushanth Rajasankar

    Jingyun Liu added 1 comment

    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Jingyun Liu

    Thank you for the pointers on those issues! Now I see why we need the {type - value} pair for multimodal tool results.

    Then my only question left is the "DOMString" type of text tool result - Our formatter inside chrome_ml_api expects a structured object like base::Value to do various formatting and escaping. If we go with string in the signature, shall we try to de-serialize it into a json (base::Value) in the renderer?
    An alternative would be to also include "object" in LanguageModelDataValue, and then we don't do any special processing to the string. it will be treated by the formatter as a base::Value with type string.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Frank Li
    • Mike Wasserman
    • Sushanth Rajasankar
    Gerrit-Attention: Frank Li <fra...@microsoft.com>
    Gerrit-Comment-Date: Thu, 30 Oct 2025 21:33:13 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mike Wasserman (Gerrit)

    unread,
    Oct 30, 2025, 5:45:51 PMOct 30
    to Frank Li, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Frank Li and Sushanth Rajasankar

    Mike Wasserman added 2 comments

    File chrome/browser/ai/ai_manager.cc
    Line 252, Patchset 9 (Latest): // TODO(crbugs.com/422803232): Implement tool capabilities.
    Mike Wasserman . unresolved
    ```suggestion
    // TODO(crbug.com/422803232): Implement tool capabilities.
    ```
    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Mike Wasserman

    I have similar questions:
    1) Should we add an `object` LanguageModelDataType and let tools yield serializable JS objects (like `inputSchema` itself), as a model-agnostic structured format, instead of forcing tools to serialize those objects into JSON strings themselves?
    2) Should tools be able to yield a sequence of LanguageModelDataContent, so they can return mixed modalities?
    3) Is there a real advantage of coercing errors into a named `errorMessage` string field on a dedicated error type, versus a shared LanguageModelToolResponse being constructed with `result: 'Error: 'API rate limit exceeded'`, or possibly also passing structured objects errors if we permit objects in (1)? Does the API itself need to provide this distinction to the model, or for session history?

    i.e. What if we had:
    ```

    // Data-only value (no tools)
    typedef (
    ImageBitmapSource
    or AudioBuffer
    or HTMLAudioElement
    or BufferSource
    or DOMString
      or object
    ) LanguageModelDataValue;

    // Data-only type enum
    enum LanguageModelDataType { "text", "image", "audio", "object" };

    // Data-only content (no tool-call, no tool-response)
    dictionary LanguageModelDataContent {
    required LanguageModelDataType type;
    required LanguageModelDataValue value;
    };
    // Tool execution response; expresses a result or an error to the model.
    dictionary LanguageModelToolResponse {

    required DOMString callID;
    required DOMString name;
      required sequence<LanguageModelDataContent> resultOrError;
    };
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Frank Li
    • Sushanth Rajasankar
    Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
    Gerrit-Attention: Frank Li <fra...@microsoft.com>
    Gerrit-Comment-Date: Thu, 30 Oct 2025 21:45:41 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Frank Li (Gerrit)

    unread,
    Oct 30, 2025, 6:38:39 PMOct 30
    to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Sushanth Rajasankar

    Frank Li added 2 comments

    File third_party/blink/renderer/modules/ai/language_model_prompt_builder.cc
    Line 453, Patchset 9 (Latest): // TODO(crbugs.com/422803232): Implement tool call handling.
    Frank Li . unresolved
    Line 468, Patchset 9 (Latest): // TODO(crbugs.com/422803232): Implement tool response handling.
    Frank Li . unresolved
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sushanth Rajasankar
    Gerrit-Comment-Date: Thu, 30 Oct 2025 22:38:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Frank Li (Gerrit)

    unread,
    Oct 31, 2025, 3:04:30 PMOct 31
    to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

    Frank Li added 1 comment

    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Frank Li

    Thank all for the thoughtful discussions here.

    Hi Jingyun,
    > ... include "object" in LanguageModelDataValue...

    yes, we can use object.

    ...Our formatter inside chrome_ml_api expects a structured object like base::Value...

    I investigated the current architecture. In chrome_ml_types.h, we have:
    ```
    using InputPiece =
    std::variant<Token, std::string, SkBitmap, AudioBuffer, bool>;
    ```
    I am not sure something about `base::Value` input to chrome_ml_api Imp.
    Anyway, I plan to add a new ToolResponse variant to InputPiece. This will preserve the tool response structure all the way to the ML API implementation layer, where each implementation (Chrome ML API, Edge ML API, etc.) can format it appropriately for their underlying models.


    Hi Mike,
    >...1) Should we add an object LanguageModelDataType...

    Yes, will do.

    >...2) Should tools be able to yield a sequence of LanguageModelDataContent, ...

    Yes, agreed. This provides flexibility for multi-modal tool results in the
    future.

    >...3) Is there a real advantage of coercing errors into a named errorMessage string field on a dedicated error type, versus a shared LanguageModelToolResponse...


    Thank you for the thoughtful question! I believe separate ToolSuccess/ToolError types provide meaningful advantages:

    (a) Type Safety & Developer Experience: Both approaches work for JS apps, but separate types enable automatic type discrimination ('errorMessage' in response) without requiring developers to inspect content or parse for status fields.

    (b) Debugging & Transparency: Explicit LanguageModelToolError makes the error condition immediately visible in logs, DevTools, and debuggers. With merged types, we'd need heuristics to determine if content represents an error.

    (c) Web Platform Consistency: This pattern aligns with established Web APIs (e.g., FileReader: onload vs. onerror, Promise: .then() vs. .catch(), Fetch: Response vs. network errors) and C++ conventions.

    (d) ML API Implementation Flexibility: The discriminated type allows ML API implementations to apply different prompt formatting strategies (e.g., "Tool succeeded: {...}" vs. "Tool FAILED: ..."), which may improve model understanding of tool execution status.

    I'm happy to proceed with separate types unless there are other considerations I haven't addressed. Let me know your thoughts!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jingyun Liu
    • Mike Wasserman
    • Sushanth Rajasankar
    Gerrit-Attention: Mike Wasserman <m...@chromium.org>
    Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
    Gerrit-Attention: Jingyun Liu <jin...@google.com>
    Gerrit-Comment-Date: Fri, 31 Oct 2025 19:04:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mike Wasserman <m...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Frank Li (Gerrit)

    unread,
    Oct 31, 2025, 4:29:19 PMOct 31
    to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

    Frank Li added 5 comments

    File chrome/browser/ai/ai_manager.cc
    Line 252, Patchset 9: // TODO(crbugs.com/422803232): Implement tool capabilities.
    Mike Wasserman . resolved
    ```suggestion
    // TODO(crbug.com/422803232): Implement tool capabilities.
    ```
    Frank Li

    Done

    File third_party/blink/renderer/modules/ai/language_model.idl
    Line 54, Patchset 9: // When this object was created with LanguageModelToolDeclaration, this now
    Frank Li . resolved

    and expectedOutputs has {"tool-call"}.

    Same for the comment in promptStreaming().

    Frank Li

    Done

    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
    Line 75, Patchset 9:typedef (LanguageModelToolSuccess or LanguageModelToolError) LanguageModelToolResponse;
    Jingyun Liu . resolved
    Frank Li

    PTAL with PS 10. Thanks!

    File third_party/blink/renderer/modules/ai/language_model_prompt_builder.cc
    Line 453, Patchset 9: // TODO(crbugs.com/422803232): Implement tool call handling.
    Frank Li . resolved

    crbugs.com

    Frank Li

    Done

    Line 468, Patchset 9: // TODO(crbugs.com/422803232): Implement tool response handling.
    Frank Li . resolved

    crbugs.com

    Frank Li

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jingyun Liu
    • Mike Wasserman
    • Sushanth Rajasankar
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
      Gerrit-Change-Number: 7092943
      Gerrit-PatchSet: 10
      Gerrit-Owner: Frank Li <fra...@microsoft.com>
      Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
      Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
      Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
      Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Etienne Noël <etien...@chromium.org>
      Gerrit-CC: Kenji Baheux <kenji...@google.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Mike Wasserman <m...@chromium.org>
      Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
      Gerrit-Attention: Jingyun Liu <jin...@google.com>
      Gerrit-Comment-Date: Fri, 31 Oct 2025 20:29:09 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Jingyun Liu (Gerrit)

      unread,
      Nov 3, 2025, 12:34:51 PMNov 3
      to Frank Li, Mike Wasserman, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
      Attention needed from Frank Li, Mike Wasserman and Sushanth Rajasankar

      Jingyun Liu added 1 comment

      File third_party/blink/renderer/modules/ai/language_model_create_options.idl
      Line 75, Patchset 9:typedef (LanguageModelToolSuccess or LanguageModelToolError) LanguageModelToolResponse;
      Jingyun Liu . unresolved
      Jingyun Liu

      Thanks Frank!

      It turns out my understanding of javascript is shallow. After discussing with @rei...@chromium.org, I learned that we would need `any` instead of `object` to represent a union of [string, number, boolean, dict, array], basically anything that's serializable to a json.

      So how about:
      ```
      // Data-only type enum. "object" represents the union of a serializable json.
      enum LanguageModelDataType { "image", "audio", "object" };

      dictionary LanguageModelDataContent {
      required LanguageModelDataType type;
        required any value;
      };
      ```

      and we can convert the `any` (`blink::ScriptValue`) into `base::Value` using `content::V8ValueConverter`


      --------


      > I am not sure something about base::Value input to chrome_ml_api Imp.

      Do you mean you will only add a generic ToolResponse struct without member types into InputPiece? But then how can opt guide construct the InputPiece without the specific type? I was thinking smth like
      ```
      struct ToolResponse {string name; string id; base::Value results; (and an optional member for error) }

      InputPiece = std::variant<Token, std::string, SkBitmap, AudioBuffer, bool, ToolDeclaration, ToolCall, ToolResponse>;
      ```

      please let me know if you're thinking smth different!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Frank Li
      • Mike Wasserman
      • Sushanth Rajasankar
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
        Gerrit-Change-Number: 7092943
        Gerrit-PatchSet: 10
        Gerrit-Owner: Frank Li <fra...@microsoft.com>
        Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
        Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
        Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
        Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Etienne Noël <etien...@chromium.org>
        Gerrit-CC: Kenji Baheux <kenji...@google.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Mike Wasserman <m...@chromium.org>
        Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
        Gerrit-Attention: Frank Li <fra...@microsoft.com>
        Gerrit-Comment-Date: Mon, 03 Nov 2025 17:34:42 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Frank Li (Gerrit)

        unread,
        Nov 3, 2025, 3:18:11 PMNov 3
        to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
        Attention needed from Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

        Frank Li added 1 comment

        File third_party/blink/renderer/modules/ai/language_model_create_options.idl
        Line 75, Patchset 9:typedef (LanguageModelToolSuccess or LanguageModelToolError) LanguageModelToolResponse;
        Jingyun Liu . resolved
        Frank Li

        Ah. Thank you all for the insight.

        >...represent a union of [string, number, boolean, dict, array], basically anything that's serializable to a json....

        I have updated to allow primitive data types in addition to object (including
        array) as you listed above.
        - 'any' would accept null, undefined, functions, DOM objects (all non-serializable).
        - Continue to keep LanguageModelDataValue in LanguageModelDataContent so as
        to allow multimodal results discussed.


        >...struct ToolResponse {string name; string id;...

        yes. I meant the same to have them defined in on_device_model.mojom.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Jingyun Liu
        • Mike Wasserman
        • Sushanth Rajasankar
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
          Gerrit-Change-Number: 7092943
          Gerrit-PatchSet: 11
          Gerrit-Owner: Frank Li <fra...@microsoft.com>
          Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
          Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
          Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
          Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: Etienne Noël <etien...@chromium.org>
          Gerrit-CC: Kenji Baheux <kenji...@google.com>
          Gerrit-CC: Kentaro Hara <har...@chromium.org>
          Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
          Gerrit-Attention: Mike Wasserman <m...@chromium.org>
          Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
          Gerrit-Attention: Jingyun Liu <jin...@google.com>
          Gerrit-Comment-Date: Mon, 03 Nov 2025 20:18:03 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Frank Li (Gerrit)

          unread,
          Nov 3, 2025, 7:30:39 PMNov 3
          to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
          File third_party/blink/renderer/modules/ai/language_model_create_options.idl
          Frank Li

          use 'any' in LanguageModelDataContent per offline meeting. we will use the type to perform validation in the Blink layer code.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jingyun Liu
          • Mike Wasserman
          • Sushanth Rajasankar
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
          Gerrit-Change-Number: 7092943
          Gerrit-PatchSet: 12
          Gerrit-Owner: Frank Li <fra...@microsoft.com>
          Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
          Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
          Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
          Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: Etienne Noël <etien...@chromium.org>
          Gerrit-CC: Kenji Baheux <kenji...@google.com>
          Gerrit-CC: Kentaro Hara <har...@chromium.org>
          Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
          Gerrit-Attention: Mike Wasserman <m...@chromium.org>
          Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
          Gerrit-Attention: Jingyun Liu <jin...@google.com>
          Gerrit-Comment-Date: Tue, 04 Nov 2025 00:30:30 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Jingyun Liu (Gerrit)

          unread,
          Nov 5, 2025, 6:31:08 PMNov 5
          to Frank Li, Mike Wasserman, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
          Attention needed from Frank Li, Mike Wasserman and Sushanth Rajasankar

          Jingyun Liu added 1 comment

          Patchset-level comments
          File-level comment, Patchset 12 (Latest):
          Jingyun Liu . resolved

          Thank you! LGTM (couldn't the +1 button on the UI)

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Frank Li
          • Mike Wasserman
          • Sushanth Rajasankar
          Gerrit-Attention: Frank Li <fra...@microsoft.com>
          Gerrit-Comment-Date: Wed, 05 Nov 2025 23:30:59 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Frank Li (Gerrit)

          unread,
          Nov 5, 2025, 6:35:07 PMNov 5
          to Mike Wasserman, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
          Attention needed from Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

          Frank Li added 1 comment

          Patchset-level comments
          Jingyun Liu . resolved

          Thank you! LGTM (couldn't the +1 button on the UI)

          Frank Li

          Thank you for the review!
          @m...@chromium.org, I will need your approval.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jingyun Liu
          • Mike Wasserman
          • Sushanth Rajasankar
          Gerrit-Attention: Jingyun Liu <jin...@google.com>
          Gerrit-Comment-Date: Wed, 05 Nov 2025 23:34:56 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Jingyun Liu <jin...@google.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Mike Wasserman (Gerrit)

          unread,
          Nov 5, 2025, 7:19:20 PMNov 5
          to Frank Li, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
          Attention needed from Frank Li, Jingyun Liu and Sushanth Rajasankar

          Mike Wasserman voted and added 9 comments

          Votes added by Mike Wasserman

          Code-Review+1

          9 comments

          Patchset-level comments
          Mike Wasserman . resolved

          lgtm with minor comments, thank you for this work!

          Commit Message
          Line 20, Patchset 12 (Latest):JavaScript apps now receive tool calls as structured messages, execute
          Mike Wasserman . unresolved

          nit: note the new runtime enabled feature

          File third_party/blink/renderer/modules/ai/language_model.idl
          Line 55, Patchset 12 (Latest): // expectedOutputs has {"tool-call"}, this now yields a
          Mike Wasserman . unresolved
          nit: (ditto below)
          ```suggestion
          // expectedOutputs includes {type:"tool-call"}, this now yields a
          ```
          File third_party/blink/renderer/modules/ai/language_model_create_client.cc
          Line 118, Patchset 12 (Latest): if (options_->hasExpectedOutputs()) {
          Mike Wasserman . unresolved

          optional nit: reject when input/outputs has tool types without the runtime feature enabled

          File third_party/blink/renderer/modules/ai/language_model_create_options.idl
          Line 58, Patchset 12 (Latest):// Data-only content (for tool results - no tool-call or tool-response).
          Mike Wasserman . unresolved

          Please clarify this, e.g. explicitly noting `Data-only type for LanguageModelToolSuccess result.`; maybe renaming to `LanguageModelToolResult` would help?

          Line 72, Patchset 12 (Latest): // Object fitting the JSON input schema of this tool call.
          Mike Wasserman . unresolved
          ```suggestion
          // Object fitting the JSON input schema of the tool's declaration.
          ```
          Line 94, Patchset 12 (Latest):dictionary LanguageModelToolDeclaration {
          Mike Wasserman . unresolved

          +CC'ing script_tools folks. FYI: I think it's okay to prototype with this separate dictionary roughly aligned with ToolRegistrationParams for now, please feel free to comment.

          File third_party/blink/renderer/platform/runtime_enabled_features.json5
          Line 396, Patchset 12 (Latest): name: "AIPromptAPIToolUse",
          Mike Wasserman . unresolved

          Do you think it makes sense to stand up some very basic WPTs at this point?

          Line 400, Patchset 12 (Latest): "Linux": "experimental",
          Mike Wasserman . unresolved

          nit: add `"ChromeOS": "experimental",` to align with other PromptAPI feature platforms

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Frank Li
          • Jingyun Liu
          • Sushanth Rajasankar
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
            Gerrit-Change-Number: 7092943
            Gerrit-PatchSet: 12
            Gerrit-Owner: Frank Li <fra...@microsoft.com>
            Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
            Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
            Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
            Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
            Gerrit-CC: Brandon Walderman <brwa...@microsoft.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
            Gerrit-CC: David Bokan <bo...@chromium.org>
            Gerrit-CC: Etienne Noël <etien...@chromium.org>
            Gerrit-CC: Kenji Baheux <kenji...@google.com>
            Gerrit-CC: Kentaro Hara <har...@chromium.org>
            Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
            Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
            Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
            Gerrit-Attention: Frank Li <fra...@microsoft.com>
            Gerrit-Attention: Jingyun Liu <jin...@google.com>
            Gerrit-Comment-Date: Thu, 06 Nov 2025 00:19:09 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Frank Li (Gerrit)

            unread,
            Nov 6, 2025, 2:55:24 PMNov 6
            to Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
            Attention needed from Jingyun Liu and Sushanth Rajasankar

            Frank Li added 9 comments

            Patchset-level comments
            File-level comment, Patchset 14 (Latest):
            Frank Li . resolved

            Thanks @m...@chromium.org for the review! PS14 has the updates.

            Commit Message
            Line 20, Patchset 12:JavaScript apps now receive tool calls as structured messages, execute
            Mike Wasserman . resolved

            nit: note the new runtime enabled feature

            Frank Li

            Done

            File third_party/blink/renderer/modules/ai/language_model.idl
            Line 55, Patchset 12: // expectedOutputs has {"tool-call"}, this now yields a
            Mike Wasserman . resolved
            nit: (ditto below)
            ```suggestion
            // expectedOutputs includes {type:"tool-call"}, this now yields a
            ```
            Frank Li

            Done

            File third_party/blink/renderer/modules/ai/language_model_create_client.cc
            Line 118, Patchset 12: if (options_->hasExpectedOutputs()) {
            Mike Wasserman . resolved

            optional nit: reject when input/outputs has tool types without the runtime feature enabled

            Frank Li

            Added TODOs to look into it in upcoming blink CL.

            File third_party/blink/renderer/modules/ai/language_model_create_options.idl
            Line 58, Patchset 12:// Data-only content (for tool results - no tool-call or tool-response).
            Mike Wasserman . resolved

            Please clarify this, e.g. explicitly noting `Data-only type for LanguageModelToolSuccess result.`; maybe renaming to `LanguageModelToolResult` would help?

            Frank Li

            Done

            Line 72, Patchset 12: // Object fitting the JSON input schema of this tool call.
            Mike Wasserman . resolved
            ```suggestion
            // Object fitting the JSON input schema of the tool's declaration.
            ```
            Frank Li

            Done

            Line 94, Patchset 12:dictionary LanguageModelToolDeclaration {
            Mike Wasserman . resolved

            +CC'ing script_tools folks. FYI: I think it's okay to prototype with this separate dictionary roughly aligned with ToolRegistrationParams for now, please feel free to comment.

            Frank Li

            Acknowledged

            File third_party/blink/renderer/platform/runtime_enabled_features.json5
            Line 396, Patchset 12: name: "AIPromptAPIToolUse",
            Mike Wasserman . resolved

            Do you think it makes sense to stand up some very basic WPTs at this point?

            Frank Li

            I will add WPT tests in upcoming blink changes.

            Line 400, Patchset 12: "Linux": "experimental",
            Mike Wasserman . resolved

            nit: add `"ChromeOS": "experimental",` to align with other PromptAPI feature platforms

            Frank Li

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Jingyun Liu
            • Sushanth Rajasankar
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement is not satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
              Gerrit-Change-Number: 7092943
              Gerrit-PatchSet: 14
              Gerrit-Owner: Frank Li <fra...@microsoft.com>
              Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
              Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
              Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
              Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
              Gerrit-CC: Brandon Walderman <brwa...@microsoft.com>
              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
              Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
              Gerrit-CC: David Bokan <bo...@chromium.org>
              Gerrit-CC: Etienne Noël <etien...@chromium.org>
              Gerrit-CC: Kenji Baheux <kenji...@google.com>
              Gerrit-CC: Kentaro Hara <har...@chromium.org>
              Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
              Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
              Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
              Gerrit-Attention: Jingyun Liu <jin...@google.com>
              Gerrit-Comment-Date: Thu, 06 Nov 2025 19:55:13 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Mike Wasserman <m...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Frank Li (Gerrit)

              unread,
              Nov 6, 2025, 2:58:30 PMNov 6
              to Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
              Attention needed from Daniel Cheng, Jingyun Liu and Sushanth Rajasankar

              Frank Li added 1 comment

              Patchset-level comments
              Frank Li . resolved

              Adding Daniel for the review. Thanks!

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Daniel Cheng
              • Jingyun Liu
              • Sushanth Rajasankar
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement is not satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
              Gerrit-Change-Number: 7092943
              Gerrit-PatchSet: 14
              Gerrit-Owner: Frank Li <fra...@microsoft.com>
              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
              Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
              Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
              Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
              Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
              Gerrit-CC: Brandon Walderman <brwa...@microsoft.com>
              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
              Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
              Gerrit-CC: David Bokan <bo...@chromium.org>
              Gerrit-CC: Etienne Noël <etien...@chromium.org>
              Gerrit-CC: Kenji Baheux <kenji...@google.com>
              Gerrit-CC: Kentaro Hara <har...@chromium.org>
              Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
              Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
              Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
              Gerrit-Attention: Jingyun Liu <jin...@google.com>
              Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
              Gerrit-Comment-Date: Thu, 06 Nov 2025 19:58:20 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Sushanth Rajasankar (Gerrit)

              unread,
              Nov 10, 2025, 6:30:36 PM (12 days ago) Nov 10
              to Frank Li, Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
              Attention needed from Daniel Cheng, Frank Li and Jingyun Liu

              Sushanth Rajasankar added 2 comments

              File third_party/blink/renderer/modules/ai/language_model_create_options.idl
              Line 37, Patchset 15 (Latest):enum LanguageModelMessageType { "text", "image", "audio", "tool-call", "tool-response" };
              Sushanth Rajasankar . unresolved

              should there be tool-response-success, tool-response-error

              Line 55, Patchset 15 (Latest):// - "object": value should be JSON-serializable (primitives, objects, arrays)
              enum LanguageModelToolResultType { "text", "image", "audio", "object" };
              Sushanth Rajasankar . unresolved

              Perhaps this enum should match the input types to the language model that is this enum should just be LanguageModelMessageType. With the current definition there is a distinction between text and object, even though both are going to be converted to a string before being passed back to the LLM

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Daniel Cheng
              • Frank Li
              • Jingyun Liu
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                • requirement is not satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
                Gerrit-Change-Number: 7092943
                Gerrit-PatchSet: 15
                Gerrit-Owner: Frank Li <fra...@microsoft.com>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
                Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
                Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
                Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
                Gerrit-CC: Brandon Walderman <brwa...@microsoft.com>
                Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
                Gerrit-CC: David Bokan <bo...@chromium.org>
                Gerrit-CC: Etienne Noël <etien...@chromium.org>
                Gerrit-CC: Kenji Baheux <kenji...@google.com>
                Gerrit-CC: Kentaro Hara <har...@chromium.org>
                Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
                Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
                Gerrit-Attention: Frank Li <fra...@microsoft.com>
                Gerrit-Attention: Jingyun Liu <jin...@google.com>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Comment-Date: Mon, 10 Nov 2025 23:30:26 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Frank Li (Gerrit)

                unread,
                Nov 11, 2025, 4:57:52 PM (11 days ago) Nov 11
                to Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                Attention needed from Daniel Cheng, Jingyun Liu and Sushanth Rajasankar

                Frank Li added 2 comments

                File third_party/blink/renderer/modules/ai/language_model_create_options.idl
                Line 37, Patchset 15 (Latest):enum LanguageModelMessageType { "text", "image", "audio", "tool-call", "tool-response" };
                Sushanth Rajasankar . resolved

                should there be tool-response-success, tool-response-error

                Frank Li

                The success/error distinction is already handled by the LanguageModelToolResponse typedef union, which discriminates between LanguageModelToolSuccess and LanguageModelToolError at the structural level. This keeps the enum focused on content categories (text, image, audio, tool-call, tool-response) rather than outcome variants (success/error).

                Having a single tool-response type provides simpler ergonomics when sending responses:

                ```
                const toolResponse = handleToolCall(toolCall);
                // toolResponse is either LanguageModelToolSuccess or LanguageModelToolError

                await session.prompt([{
                role: "user",
                  content: [{
                type: "tool-response", // Single type for both success and error
                value: toolResponse // Union typedef handles discrimination
                }]
                }]);
                ```

                Developers don't need to inspect the response structure to determine which enum value to use - they can simply use tool-response and let the typedef handle the variant.

                By adding tool-response-success, tool-response-error, JS usage would require explicit discrimination:

                ```
                const messageType = "errorMessage" in toolResponse
                ? "tool-response-error"
                : "tool-response-success";
                await session.prompt([{
                role: "user",
                  content: [{
                type: messageType, // Must compute the correct type
                value: toolResponse
                }]
                }]);
                ```
                Line 55, Patchset 15 (Latest):// - "object": value should be JSON-serializable (primitives, objects, arrays)
                enum LanguageModelToolResultType { "text", "image", "audio", "object" };
                Sushanth Rajasankar . resolved

                Perhaps this enum should match the input types to the language model that is this enum should just be LanguageModelMessageType. With the current definition there is a distinction between text and object, even though both are going to be converted to a string before being passed back to the LLM

                Frank Li

                Earlier discussion with @jin...@google.com pointed out that we should not use
                LanguageModelMessageContent (or derivatives) as the result of the tool response
                content - it would create confusing semantics of recursion as the LanguageModelMessageType includes tool-response and tool-call. Tools returning tool-calls or tool-responses would allow infinite nesting and unclear semantics.

                With respect to 'text' vs 'object': While both eventually serialize to strings when passed to the LLM, earlier discussion on it was to not force
                JS app to stringify its tool call result. For example,

                ~~~
                // With "object" type - natural JavaScript:
                {
                type: "object",
                value: { temperature: 72, humidity: 65 }
                }
                // Without "object" type - forced string serialization:
                {
                type: "text",
                value: JSON.stringify({ temperature: 72, humidity: 65 }) // Awkward!
                }
                ~~~
                Open in Gerrit

                Related details

                Attention is currently required from:
                • Daniel Cheng
                • Jingyun Liu
                • Sushanth Rajasankar
                Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement satisfiedCode-Review
                  Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
                  Gerrit-Attention: Jingyun Liu <jin...@google.com>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Comment-Date: Tue, 11 Nov 2025 21:57:44 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Sushanth Rajasankar <Sush...@microsoft.com>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Jingyun Liu (Gerrit)

                  unread,
                  Nov 18, 2025, 5:10:56 PM (4 days ago) Nov 18
                  to Frank Li, Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                  Attention needed from Frank Li and Sushanth Rajasankar

                  Jingyun Liu added 1 comment

                  File third_party/blink/renderer/modules/ai/language_model_create_options.idl
                  Line 33, Patchset 15 (Latest):enum LanguageModelMessageRole { "system", "user", "assistant" };
                  Jingyun Liu . unresolved

                  Apologies for going back to this - I just realized we're not exapnding "tool-call" and "tool-response" to the roles, but only types.
                  Shall we also expand "tool-call" and "tool-response" to the roles, or do we have a convention/default role for people to use?

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Frank Li
                  • Sushanth Rajasankar
                  Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement is not satisfiedCode-Owners
                    • requirement satisfiedCode-Review
                    • requirement is not satisfiedNo-Unresolved-Comments
                    Gerrit-Attention: Frank Li <fra...@microsoft.com>
                    Gerrit-Comment-Date: Tue, 18 Nov 2025 22:10:45 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Frank Li (Gerrit)

                    unread,
                    Nov 18, 2025, 5:39:07 PM (4 days ago) Nov 18
                    to Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                    Attention needed from Jingyun Liu and Sushanth Rajasankar

                    Frank Li added 1 comment

                    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
                    Line 33, Patchset 15 (Latest):enum LanguageModelMessageRole { "system", "user", "assistant" };
                    Jingyun Liu . unresolved

                    Apologies for going back to this - I just realized we're not exapnding "tool-call" and "tool-response" to the roles, but only types.
                    Shall we also expand "tool-call" and "tool-response" to the roles, or do we have a convention/default role for people to use?

                    Frank Li

                    No problem.
                    we discussed that we don't need to add additional LanguageModelMessageRole enum values.
                    For "tool-response", JS APP can use "user"
                    For "tool-call", JS APP can use "assistant".

                    But, in the 10/29 meeting, we have this:
                    "
                    Are developers used to having a tool response role from Hugging Face?
                    Tool call role for responses?
                    https://huggingface.co/Trelis/openchat_3.5-function-calling-v3
                    Possible to add roles later
                    "

                    I can add them in this CL ...

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Jingyun Liu
                    • Sushanth Rajasankar
                    Gerrit-Attention: Jingyun Liu <jin...@google.com>
                    Gerrit-Comment-Date: Tue, 18 Nov 2025 22:38:57 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    Comment-In-Reply-To: Jingyun Liu <jin...@google.com>
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Jingyun Liu (Gerrit)

                    unread,
                    Nov 18, 2025, 5:55:15 PM (4 days ago) Nov 18
                    to Frank Li, Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                    Attention needed from Frank Li and Sushanth Rajasankar

                    Jingyun Liu added 1 comment

                    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
                    Line 33, Patchset 15 (Latest):enum LanguageModelMessageRole { "system", "user", "assistant" };
                    Jingyun Liu . unresolved

                    Apologies for going back to this - I just realized we're not exapnding "tool-call" and "tool-response" to the roles, but only types.
                    Shall we also expand "tool-call" and "tool-response" to the roles, or do we have a convention/default role for people to use?

                    Frank Li

                    No problem.
                    we discussed that we don't need to add additional LanguageModelMessageRole enum values.
                    For "tool-response", JS APP can use "user"
                    For "tool-call", JS APP can use "assistant".

                    But, in the 10/29 meeting, we have this:
                    "
                    Are developers used to having a tool response role from Hugging Face?
                    Tool call role for responses?
                    https://huggingface.co/Trelis/openchat_3.5-function-calling-v3
                    Possible to add roles later
                    "

                    I can add them in this CL ...

                    Jingyun Liu

                    Oooh gotcha. Thank you! I don't have a strong opinion (although, maybe add a comment for "user -> tool-response, assistant -> tool-call" if we're not expanding on the roles?), so whichever you prefer!

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Frank Li
                    • Sushanth Rajasankar
                    Gerrit-Attention: Frank Li <fra...@microsoft.com>
                    Gerrit-Comment-Date: Tue, 18 Nov 2025 22:55:05 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Jingyun Liu

                    unread,
                    Nov 18, 2025, 7:08:08 PM (4 days ago) Nov 18
                    to change-...@chromium-review.googlesource.com, Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                    Hey Frank,

                    A side question related to this change: Would you also like to update the spec (https://webmachinelearning.github.io/prompt-api/#idl-index) and the explainer (https://github.com/webmachinelearning/prompt-api/tree/main) to reflect the IDL changes? If not, I can update them and send a PR for review. 

                    Thank you!

                    - Jingyun

                    Jingyun Liu (Gerrit)

                    unread,
                    Nov 18, 2025, 7:08:23 PM (4 days ago) Nov 18
                    to Frank Li, Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                    Attention needed from Frank Li and Sushanth Rajasankar

                    Jingyun Liu added 1 comment

                    Message

                    Hey Frank,

                    A side question related to this change: Would you also like to update the spec () and the explainer () to reflect the IDL changes? If not, I can update them and send a PR for review. https://webmachinelearning.github.io/prompt-api/#idl-index https://github.com/webmachinelearning/prompt-api/tree/main

                    Thank you!

                    • Jingyun

                    On Tue, Nov 18, 2025 at 2:39 PM Frank Li (Gerrit) <noreply-gerritcodereview+gz4PwmYgtkZZNSdhq09RrA==@> wrote: chromium.org

                    1 comment

                    Patchset-level comments
                    File-level comment, Patchset 15 (Latest):
                    Jingyun Liu . resolved

                    Hey Frank,

                    A side question related to this change: Would you also like to update the spec () and the explainer () to reflect the IDL changes? If not, I can update them and send a PR for review. https://webmachinelearning.github.io/prompt-api/#idl-index https://github.com/webmachinelearning/prompt-api/tree/main

                    Thank you!

                    • Jingyun

                    On Tue, Nov 18, 2025 at 2:39 PM Frank Li (Gerrit) <noreply-gerritcodereview+gz4PwmYgtkZZNSdhq09RrA==@> wrote: chromium.org

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Frank Li
                    • Sushanth Rajasankar
                    Gerrit-Attention: Frank Li <fra...@microsoft.com>
                    Gerrit-Comment-Date: Wed, 19 Nov 2025 00:08:11 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Frank Li (Gerrit)

                    unread,
                    Nov 18, 2025, 8:03:05 PM (4 days ago) Nov 18
                    to Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                    Attention needed from Jingyun Liu and Sushanth Rajasankar

                    Frank Li added 2 comments

                    Patchset-level comments
                    Jingyun Liu . resolved

                    Hey Frank,

                    A side question related to this change: Would you also like to update the spec () and the explainer () to reflect the IDL changes? If not, I can update them and send a PR for review. https://webmachinelearning.github.io/prompt-api/#idl-index https://github.com/webmachinelearning/prompt-api/tree/main

                    Thank you!

                    • Jingyun

                    On Tue, Nov 18, 2025 at 2:39 PM Frank Li (Gerrit) <noreply-gerritcodereview+gz4PwmYgtkZZNSdhq09RrA==@> wrote: chromium.org

                    Frank Li

                    Yes, please do it. Thanks!

                    File third_party/blink/renderer/modules/ai/language_model_create_options.idl
                    Line 33, Patchset 15 (Latest):enum LanguageModelMessageRole { "system", "user", "assistant" };
                    Jingyun Liu . unresolved

                    Apologies for going back to this - I just realized we're not exapnding "tool-call" and "tool-response" to the roles, but only types.
                    Shall we also expand "tool-call" and "tool-response" to the roles, or do we have a convention/default role for people to use?

                    Frank Li

                    No problem.
                    we discussed that we don't need to add additional LanguageModelMessageRole enum values.
                    For "tool-response", JS APP can use "user"
                    For "tool-call", JS APP can use "assistant".

                    But, in the 10/29 meeting, we have this:
                    "
                    Are developers used to having a tool response role from Hugging Face?
                    Tool call role for responses?
                    https://huggingface.co/Trelis/openchat_3.5-function-calling-v3
                    Possible to add roles later
                    "

                    I can add them in this CL ...

                    Jingyun Liu

                    Oooh gotcha. Thank you! I don't have a strong opinion (although, maybe add a comment for "user -> tool-response, assistant -> tool-call" if we're not expanding on the roles?), so whichever you prefer!

                    Frank Li

                    ok, I will add them.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Jingyun Liu
                    • Sushanth Rajasankar
                    Gerrit-Attention: Jingyun Liu <jin...@google.com>
                    Gerrit-Comment-Date: Wed, 19 Nov 2025 01:02:54 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Daniel Cheng (Gerrit)

                    unread,
                    Nov 19, 2025, 1:56:02 AM (4 days ago) Nov 19
                    to Frank Li, Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                    Attention needed from Frank Li, Jingyun Liu and Sushanth Rajasankar

                    Daniel Cheng added 3 comments

                    Patchset-level comments

                    Adding Daniel for the review. Thanks!

                    Daniel Cheng

                    In the future, please make sure I'm in the attention set. If I'm not in the attention set, I probably won't ever see the review.

                    File chrome/browser/ai/ai_manager.cc
                    Line 252, Patchset 15 (Latest): // TODO(crbug.com/422803232): Implement tool capabilities.
                    Daniel Cheng . unresolved

                    So to be clear, this is just plumbing to set up the model right? The actual tool bits would be sent via `AILanguageModelPromptContent`?

                    File third_party/blink/public/mojom/ai/ai_language_model.mojom
                    Line 101, Patchset 15 (Latest): array<AILanguageModelExpected>? expected_outputs;
                    Daniel Cheng . unresolved

                    I'm mostly wondering because we wouldn't ever expect tool response to be an expected output right? It would only be a tool call? Or is it something that might be supported in the future somehow?

                    If it can't be supported and won't be supported... maybe we need to better structure this to reflect that.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Frank Li
                    • Jingyun Liu
                    • Sushanth Rajasankar
                    Gerrit-Attention: Frank Li <fra...@microsoft.com>
                    Gerrit-Attention: Jingyun Liu <jin...@google.com>
                    Gerrit-Comment-Date: Wed, 19 Nov 2025 06:55:51 +0000
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Frank Li (Gerrit)

                    unread,
                    Nov 19, 2025, 4:44:05 AM (4 days ago) Nov 19
                    to Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                    Attention needed from Daniel Cheng, Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

                    Frank Li added 3 comments

                    Patchset-level comments

                    Adding Daniel for the review. Thanks!

                    Daniel Cheng

                    In the future, please make sure I'm in the attention set. If I'm not in the attention set, I probably won't ever see the review.

                    Frank Li

                    Acknowledged

                    File chrome/browser/ai/ai_manager.cc
                    Line 252, Patchset 15: // TODO(crbug.com/422803232): Implement tool capabilities.
                    Daniel Cheng . resolved

                    So to be clear, this is just plumbing to set up the model right? The actual tool bits would be sent via `AILanguageModelPromptContent`?

                    Frank Li

                    These are placeholders for now.
                    yes, tool bits could possibly be in AILanguageModelPromptContent

                    File third_party/blink/public/mojom/ai/ai_language_model.mojom
                    Line 101, Patchset 15: array<AILanguageModelExpected>? expected_outputs;
                    Daniel Cheng . resolved

                    I'm mostly wondering because we wouldn't ever expect tool response to be an expected output right? It would only be a tool call? Or is it something that might be supported in the future somehow?

                    If it can't be supported and won't be supported... maybe we need to better structure this to reflect that.

                    Frank Li

                    ... we wouldn't ever expect tool response to be an expected output right? It would only be a tool call?...

                    Yes.

                    The intention is to validate it in the blink layer when it has tool declaration to create the LanguageModel.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Daniel Cheng
                    • Jingyun Liu
                    • Mike Wasserman
                    • Sushanth Rajasankar
                    Submit Requirements:
                      • requirement satisfiedCode-Coverage
                      • requirement is not satisfiedCode-Owners
                      • requirement is not satisfiedCode-Review
                      • requirement is not satisfiedNo-Unresolved-Comments
                      • requirement is not satisfiedReview-Enforcement
                      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                      Gerrit-MessageType: comment
                      Gerrit-Project: chromium/src
                      Gerrit-Branch: main
                      Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
                      Gerrit-Change-Number: 7092943
                      Gerrit-PatchSet: 16
                      Gerrit-Owner: Frank Li <fra...@microsoft.com>
                      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                      Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
                      Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
                      Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
                      Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
                      Gerrit-CC: Brandon Walderman <brwa...@microsoft.com>
                      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                      Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
                      Gerrit-CC: David Bokan <bo...@chromium.org>
                      Gerrit-CC: Etienne Noël <etien...@chromium.org>
                      Gerrit-CC: Kenji Baheux <kenji...@google.com>
                      Gerrit-CC: Kentaro Hara <har...@chromium.org>
                      Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
                      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
                      Gerrit-Attention: Mike Wasserman <m...@chromium.org>
                      Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
                      Gerrit-Attention: Jingyun Liu <jin...@google.com>
                      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                      Gerrit-Comment-Date: Wed, 19 Nov 2025 09:43:55 +0000
                      Gerrit-HasComments: Yes
                      Gerrit-Has-Labels: No
                      Comment-In-Reply-To: Frank Li <fra...@microsoft.com>
                      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                      satisfied_requirement
                      unsatisfied_requirement
                      open
                      diffy

                      Frank Li (Gerrit)

                      unread,
                      Nov 19, 2025, 4:45:08 AM (4 days ago) Nov 19
                      to Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                      Attention needed from Daniel Cheng, Jingyun Liu, Mike Wasserman and Sushanth Rajasankar

                      Frank Li added 1 comment

                      File third_party/blink/renderer/modules/ai/language_model_create_options.idl
                      Line 33, Patchset 15:enum LanguageModelMessageRole { "system", "user", "assistant" };
                      Jingyun Liu . resolved

                      Apologies for going back to this - I just realized we're not exapnding "tool-call" and "tool-response" to the roles, but only types.
                      Shall we also expand "tool-call" and "tool-response" to the roles, or do we have a convention/default role for people to use?

                      Frank Li

                      No problem.
                      we discussed that we don't need to add additional LanguageModelMessageRole enum values.
                      For "tool-response", JS APP can use "user"
                      For "tool-call", JS APP can use "assistant".

                      But, in the 10/29 meeting, we have this:
                      "
                      Are developers used to having a tool response role from Hugging Face?
                      Tool call role for responses?
                      https://huggingface.co/Trelis/openchat_3.5-function-calling-v3
                      Possible to add roles later
                      "

                      I can add them in this CL ...

                      Jingyun Liu

                      Oooh gotcha. Thank you! I don't have a strong opinion (although, maybe add a comment for "user -> tool-response, assistant -> tool-call" if we're not expanding on the roles?), so whichever you prefer!

                      Frank Li

                      ok, I will add them.

                      Frank Li

                      Done

                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Daniel Cheng
                      • Jingyun Liu
                      • Mike Wasserman
                      • Sushanth Rajasankar
                      Submit Requirements:
                        • requirement satisfiedCode-Coverage
                        • requirement is not satisfiedCode-Owners
                        • requirement is not satisfiedCode-Review
                        Gerrit-Comment-Date: Wed, 19 Nov 2025 09:44:59 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        Comment-In-Reply-To: Frank Li <fra...@microsoft.com>
                        Comment-In-Reply-To: Jingyun Liu <jin...@google.com>
                        satisfied_requirement
                        unsatisfied_requirement
                        open
                        diffy

                        Frank Li (Gerrit)

                        unread,
                        Nov 19, 2025, 12:49:02 PM (3 days ago) Nov 19
                        to Sophie Chang, Steven Holte, Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                        Attention needed from Daniel Cheng, Jingyun Liu, Mike Wasserman, Sophie Chang, Steven Holte and Sushanth Rajasankar

                        Frank Li added 1 comment

                        Patchset-level comments
                        File-level comment, Patchset 16 (Latest):
                        Frank Li . resolved

                        + Sophie and Steven for owner of components/optimization_guide/core/model_execution/substitution.cc

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Daniel Cheng
                        • Jingyun Liu
                        • Mike Wasserman
                        • Sophie Chang
                        • Steven Holte
                        • Sushanth Rajasankar
                        Submit Requirements:
                        • requirement satisfiedCode-Coverage
                        • requirement is not satisfiedCode-Owners
                        • requirement is not satisfiedCode-Review
                        • requirement is not satisfiedReview-Enforcement
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: comment
                        Gerrit-Project: chromium/src
                        Gerrit-Branch: main
                        Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
                        Gerrit-Change-Number: 7092943
                        Gerrit-PatchSet: 16
                        Gerrit-Owner: Frank Li <fra...@microsoft.com>
                        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                        Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
                        Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
                        Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
                        Gerrit-Reviewer: Sophie Chang <sophi...@chromium.org>
                        Gerrit-Reviewer: Steven Holte <ho...@chromium.org>
                        Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
                        Gerrit-CC: Brandon Walderman <brwa...@microsoft.com>
                        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                        Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
                        Gerrit-CC: David Bokan <bo...@chromium.org>
                        Gerrit-CC: Etienne Noël <etien...@chromium.org>
                        Gerrit-CC: Kenji Baheux <kenji...@google.com>
                        Gerrit-CC: Kentaro Hara <har...@chromium.org>
                        Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
                        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
                        Gerrit-Attention: Mike Wasserman <m...@chromium.org>
                        Gerrit-Attention: Steven Holte <ho...@chromium.org>
                        Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
                        Gerrit-Attention: Sophie Chang <sophi...@chromium.org>
                        Gerrit-Attention: Jingyun Liu <jin...@google.com>
                        Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                        Gerrit-Comment-Date: Wed, 19 Nov 2025 17:48:53 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        satisfied_requirement
                        unsatisfied_requirement
                        open
                        diffy

                        Steven Holte (Gerrit)

                        unread,
                        Nov 19, 2025, 1:19:10 PM (3 days ago) Nov 19
                        to Frank Li, Steven Holte, Sophie Chang, Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                        Attention needed from Daniel Cheng, Frank Li, Jingyun Liu, Mike Wasserman, Sophie Chang and Sushanth Rajasankar

                        Steven Holte voted and added 1 comment

                        Votes added by Steven Holte

                        Code-Review+1

                        1 comment

                        Patchset-level comments
                        Steven Holte . resolved

                        services/odm + components/og lgtm

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Daniel Cheng
                        • Frank Li
                        • Jingyun Liu
                        • Mike Wasserman
                        • Sophie Chang
                        • Sushanth Rajasankar
                        Submit Requirements:
                          • requirement satisfiedCode-Coverage
                          • requirement is not satisfiedCode-Owners
                          • requirement satisfiedCode-Review
                          Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
                          Gerrit-Attention: Frank Li <fra...@microsoft.com>
                          Gerrit-Attention: Sophie Chang <sophi...@chromium.org>
                          Gerrit-Attention: Jingyun Liu <jin...@google.com>
                          Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                          Gerrit-Comment-Date: Wed, 19 Nov 2025 18:18:59 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: Yes
                          satisfied_requirement
                          unsatisfied_requirement
                          open
                          diffy

                          Daniel Cheng (Gerrit)

                          unread,
                          Nov 19, 2025, 1:28:20 PM (3 days ago) Nov 19
                          to Frank Li, Steven Holte, Sophie Chang, Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                          Attention needed from Frank Li, Jingyun Liu, Mike Wasserman, Sophie Chang and Sushanth Rajasankar

                          Daniel Cheng added 1 comment

                          File third_party/blink/public/mojom/ai/ai_language_model.mojom
                          Line 101, Patchset 15: array<AILanguageModelExpected>? expected_outputs;
                          Daniel Cheng . unresolved

                          I'm mostly wondering because we wouldn't ever expect tool response to be an expected output right? It would only be a tool call? Or is it something that might be supported in the future somehow?

                          If it can't be supported and won't be supported... maybe we need to better structure this to reflect that.

                          Frank Li

                          ... we wouldn't ever expect tool response to be an expected output right? It would only be a tool call?...

                          Yes.

                          The intention is to validate it in the blink layer when it has tool declaration to create the LanguageModel.

                          Daniel Cheng

                          Can we try to structure the Mojo in a way that it's not possible to send impossible inputs?

                          That probably means separating the input option type from the output option type instead of using the same one for both.

                          Is there a reason `languages` can be specified independent fo reach one? Does the languages option make sense for all possible input types?

                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Frank Li
                          • Jingyun Liu
                          • Mike Wasserman
                          • Sophie Chang
                          • Sushanth Rajasankar
                          Submit Requirements:
                            • requirement satisfiedCode-Coverage
                            • requirement is not satisfiedCode-Owners
                            • requirement satisfiedCode-Review
                            • requirement is not satisfiedNo-Unresolved-Comments
                            Gerrit-Comment-Date: Wed, 19 Nov 2025 18:28:09 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: No
                            Comment-In-Reply-To: Frank Li <fra...@microsoft.com>
                            Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                            satisfied_requirement
                            unsatisfied_requirement
                            open
                            diffy

                            Frank Li (Gerrit)

                            unread,
                            Nov 19, 2025, 6:10:53 PM (3 days ago) Nov 19
                            to Steven Holte, Daniel Cheng, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                            Attention needed from Daniel Cheng, Mike Wasserman and Sushanth Rajasankar

                            Frank Li added 1 comment

                            File third_party/blink/public/mojom/ai/ai_language_model.mojom
                            Line 101, Patchset 15: array<AILanguageModelExpected>? expected_outputs;
                            Daniel Cheng . unresolved

                            I'm mostly wondering because we wouldn't ever expect tool response to be an expected output right? It would only be a tool call? Or is it something that might be supported in the future somehow?

                            If it can't be supported and won't be supported... maybe we need to better structure this to reflect that.

                            Frank Li

                            ... we wouldn't ever expect tool response to be an expected output right? It would only be a tool call?...

                            Yes.

                            The intention is to validate it in the blink layer when it has tool declaration to create the LanguageModel.

                            Daniel Cheng

                            Can we try to structure the Mojo in a way that it's not possible to send impossible inputs?

                            That probably means separating the input option type from the output option type instead of using the same one for both.

                            Is there a reason `languages` can be specified independent fo reach one? Does the languages option make sense for all possible input types?

                            Frank Li

                            >...Can we try to structure the Mojo in a way that it's not possible to send impossible inputs?...

                            Good point! I would like to do it in a follow-up CL - try to minimize the scope of this CL. WDYT?

                            ```
                            // The expected input types that can be sent to the model.
                            // Both tool calls and tool responses can be sent as input:
                            // - Tool calls: When replaying conversation history in open-loop agentic apps
                            // - Tool responses: When providing tool execution results
                            enum AILanguageModelExpectedInputType {
                            kText = 0,
                            kImage = 1,
                            kAudio = 2,
                            kToolCall = 3,
                            kToolResponse = 4,
                            };
                            // The expected output types that can be generated by the model.
                            // Tool calls can be generated as output (model requests tool execution).
                            // Tool responses cannot be generated as output (they are user-provided).
                            enum AILanguageModelExpectedOutputType {
                            kText = 0,
                            kImage = 1,
                            kAudio = 2,
                            kToolCall = 3,
                            };
                            // The expected input data type and languages specified with session creation.
                            struct AILanguageModelExpectedInput {
                            AILanguageModelExpectedInputType type;
                            array<AILanguageCode>? languages;
                            };
                            // The expected output data type and languages specified with session creation.
                            struct AILanguageModelExpectedOutput {
                            AILanguageModelExpectedOutputType type;
                            array<AILanguageCode>? languages;
                            };
                            ```

                            >...Is there a reason languages can be specified independent fo reach one...

                            The languages field is specified independently per type because different input types may have different language requirements in the same session. Per the spec example:
                            ```
                            expectedInputs: [
                            { type: "text", languages: ["en"] },
                            { type: "image", languages: ["fr"] } // For OCR'ing French text in images
                            ]
                            ```

                            ...Does the languages option make sense for all possible input types?...

                            I agree that the `kToolCall` and `kToolResponse` types don't semantically
                            require a languages option, since they represent structured JSON data rather than natural language content.

                            Options to enforce this:

                            Option (a): Runtime validation

                            ```
                            if ((type == kToolCall || type == kToolResponse) && languages.has_value()) {
                            // return Error::kInvalidLanguageForType;
                            }
                            ```

                            Option (b): Type-level enforcement with unions
                            Let `AILanguageModelExpectedInput` to be a union of different mojom
                            structs to enforce no languages for tools such as `AILanguageModelExpectedTool`.

                            ```
                            struct AILanguageModelExpectedTool {
                            AILanguageModelToolType type; // only kToolCall or kToolResponse
                            // No languages field
                            };
                            ```

                            If possible, I would like to address the issue in a separate CL.
                            WDYT?

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Daniel Cheng
                            • Mike Wasserman
                            • Sushanth Rajasankar
                            Submit Requirements:
                            • requirement satisfiedCode-Coverage
                            • requirement is not satisfiedCode-Owners
                            • requirement satisfiedCode-Review
                            • requirement is not satisfiedNo-Unresolved-Comments
                            • requirement is not satisfiedReview-Enforcement
                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                            Gerrit-MessageType: comment
                            Gerrit-Project: chromium/src
                            Gerrit-Branch: main
                            Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
                            Gerrit-Change-Number: 7092943
                            Gerrit-PatchSet: 16
                            Gerrit-Owner: Frank Li <fra...@microsoft.com>
                            Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                            Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
                            Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
                            Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
                            Gerrit-Reviewer: Steven Holte <ho...@chromium.org>
                            Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
                            Gerrit-CC: Brandon Walderman <brwa...@microsoft.com>
                            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                            Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
                            Gerrit-CC: David Bokan <bo...@chromium.org>
                            Gerrit-CC: Etienne Noël <etien...@chromium.org>
                            Gerrit-CC: Kenji Baheux <kenji...@google.com>
                            Gerrit-CC: Kentaro Hara <har...@chromium.org>
                            Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
                            Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
                            Gerrit-Attention: Mike Wasserman <m...@chromium.org>
                            Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
                            Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                            Gerrit-Comment-Date: Wed, 19 Nov 2025 23:10:40 +0000
                            satisfied_requirement
                            unsatisfied_requirement
                            open
                            diffy

                            Daniel Cheng (Gerrit)

                            unread,
                            Nov 20, 2025, 1:25:02 PM (2 days ago) Nov 20
                            to Frank Li, Daniel Cheng, Steven Holte, Mike Wasserman, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                            Attention needed from Frank Li, Mike Wasserman and Sushanth Rajasankar

                            Daniel Cheng voted and added 1 comment

                            Votes added by Daniel Cheng

                            Code-Review+1

                            1 comment

                            File third_party/blink/public/mojom/ai/ai_language_model.mojom
                            Line 101, Patchset 15: array<AILanguageModelExpected>? expected_outputs;
                            Daniel Cheng . resolved
                            Daniel Cheng

                            Followup is fine. Thanks for the discussion.

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Frank Li
                            • Mike Wasserman
                            • Sushanth Rajasankar
                            Submit Requirements:
                              • requirement satisfiedCode-Coverage
                              • requirement is not satisfiedCode-Owners
                              • requirement satisfiedCode-Review
                              • requirement satisfiedReview-Enforcement
                              Gerrit-Attention: Frank Li <fra...@microsoft.com>
                              Gerrit-Comment-Date: Thu, 20 Nov 2025 18:24:51 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: Yes
                              satisfied_requirement
                              unsatisfied_requirement
                              open
                              diffy

                              Mike Wasserman (Gerrit)

                              unread,
                              Nov 20, 2025, 7:28:49 PM (2 days ago) Nov 20
                              to Frank Li, Daniel Cheng, Steven Holte, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                              Attention needed from Frank Li, Jingyun Liu and Sushanth Rajasankar

                              Mike Wasserman voted and added 2 comments

                              Votes added by Mike Wasserman

                              Code-Review+1

                              2 comments

                              Patchset-level comments
                              File-level comment, Patchset 17 (Latest):
                              Mike Wasserman . resolved

                              lgtm, thank you!

                              File third_party/blink/renderer/modules/ai/language_model_create_options.idl
                              Line 33, Patchset 15:enum LanguageModelMessageRole { "system", "user", "assistant" };
                              Jingyun Liu . resolved

                              Apologies for going back to this - I just realized we're not exapnding "tool-call" and "tool-response" to the roles, but only types.
                              Shall we also expand "tool-call" and "tool-response" to the roles, or do we have a convention/default role for people to use?

                              Frank Li

                              No problem.
                              we discussed that we don't need to add additional LanguageModelMessageRole enum values.
                              For "tool-response", JS APP can use "user"
                              For "tool-call", JS APP can use "assistant".

                              But, in the 10/29 meeting, we have this:
                              "
                              Are developers used to having a tool response role from Hugging Face?
                              Tool call role for responses?
                              https://huggingface.co/Trelis/openchat_3.5-function-calling-v3
                              Possible to add roles later
                              "

                              I can add them in this CL ...

                              Jingyun Liu

                              Oooh gotcha. Thank you! I don't have a strong opinion (although, maybe add a comment for "user -> tool-response, assistant -> tool-call" if we're not expanding on the roles?), so whichever you prefer!

                              Frank Li

                              ok, I will add them.

                              Frank Li

                              Done

                              Mike Wasserman

                              It's not obvious why we'd add TC/TR roles, since user and assistant seem sufficient, but we can always revisit this decision later.

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Frank Li
                              • Jingyun Liu
                              • Sushanth Rajasankar
                              Submit Requirements:
                              • requirement satisfiedCode-Coverage
                              • requirement satisfiedCode-Owners
                              • requirement satisfiedCode-Review
                              • requirement satisfiedReview-Enforcement
                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                              Gerrit-MessageType: comment
                              Gerrit-Project: chromium/src
                              Gerrit-Branch: main
                              Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
                              Gerrit-Change-Number: 7092943
                              Gerrit-PatchSet: 17
                              Gerrit-Owner: Frank Li <fra...@microsoft.com>
                              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                              Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
                              Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
                              Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
                              Gerrit-Reviewer: Steven Holte <ho...@chromium.org>
                              Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
                              Gerrit-CC: Brandon Walderman <brwa...@microsoft.com>
                              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                              Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
                              Gerrit-CC: David Bokan <bo...@chromium.org>
                              Gerrit-CC: Etienne Noël <etien...@chromium.org>
                              Gerrit-CC: Kenji Baheux <kenji...@google.com>
                              Gerrit-CC: Kentaro Hara <har...@chromium.org>
                              Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
                              Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
                              Gerrit-Attention: Sushanth Rajasankar <Sush...@microsoft.com>
                              Gerrit-Attention: Frank Li <fra...@microsoft.com>
                              Gerrit-Attention: Jingyun Liu <jin...@google.com>
                              Gerrit-Comment-Date: Fri, 21 Nov 2025 00:28:34 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: Yes
                              Comment-In-Reply-To: Frank Li <fra...@microsoft.com>
                              Comment-In-Reply-To: Jingyun Liu <jin...@google.com>
                              satisfied_requirement
                              open
                              diffy

                              Frank Li (Gerrit)

                              unread,
                              Nov 20, 2025, 7:32:51 PM (2 days ago) Nov 20
                              to Mike Wasserman, Daniel Cheng, Steven Holte, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
                              Attention needed from Jingyun Liu and Sushanth Rajasankar

                              Frank Li voted Commit-Queue+2

                              Commit-Queue+2
                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Jingyun Liu
                              • Sushanth Rajasankar
                              Gerrit-Attention: Jingyun Liu <jin...@google.com>
                              Gerrit-Comment-Date: Fri, 21 Nov 2025 00:32:40 +0000
                              Gerrit-HasComments: No
                              Gerrit-Has-Labels: Yes
                              satisfied_requirement
                              open
                              diffy

                              Chromium LUCI CQ (Gerrit)

                              unread,
                              Nov 20, 2025, 7:58:08 PM (2 days ago) Nov 20
                              to Frank Li, Mike Wasserman, Daniel Cheng, Steven Holte, Brandon Walderman, Khushal Sagar, David Bokan, Dave Tapuska, Jingyun Liu, Sushanth Rajasankar, Etienne Noël, Kenji Baheux, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org

                              Chromium LUCI CQ submitted the change

                              Change information

                              Commit message:
                              [PromptAPI] Tool use IDL changes (v2 - no execution of tool by blink)

                              This CL adds IDL definitions for Tool Use v2 with an open agentic loop
                              for 'Tool use' scenario. Key changes:
                              - Add LanguageModelToolDeclaration for declaring available tools at
                              session creation with name, description, and JSON schema
                              - Add LanguageModelToolCall for model-->JS tool invocation requests with
                              callID, tool name, and structured arguments
                              - Add LanguageModelToolResponse for JS-->model tool execution results
                              - Update prompt() return type to support dynamic response (string or
                              structured messages based on tool usage)
                              - Refactor promise helpers to templates, eliminating code duplication
                              - This feature is gated behind the AIPromptAPIToolUse runtime
                              enabled feature.


                              JavaScript apps now receive tool calls as structured messages, execute
                              them using their own runtime and send results back to continue the
                              conversation. Blink acts as transport layer without executing tool
                              logic, providing common 'server-side Function Calling API' style for web
                              developers.

                              Prompt API Tool Use Scoping & Design doc:
                              https://docs.google.com/document/d/1Cyhk8X9jgpU4FFYQZKb8A5RgTQMqT9xIN-JnxlMdEus/edit?resourcekey=0-Date8jy3LWnhpwRzqJ-aDg&tab=t.0#heading=h.o25e9o4ywb3p

                              NO_IFTTT=It is not added by this CL.
                              Bug: 422803232
                              Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
                              Reviewed-by: Mike Wasserman <m...@chromium.org>
                              Reviewed-by: Steven Holte <ho...@chromium.org>
                              Reviewed-by: Daniel Cheng <dch...@chromium.org>
                              Commit-Queue: Frank Li <fra...@microsoft.com>
                              Cr-Commit-Position: refs/heads/main@{#1548176}
                              Files:
                              • M chrome/browser/ai/ai_language_model.cc
                              • M chrome/browser/ai/ai_manager.cc
                              • M components/optimization_guide/core/model_execution/substitution.cc
                              • M services/on_device_model/fake/fake_chrome_ml_api.cc
                              • M services/on_device_model/ml/chrome_ml_types.h
                              • M services/on_device_model/public/cpp/chrome_ml_types_mojom_traits.cc
                              • M services/on_device_model/public/cpp/test_support/fake_service.cc
                              • M services/on_device_model/public/mojom/on_device_model.mojom
                              • M third_party/blink/public/mojom/ai/ai_language_model.mojom
                              • M third_party/blink/renderer/bindings/generated_in_modules.gni
                              • M third_party/blink/renderer/modules/ai/ai_metrics.cc
                              • M third_party/blink/renderer/modules/ai/ai_metrics.h
                              • M third_party/blink/renderer/modules/ai/ai_utils.cc
                              • M third_party/blink/renderer/modules/ai/ai_writing_assistance_base.h
                              • M third_party/blink/renderer/modules/ai/exception_helpers.h
                              • M third_party/blink/renderer/modules/ai/language_model.cc
                              • M third_party/blink/renderer/modules/ai/language_model.h
                              • M third_party/blink/renderer/modules/ai/language_model.idl
                              • M third_party/blink/renderer/modules/ai/language_model_create_client.cc
                              • M third_party/blink/renderer/modules/ai/language_model_create_options.idl
                              • M third_party/blink/renderer/modules/ai/language_model_prompt_builder.cc
                              • M third_party/blink/renderer/modules/ai/model_execution_responder.cc
                              • M third_party/blink/renderer/modules/ai/model_execution_responder.h
                              • M third_party/blink/renderer/modules/ai/model_execution_responder_test.cc
                              • M third_party/blink/renderer/modules/ai/on_device_translation/translator.cc
                              • M third_party/blink/renderer/platform/runtime_enabled_features.json5
                              • M tools/metrics/histograms/metadata/ai/enums.xml
                              Change size: L
                              Delta: 27 files changed, 278 insertions(+), 72 deletions(-)
                              Branch: refs/heads/main
                              Submit Requirements:
                              • requirement satisfiedCode-Review: +1 by Daniel Cheng, +1 by Mike Wasserman, +1 by Steven Holte
                              Open in Gerrit
                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                              Gerrit-MessageType: merged
                              Gerrit-Project: chromium/src
                              Gerrit-Branch: main
                              Gerrit-Change-Id: I066a4e5515d127f26bce0a276eec60a3dc809a6a
                              Gerrit-Change-Number: 7092943
                              Gerrit-PatchSet: 18
                              Gerrit-Owner: Frank Li <fra...@microsoft.com>
                              Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
                              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                              Gerrit-Reviewer: Frank Li <fra...@microsoft.com>
                              Gerrit-Reviewer: Jingyun Liu <jin...@google.com>
                              Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
                              Gerrit-Reviewer: Steven Holte <ho...@chromium.org>
                              Gerrit-Reviewer: Sushanth Rajasankar <Sush...@microsoft.com>
                              Gerrit-CC: Brandon Walderman <brwa...@microsoft.com>
                              open
                              diffy
                              satisfied_requirement
                              Reply all
                              Reply to author
                              Forward
                              0 new messages