Suppress system role message broadcasts? #333
-
Is there a way that I haven't been able to find to not send system messages to the UI? My |
Beta Was this translation helpful? Give feedback.
Answered by
tpaulshippy
Aug 8, 2025
Replies: 1 comment 1 reply
-
You would need to add a conditional on broadcasts_to ->(message) {
message.role != "system" ? [message.chat, "messages"] : nil
} or the front-end like this: <%= turbo_frame_tag message do %>
<% if message.role != "system" ? %>
...rest of code in partial...
<% end %>
<% end %> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
UnderpantsGnome
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You would need to add a conditional on
message.role
.Examples below are untested and based on this example.
Could do it on the back-end like this:
or the front-end like this: