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
50 51 52 |
# File 'lib/vangrail/conversation.rb', line 50 def origin @origin end |
#result ⇒ Object
Returns the value of attribute result
50 51 52 |
# File 'lib/vangrail/conversation.rb', line 50 def result @result end |
#role ⇒ Object
Returns the value of attribute role
50 51 52 |
# File 'lib/vangrail/conversation.rb', line 50 def role @role end |
#text ⇒ Object
Returns the value of attribute text
50 51 52 |
# File 'lib/vangrail/conversation.rb', line 50 def text @text end |
Instance Method Details
#blocked? ⇒ Boolean
51 52 53 |
# File 'lib/vangrail/conversation.rb', line 51 def blocked? result&.blocked? || false end |
#to_h ⇒ Object
59 60 61 62 |
# File 'lib/vangrail/conversation.rb', line 59 def to_h { 'role' => role.to_s, 'text' => text, 'origin' => origin&.to_s, 'result' => result&.to_h }.compact end |
#user? ⇒ Boolean
55 56 57 |
# File 'lib/vangrail/conversation.rb', line 55 def user? role == :user end |