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

[v10.4.x] GenAI: Update the component only when the response is fully generated #83895

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

grafana-delivery-bot[bot]
Copy link
Contributor

Backport 112c0e7 from #83879


Fixes #79611, #76848

Problem
The previous approach triggered a set state for every stream response. This was causing the component to enter into many re-renders, where React was stopping them and missing part of the message.

Solution
Do not set the state on every stream result, and accumulate the response to only commit the set state when it is fully completed. This changes the experience, but we want to try with this approach, to ensure the experience is performant enough.

2024-03-05 08 10 10

…t respond (#83879)

* Update the component only when the response is fully generated

* Fix quick feedback action doesn't respond

* Fix history not displaying after the second click

* Fix the history that moves when regenerating

---------

Co-authored-by: Adela Almasan <88068998+adela-almasan@users.noreply.github.com>
(cherry picked from commit 112c0e7)
@grafana-delivery-bot grafana-delivery-bot bot requested a review from a team as a code owner March 5, 2024 11:12
@grafana-delivery-bot grafana-delivery-bot bot requested review from oscarkilhed and Sergej-Vlasov and removed request for a team March 5, 2024 11:12
@grafana-delivery-bot grafana-delivery-bot bot added this to the 10.4.x milestone Mar 5, 2024
@ivanortegaalba ivanortegaalba merged commit 3171158 into v10.4.x Mar 5, 2024
21 checks passed
@ivanortegaalba ivanortegaalba deleted the backport-83879-to-v10.4.x branch March 5, 2024 11:39
@aangelisc aangelisc modified the milestones: 10.4.x, 10.4.0 Mar 6, 2024
@zserge zserge modified the milestones: 10.4.0, 10.4.x Mar 12, 2024
@mdvictor mdvictor modified the milestones: 10.4.x, 10.4.1 Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants