How to display chat messages for user and assistant with the most clean way that is the fastest and doesnt slow by having unnecesary information fetched?

Hi, everyone. Currently I am building the Chat message UI…. Basically how the backend to be connected and displayed.

What is a more proper way to filter the user texts and the AI assistant text?

Should I have only one message container and filtering it for Example:

User:

Right

Blue background

Displaying user message, if role = user

Assistant:

Right

Gray background

Displaying assistant message, if role = assistant

Or, should I user two separate container for user and assistant inside the list?

Hi Atanas :waving_hand:

This week we will be launching our new “AI Chat element” which will have more customization options for what you are trying to do with the regular chat element.