AI stream to content script
I am creating a chrome extension which is a content script, I want to stream my AI response and display it token by token.
I am able to get the stream with POST request using background script but don't know how to get it to content script token by token by using res.send() or something similar.
5 Replies
I would think the best way to stream data from your BGSW to a content script would be VIA a Port. You can subscribe to the ports
onMessage
event.Yep, I tried it, works fine. ☺️
Thanks ✨
Awesome! Yeah I saw the message in the main chat and someone provided with a code snippet.
@Sam has reached level 8. GG!
Yep ☺️