Class: Legion::Gaia::OutputFrame
- Inherits:
-
Data
- Object
- Data
- Legion::Gaia::OutputFrame
- Defined in:
- lib/legion/gaia/output_frame.rb
Instance Attribute Summary collapse
-
#channel_hints ⇒ Object
readonly
Returns the value of attribute channel_hints.
-
#channel_id ⇒ Object
readonly
Returns the value of attribute channel_id.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#in_reply_to ⇒ Object
readonly
Returns the value of attribute in_reply_to.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#session_continuity_id ⇒ Object
readonly
Returns the value of attribute session_continuity_id.
Instance Method Summary collapse
-
#initialize(content:, channel_id:, id: SecureRandom.uuid, in_reply_to: nil, content_type: :text, session_continuity_id: nil, channel_hints: {}, metadata: {}, created_at: Time.now.utc) ⇒ OutputFrame
constructor
A new instance of OutputFrame.
- #suggest_richer_channel? ⇒ Boolean
- #text? ⇒ Boolean
- #truncated? ⇒ Boolean
Constructor Details
#initialize(content:, channel_id:, id: SecureRandom.uuid, in_reply_to: nil, content_type: :text, session_continuity_id: nil, channel_hints: {}, metadata: {}, created_at: Time.now.utc) ⇒ OutputFrame
Returns a new instance of OutputFrame.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/legion/gaia/output_frame.rb', line 18 def initialize( content:, channel_id:, id: SecureRandom.uuid, in_reply_to: nil, content_type: :text, session_continuity_id: nil, channel_hints: {}, metadata: {}, created_at: Time.now.utc ) super end |
Instance Attribute Details
#channel_hints ⇒ Object (readonly)
Returns the value of attribute channel_hints
7 8 9 |
# File 'lib/legion/gaia/output_frame.rb', line 7 def channel_hints @channel_hints end |
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id
7 8 9 |
# File 'lib/legion/gaia/output_frame.rb', line 7 def channel_id @channel_id end |
#content ⇒ Object (readonly)
Returns the value of attribute content
7 8 9 |
# File 'lib/legion/gaia/output_frame.rb', line 7 def content @content end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type
7 8 9 |
# File 'lib/legion/gaia/output_frame.rb', line 7 def content_type @content_type end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at
7 8 9 |
# File 'lib/legion/gaia/output_frame.rb', line 7 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id
7 8 9 |
# File 'lib/legion/gaia/output_frame.rb', line 7 def id @id end |
#in_reply_to ⇒ Object (readonly)
Returns the value of attribute in_reply_to
7 8 9 |
# File 'lib/legion/gaia/output_frame.rb', line 7 def in_reply_to @in_reply_to end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
7 8 9 |
# File 'lib/legion/gaia/output_frame.rb', line 7 def @metadata end |
#session_continuity_id ⇒ Object (readonly)
Returns the value of attribute session_continuity_id
7 8 9 |
# File 'lib/legion/gaia/output_frame.rb', line 7 def session_continuity_id @session_continuity_id end |
Instance Method Details
#suggest_richer_channel? ⇒ Boolean
36 37 38 |
# File 'lib/legion/gaia/output_frame.rb', line 36 def suggest_richer_channel? channel_hints[:suggest_channel_switch] == true end |
#text? ⇒ Boolean
32 33 34 |
# File 'lib/legion/gaia/output_frame.rb', line 32 def text? content_type == :text end |
#truncated? ⇒ Boolean
40 41 42 |
# File 'lib/legion/gaia/output_frame.rb', line 40 def truncated? channel_hints[:truncated] == true end |