Can I tell the Prompt API to forget previous input?

100 views
Skip to first unread message

Robert Oschler

unread,
Dec 2, 2024, 4:05:00 PM12/2/24
to Chrome Built-in AI Early Preview Program Discussions
I rewrote my Chrome V3 extension code to create and destroy the Prompt API session each query.  I did this, because when I had a prompt session object that was persistent, the LLM output clearly indicated it was "remembering" previous inputs.  I'm guessing the default nature of the Prompt API model is chat based?

This code change worked, but the time to answer a query appears to take longer now.  If I went back to using a persistent Prompt API session object,  is there a way to make to make the LLM "forget" all previous interactions and treat the current query has the sum total of its input (i.e. - no chat history)?

Robert Oschler

unread,
Dec 2, 2024, 6:12:32 PM12/2/24
to Chrome Built-in AI Early Preview Program Discussions, Robert Oschler
Nevermind.  I just watched Thomas's excellent video on Chrome's local APIs and in it he discusses the "Reset" button on the Prompt API playground:

https://www.youtube.com/watch?v=surh_D8CU9A&t=2s

Thomas Steiner

unread,
Dec 2, 2024, 7:56:02 PM12/2/24
to Robert Oschler, Chrome Built-in AI Early Preview Program Discussions
Hah, glad I automated myself away. Just in case anyone else is in need of the reset feature, this is how it's implemented.

--
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/3bfa53c1-9912-4837-afba-cdb02e608131n%40chromium.org.


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

Google Germany GmbH, ABC-Str. 19, 20354 Hamburg, Germany
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891

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

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

Lars H

unread,
Dec 5, 2024, 5:00:44 AM12/5/24
to Chrome Built-in AI Early Preview Program Discussions, Thomas Steiner, Chrome Built-in AI Early Preview Program Discussions, Robert Oschler
Just saw the video as well, very good.

Are the demos available with source code: https://chrome.dev/

Could be a great help.

Thomas Steiner

unread,
Dec 5, 2024, 6:56:46 AM12/5/24
to Lars H, Chrome Built-in AI Early Preview Program Discussions, Thomas Steiner, Robert Oschler
Hi Lars,

All our demos are here: https://github.com/GoogleChromeLabs/web-ai-demos. They are deployed at https://chrome.dev/.

Cheers,
Tom
Reply all
Reply to author
Forward
0 new messages