Class: Vangrail::Conversation::Turn
- Inherits:
-
Struct
- Object
- Struct
- Vangrail::Conversation::Turn
- Defined in:
- lib/vangrail/conversation.rb
Instance Attribute Summary collapse
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#result ⇒ Object
Returns the value of attribute result.
-
#role ⇒ Object
Returns the value of attribute role.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
Instance Attribute Details
#origin ⇒ Object
Returns the value of attribute origin
55 56 57 |
# File 'lib/vangrail/conversation.rb', line 55 def origin @origin end |
#result ⇒ Object
Returns the value of attribute result
55 56 57 |
# File 'lib/vangrail/conversation.rb', line 55 def result @result end |
#role ⇒ Object
Returns the value of attribute role
55 56 57 |
# File 'lib/vangrail/conversation.rb', line 55 def role @role end |
#text ⇒ Object
Returns the value of attribute text
55 56 57 |
# File 'lib/vangrail/conversation.rb', line 55 def text @text end |
Instance Method Details
#blocked? ⇒ Boolean
56 57 58 |
# File 'lib/vangrail/conversation.rb', line 56 def blocked? result&.blocked? || false end |
#to_h ⇒ Object
64 65 66 67 |
# File 'lib/vangrail/conversation.rb', line 64 def to_h { 'role' => role.to_s, 'text' => text, 'origin' => origin&.to_s, 'result' => result&.to_h }.compact end |
#user? ⇒ Boolean
60 61 62 |
# File 'lib/vangrail/conversation.rb', line 60 def user? role == :user end |