chatgpt-api icon indicating copy to clipboard operation
chatgpt-api copied to clipboard

Missing onProgress on SendMessage function in ChatGPTAPIBrowser class

Open yazninja opened this issue 1 year ago • 5 comments

Describe the feature

The ChatGPTAPIBrowser.sendMessage function is missing the option for sendMessage, it would be nice if this is added

yazninja avatar Dec 21 '22 08:12 yazninja

I was about to write it: the onProgress function does not work using apibrowser

giugrilli avatar Dec 21 '22 09:12 giugrilli

+1. Would be a really helpful feature.

michaelbecker-d avatar Dec 22 '22 05:12 michaelbecker-d

Really looking forward to this feature. Once it's live we should put together a demo that uses a websocket server and client to speak with the language model in real time.

tom-leamon avatar Dec 23 '22 17:12 tom-leamon

If anyone wants to take a stab at this in a PR, the way I'd implement it is using page.exposeFunction to expose a callback that the inner fetch evaluate handler can check for to call back into node.js during progress updates.

https://github.com/transitive-bullshit/chatgpt-api/pull/163 was a previous attempt at adding this but it's stale now.

transitive-bullshit avatar Dec 28 '22 21:12 transitive-bullshit

I did, based on page.exposefunction to make the asynchronous result of the stream response to ChatGPTAPIBrowser。 But maybe it's not so good。 Examples are at demos/demo-conversation-browser.ts : https://github.com/bincooo/cdn/raw/main/cgpt.zip

bincooo avatar Dec 30 '22 03:12 bincooo

Just added in https://github.com/transitive-bullshit/chatgpt-api/releases/tag/v3.4.0

Please let me know if it's not working for you.

transitive-bullshit avatar Jan 12 '23 09:01 transitive-bullshit