Class: Vangrail::Conversation::Turn
- Inherits:
-
Struct
- Object
- Struct
- Vangrail::Conversation::Turn
- Defined in:
- lib/vangrail/conversation.rb
Instance Attribute Summary collapse
-
#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
#result ⇒ Object
Returns the value of attribute result
29 30 31 |
# File 'lib/vangrail/conversation.rb', line 29 def result @result end |
#role ⇒ Object
Returns the value of attribute role
29 30 31 |
# File 'lib/vangrail/conversation.rb', line 29 def role @role end |
#text ⇒ Object
Returns the value of attribute text
29 30 31 |
# File 'lib/vangrail/conversation.rb', line 29 def text @text end |
Instance Method Details
#blocked? ⇒ Boolean
30 31 32 |
# File 'lib/vangrail/conversation.rb', line 30 def blocked? result&.blocked? || false end |
#to_h ⇒ Object
38 39 40 |
# File 'lib/vangrail/conversation.rb', line 38 def to_h { 'role' => role.to_s, 'text' => text, 'result' => result&.to_h }.compact end |
#user? ⇒ Boolean
34 35 36 |
# File 'lib/vangrail/conversation.rb', line 34 def user? role == :user end |