Class: Layered::Assistant::Message
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- ApplicationRecord
- Layered::Assistant::Message
- Includes:
- ActionView::RecordIdentifier
- Defined in:
- app/models/layered/assistant/message.rb
Instance Method Summary collapse
-
#broadcast_created ⇒ Object
Broadcasting.
- #broadcast_response_complete ⇒ Object
- #broadcast_streaming_content ⇒ Object
- #broadcast_updated ⇒ Object
Instance Method Details
#broadcast_created ⇒ Object
Broadcasting
28 29 30 31 32 33 |
# File 'app/models/layered/assistant/message.rb', line 28 def broadcast_created broadcast_append_to conversation, targets: ".#{dom_id(conversation)}_messages", partial: "layered/assistant/messages/message", locals: { message: self } end |
#broadcast_response_complete ⇒ Object
42 43 44 45 46 |
# File 'app/models/layered/assistant/message.rb', line 42 def broadcast_response_complete broadcast_action_to conversation, action: :enable_composer, targets: ".#{dom_id(conversation)}_composer" end |
#broadcast_streaming_content ⇒ Object
48 49 50 51 52 53 |
# File 'app/models/layered/assistant/message.rb', line 48 def broadcast_streaming_content broadcast_action_to conversation, action: :render_content, targets: ".#{dom_id(self)}_content", content: content end |
#broadcast_updated ⇒ Object
35 36 37 38 39 40 |
# File 'app/models/layered/assistant/message.rb', line 35 def broadcast_updated broadcast_replace_to conversation, targets: ".#{dom_id(self)}", partial: "layered/assistant/messages/message", locals: { message: self } end |