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

feat (ui/react): introduce experimental_throttle in useChat, useCompletion #3440

Merged
merged 11 commits into from
Nov 1, 2024

Conversation

lgrammel
Copy link
Collaborator

@lgrammel lgrammel commented Nov 1, 2024

Summary

Introduces an experimental_throttle setting on useChat and useCompletion that allows passing in a custom throttle wait in ms (React only).

Background

By default, the UI is re-rendered on every chunk that arrives. This can overload the rendering, especially on slower devices or when complex components need updating (e.g. Markdown). Throttling can mitigate this.

Related Issues

#1610

Tasks

  • implementation
  • examples
  • docs: useCompletion guide
  • docs: useCompletion reference
  • docs: chatbot guide
  • docs: useChat reference
  • docs: troubleshooting page
  • changeset

Copy link

socket-security bot commented Nov 1, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] None 0 5.13 kB sindresorhus

View full report↗︎

@lgrammel lgrammel changed the title Lg/fix limit feat (ui/react): introduce experimental_throttle in useChat, useCompletion Nov 1, 2024
@lgrammel lgrammel merged commit 2dfb93e into main Nov 1, 2024
8 checks passed
@lgrammel lgrammel deleted the lg/fix-limit branch November 1, 2024 11:26
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.

2 participants