Skip to content

GlDuoChat: On streaming, move storing chunks out of the chat_message's context

Summary

Currently Duo Chat message component is event based instead of data based. It makes the component harder to use in VSCode. Lets consider if we can update the component.

Suggestions

Instead of stacking chunks in the internal state of the component we can rely on message.chunks array and render content based on data priority. It's up to the state to make sure chunks array is updated with latest data.

I.e. renderedContent = message.errors || message.contentHtml || message.content || combineAndSortChunks(message.chunks)

Edited by Denys Mishunov