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
43 44 45 |
# File 'lib/vangrail/conversation.rb', line 43 def origin @origin end |
#result ⇒ Object
Returns the value of attribute result
43 44 45 |
# File 'lib/vangrail/conversation.rb', line 43 def result @result end |
#role ⇒ Object
Returns the value of attribute role
43 44 45 |
# File 'lib/vangrail/conversation.rb', line 43 def role @role end |
#text ⇒ Object
Returns the value of attribute text
43 44 45 |
# File 'lib/vangrail/conversation.rb', line 43 def text @text end |
Instance Method Details
#blocked? ⇒ Boolean
44 45 46 |
# File 'lib/vangrail/conversation.rb', line 44 def blocked? result&.blocked? || false end |
#to_h ⇒ Object
52 53 54 55 |
# File 'lib/vangrail/conversation.rb', line 52 def to_h { 'role' => role.to_s, 'text' => text, 'origin' => origin&.to_s, 'result' => result&.to_h }.compact end |
#user? ⇒ Boolean
48 49 50 |
# File 'lib/vangrail/conversation.rb', line 48 def user? role == :user end |