pusher / pusher-js

Pusher Javascript library
http://pusher.com
MIT License
2.11k stars 374 forks source link

chatGPT like stream conversational data #757

Closed ManuRodgers closed 1 year ago

ManuRodgers commented 1 year ago

Do you want to request a feature or report a bug? new feature

What is the expected behavior? Can you guys have some react hooks like useChat from vercel.ai (https://sdk.vercel.ai/docs/api-reference/use-chat) to handle chatGPT like stream conversational data? I feel like this would be really popular feature in the future

benw-pusher commented 1 year ago

Thanks for suggesting your feature. It looks as though you would be able to achieve something similar with the features we already have available. The useChat utility simply allows you to receive chat updates from your system (which itself has received the update from the AI provider), and these chat updates show in a specific format.

With Channels you could simply subscribe to a channel and have your system push these messages over our system - you would still have your server receive and manage the updates from the AI, but the manner in which the events is published to the client would be using Channels instead.

I have noted your feedback however Channels is designed to accept many different message structures and adding specific message structures is not on our roadmap at this time.