explainers-by-googlers / prompt-api

A proposal for a web API for prompting browser-provided language models
Creative Commons Attribution 4.0 International
266 stars 20 forks source link

save and restore session #50

Open hemanth opened 1 month ago

hemanth commented 1 month ago

It would be beneficial to have APIs that facilitate saving and restoring sessions for multiple use cases where we need the context to be preserved across sessions.

tomayac commented 1 month ago

Are you thinking of some way to store an AIAssistant session in IndexedDB for example, similar to FileSystemHandle objects?

hemanth commented 1 month ago

Yes @tomayac! Say it is a webapp that needs to maintain the session/state on consecutive visits.

domenic commented 1 month ago

This is an interesting feature request that makes sense to me. Thumbs-up reactions, or detailed comments explaining how this would benefit specific apps you are building, are appreciated to help prioritize.

I filed https://github.com/explainers-by-googlers/prompt-api/issues/51 as well, which overlaps. #51 is basically more powerful than this feature request, so maybe it is higher priority. But this version is theoretically more performant, since the browser would take care of all the serializing and deserializing behind the scenes.

hemanth commented 1 month ago

Thanks @domenic!

history was the first thing that came to my mind too! Then thought save and restore would be good to have.