Summarizer API asking for output language

85 views
Skip to first unread message

Yash

unread,
Oct 15, 2025, 8:31:06 AMOct 15
to Chrome Built-in AI Early Preview Program Discussions
The documentation on Summarizer API does not mention any information about it expecting a output language option, but on creating a Summarizer it is showing me warning that output language should be specified

Please provide what exactly should be given in initializing options to solve this.

Thank you.
Screenshot 2025-10-15 175718.png

Thomas Steiner

unread,
Oct 15, 2025, 10:25:46 AMOct 15
to Yash, Chrome Built-in AI Early Preview Program Discussions
Hi Yash,

This information is currently indeed not covered in our docs, but I have filed a content bug for us to cover it, and meanwhile would like to point you at the relevant Explainer section that has code samples as well.

Cheers,
Tom 

--
You received this message because you are subscribed to the Google Groups "Chrome Built-in AI Early Preview Program Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ai-dev-previe...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chrome-ai-dev-preview-discuss/404b1f15-f81b-435a-80f1-e7dadb4ac6a1n%40chromium.org.


--
Thomas Steiner, PhD—Developer Relations Engineer (blog.tomayac.comtoot.cafe/@tomayac)

Google Spain, S.L.U.
Torre Picasso, Pl. Pablo Ruiz Picasso, 1, Tetuán, 28020 Madrid, Spain

CIF: B63272603
Inscrita en el Registro Mercantil de Madrid, sección 8, Hoja M­-435397 Tomo 24227 Folio 25

----- BEGIN PGP SIGNATURE -----
Version: GnuPG v2.4.8 (GNU/Linux)

iFy0uwAntT0bE3xtRa5AfeCheCkthAtTh3reSabiGbl0ck
0fjumBl3DCharaCTersAttH3b0ttom.xKcd.cOm/1181.
----- END PGP SIGNATURE -----

Luca K

unread,
Oct 16, 2025, 1:23:12 PMOct 16
to Chrome Built-in AI Early Preview Program Discussions, Yash
Yash,

Chrome’s on-device AI APIs expect you to declare the output language everywhere you touch the model; otherwise the browser logs that warning.

My fix was to thread the language code (for example 'en', 'es', or 'ja') through both the availability check and the session creation call before you issue summarize() or rewrite():

```
const OUTPUT_LANG = 'en'; // or 'es', 'ja'

await chrome.ai.summarizer.availability({ outputLanguage: OUTPUT_LANG });
const summarizer = await chrome.ai.summarizer.create({ outputLanguage: OUTPUT_LANG });

await chrome.ai.rewriter.availability({ outputLanguage: OUTPUT_LANG });
const rewriter = await chrome.ai.rewriter.create({
  outputLanguage: OUTPUT_LANG,
  sharedContext: '…'
});
```

If you skip the language in either place, Chrome assumes “auto” and fires the warning.
Passing the same outputLanguage value in both calls and subsequent API call-satisfies the safety attestation requirement and the warning goes away.

Thomas Steiner

unread,
Oct 16, 2025, 4:33:58 PMOct 16
to Luca K, Chrome Built-in AI Early Preview Program Discussions, Yash
Yes, this exactly is the behavior we strive to document. For now, the fallback of the API is to just assume English, but of course in the long-term this is not a behavior we want to hard-wire. Eventually , ifit is not known, the API is rather to throw than to assume English. 

Thomas Steiner, PhD—Developer Relations Engineer (blog.tomayac.comtoot.cafe/@tomayac)

Google Spain, S.L.U.
Torre Picasso, Pl. Pablo Ruiz Picasso, 1, Tetuán, 28020 Madrid, Spain

CIF: B63272603
Inscrita en el Registro Mercantil de Madrid, sección 8, Hoja M­-435397 Tomo 24227 Folio 25

----- BEGIN PGP SIGNATURE -----
Version: GnuPG v2.4.8 (GNU/Linux)

iFy0uwAntT0bE3xtRa5AfeCheCkthAtTh3reSabiGbl0ck
0fjumBl3DCharaCTersAttH3b0ttom.xKcd.cOm/1181.
----- END PGP SIGNATURE -----
--
You received this message because you are subscribed to the Google Groups "Chrome Built-in AI Early Preview Program Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ai-dev-previe...@chromium.org.

Ken Kahn

unread,
Oct 17, 2025, 2:14:12 AMOct 17
to Thomas Steiner, Luca K, Chrome Built-in AI Early Preview Program Discussions, Yash
Why can't the default be derived from Chrome's language settings?

Thomas Steiner

unread,
Oct 17, 2025, 2:36:43 AMOct 17
to Ken Kahn, Thomas Steiner, Luca K, Chrome Built-in AI Early Preview Program Discussions, Yash
On Fri, Oct 17, 2025, 08:14 Ken Kahn <toon...@gmail.com> wrote:
Why can't the default be derived from Chrome's language settings?

This would make testing a nightmare as you can't know what languages your users have set in their preferences. The current assumed default of English also isn't great given eventually this API shall work with many languages, so the spec and the implementation encourage the setting of the languages explicitly, and in the long-term calls might even fail if no languages are present in the options. 

Die4Ever2005

unread,
Oct 20, 2025, 12:03:04 PMOct 20
to Chrome Built-in AI Early Preview Program Discussions, Thomas Steiner, Luca K, Chrome Built-in AI Early Preview Program Discussions, Yash, Ken Kahn
"the spec and the implementation encourage the setting of the languages explicitly"

It would be a bit hard to present the user with a list of languages to choose from if we can't poll to ask the API all the languages that are supported. I know you can make 1 availability call per language, but that requires me to know all the languages that could be supported. I guess ideally there'd be a call to get a list of language codes with full names.

Thomas Steiner

unread,
Oct 20, 2025, 12:08:20 PMOct 20
to Die4Ever2005, Kenji Baheux, Etienne Noël, Chrome Built-in AI Early Preview Program Discussions, Thomas Steiner, Luca K, Yash, Ken Kahn
Getting the list of supported languages came up in a similar context before. @Kenji Baheux@Etienne Noël, should we re-open this Issue? I think having a way to explicitly query the supported input and output languages makes sense, especially since developers need to (but also can) hard-probe all language combinations, so a more convenient method sounds justified.  
--

Etienne Noël

unread,
Oct 20, 2025, 12:13:57 PMOct 20
to Thomas Steiner, chrome-chia-dev, Die4Ever2005, Kenji Baheux, Chrome Built-in AI Early Preview Program Discussions, Luca K, Yash, Ken Kahn

I'm not against it. Do you see a specific method or just as part of availability?
Reply all
Reply to author
Forward
0 new messages