web-llm
web-llm copied to clipboard
[Function] Add heartbeat to service worker
Overview
This PR adds heartbeat event in web service worker so that the client can monitor its status and respond correspondingly.
Primary Changes
- Update
{ type: "keepAlive" }
event to{ kind: "keepAlive" }
to keep all event format consistent - Add heartbeat event in web service worker handler to report back its status