This repository was archived by the owner on May 6, 2024. It is now read-only.
Realtime API response
Pre-release
Pre-release
In this version
We edited js code to allow the user to get realtime response from ZChatGPT API.
also we edited the function that will count the tokens number, to can work with the new API behavior.
Be careful, we edited the following:
- Rearrange the welcoming messages
- global OBJ to save the current message that API is building (by putting the new AI response msg DOM element in it, to can update the textContent of them to the new received response completion)
- removing gptMsgTaker()
- update gptMsgDom() to edit the current message DOM.
- creating gptMsgPusher()
- editing addtokens() to new tokens calc way (to fit the new API response way)
- shorten apiFetcher() to simpler function called fetchAPI(), and making it async
- adding readablestream functions and loop in fetchAPI()
NOTE: we published this version as pre-release because there are some edits that must be added like disabling the send button after clicking, and auto scroll down