Closed Gerovinka closed 1 month ago
This project is undergoing a major revamp; closing out old issues as part of the prep process.
The chatgpt
package is pretty outdated at this point. I recommend that you use the openai package or the openai-fetch package instead.
Verify latest release
chatgpt
releaseVerify webapp is working
Environment details
I'm doing a test AWS Lambda function in Node.js 18.x
Describe the Bug
I apologize, can you suggest how to solve my problem. I have added data streaming directly from your onProgress, but when I test how the function works, I sometimes get duplicate messages. My code looks like this: const res = await api.sendMessage(question, { systemMessage: role, onProgress: (partialResponse) => { responseText = partialResponse.text; responseStream.write(responseText); } }) During testing, I sometimes get duplicates of the following kind: "The Three of PentaclesThe Three of Pentacles suggestsThe Three of Pentacles suggests that"
Could you please advise me if I did the right thing to add the data return directly from your 'onProgress' or do I need to modify my code