Class: Legion::Gaia::InputFrame
- Inherits:
-
Data
- Object
- Data
- Legion::Gaia::InputFrame
- Defined in:
- lib/legion/gaia/input_frame.rb
Instance Attribute Summary collapse
-
#auth_context ⇒ Object
readonly
Returns the value of attribute auth_context.
-
#channel_capabilities ⇒ Object
readonly
Returns the value of attribute channel_capabilities.
-
#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.
-
#device_context ⇒ Object
readonly
Returns the value of attribute device_context.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#received_at ⇒ Object
readonly
Returns the value of attribute received_at.
-
#session_continuity_id ⇒ Object
readonly
Returns the value of attribute session_continuity_id.
Instance Method Summary collapse
- #human_direct? ⇒ Boolean
-
#initialize(content:, channel_id:, id: SecureRandom.uuid, content_type: :text, channel_capabilities: [], device_context: {}, session_continuity_id: nil, auth_context: {}, metadata: {}, received_at: Time.now.utc) ⇒ InputFrame
constructor
A new instance of InputFrame.
- #salience ⇒ Object
- #text? ⇒ Boolean
- #to_signal ⇒ Object
Constructor Details
#initialize(content:, channel_id:, id: SecureRandom.uuid, content_type: :text, channel_capabilities: [], device_context: {}, session_continuity_id: nil, auth_context: {}, metadata: {}, received_at: Time.now.utc) ⇒ InputFrame
Returns a new instance of InputFrame.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/legion/gaia/input_frame.rb', line 21 def initialize( content:, channel_id:, id: SecureRandom.uuid, content_type: :text, channel_capabilities: [], device_context: {}, session_continuity_id: nil, auth_context: {}, metadata: {}, received_at: Time.now.utc ) super end |
Instance Attribute Details
#auth_context ⇒ Object (readonly)
Returns the value of attribute auth_context
9 10 11 |
# File 'lib/legion/gaia/input_frame.rb', line 9 def auth_context @auth_context end |
#channel_capabilities ⇒ Object (readonly)
Returns the value of attribute channel_capabilities
9 10 11 |
# File 'lib/legion/gaia/input_frame.rb', line 9 def channel_capabilities @channel_capabilities end |
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id
9 10 11 |
# File 'lib/legion/gaia/input_frame.rb', line 9 def channel_id @channel_id end |
#content ⇒ Object (readonly)
Returns the value of attribute content
9 10 11 |
# File 'lib/legion/gaia/input_frame.rb', line 9 def content @content end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type
9 10 11 |
# File 'lib/legion/gaia/input_frame.rb', line 9 def content_type @content_type end |
#device_context ⇒ Object (readonly)
Returns the value of attribute device_context
9 10 11 |
# File 'lib/legion/gaia/input_frame.rb', line 9 def device_context @device_context end |
#id ⇒ Object (readonly)
Returns the value of attribute id
9 10 11 |
# File 'lib/legion/gaia/input_frame.rb', line 9 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
9 10 11 |
# File 'lib/legion/gaia/input_frame.rb', line 9 def @metadata end |
#received_at ⇒ Object (readonly)
Returns the value of attribute received_at
9 10 11 |
# File 'lib/legion/gaia/input_frame.rb', line 9 def received_at @received_at end |
#session_continuity_id ⇒ Object (readonly)
Returns the value of attribute session_continuity_id
9 10 11 |
# File 'lib/legion/gaia/input_frame.rb', line 9 def session_continuity_id @session_continuity_id end |
Instance Method Details
#human_direct? ⇒ Boolean
40 41 42 |
# File 'lib/legion/gaia/input_frame.rb', line 40 def human_direct? [:source_type] == :human_direct end |
#salience ⇒ Object
44 45 46 |
# File 'lib/legion/gaia/input_frame.rb', line 44 def salience [:salience] || 0.0 end |
#text? ⇒ Boolean
36 37 38 |
# File 'lib/legion/gaia/input_frame.rb', line 36 def text? content_type == :text end |
#to_signal ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/legion/gaia/input_frame.rb', line 48 def to_signal { value: content, source_type: [:source_type] || :ambient, salience: salience, channel_id: channel_id, frame_id: id, received_at: received_at } end |