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

Throttle onUpdate to 50ms #2182

Closed
wants to merge 1 commit into from
Closed

Conversation

oalexdoda
Copy link

@oalexdoda oalexdoda commented Jul 4, 2024

This fixes #1610 for the useChat() hook by introducing a 50ms throttle to the onUpdate callback. Most likely you'll wanna use a SDK util instead of adding Lodash just for this, but it works as a proof of concept.

@oalexdoda
Copy link
Author

oalexdoda commented Jul 4, 2024

I can trace this bug back to 8 months ago so I think it's a pretty important fix. @lgrammel
image

@oalexdoda oalexdoda marked this pull request as draft July 6, 2024 18:21
@Pulseline-Tech
Copy link

#2257

@oalexdoda
Copy link
Author

I'll go ahead and close this @lgrammel

@oalexdoda oalexdoda closed this Nov 1, 2024
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

Successfully merging this pull request may close these issues.

Error: Maximum update depth exceeded. When using useCompletion hook in nextjs, on long response on gpt-4o
2 participants