translate streaming example

21 views
Skip to first unread message

Connie Leung

unread,
Jul 12, 2025, 11:05:28 PMJul 12
to Chrome Built-in AI Early Preview Program Discussions
Hi all,

https://developer.chrome.com/docs/ai/translator-api#run-translator does not provide an example of streaming translation.  The following code work for me

Please advise.

Connie

const stream = await translator.translateStreaming(
inputText,
{ signal: this.#constroller.signal }
);

Thomas Steiner

unread,
Jul 14, 2025, 6:23:23 AMJul 14
to Connie Leung, Chrome Built-in AI Early Preview Program Discussions
Thank you, Connie! Added a streaming example now. It wasn't implemented when the article was first published. 

(By the way, you have a typo in your code: constroller → controller.) 

--
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/c17f6f60-ec62-413c-8e5c-e161220e40a0n%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 -----

Connie Leung

unread,
Jul 14, 2025, 8:54:36 AMJul 14
to Chrome Built-in AI Early Preview Program Discussions, Thomas Steiner, Chrome Built-in AI Early Preview Program Discussions, Connie Leung
Thanks, Tom.

I will fix the typo.

Connie

Reply all
Reply to author
Forward
0 new messages