Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming a response from onProgress return duplicates #621

Open
2 tasks done
Gerovinka opened this issue Oct 19, 2023 · 0 comments
Open
2 tasks done

Streaming a response from onProgress return duplicates #621

Gerovinka opened this issue Oct 19, 2023 · 0 comments

Comments

@Gerovinka
Copy link

Verify latest release

  • I verified that the issue exists in the latest chatgpt release

Verify webapp is working

  • I verify that the ChatGPT webapp is working properly for this account.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant