Class: Roseflow::Chat::Message

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/roseflow/chat/message.rb

Direct Known Subclasses

ModelMessage, SystemMessage, UserMessage

Instance Method Summary collapse

Instance Method Details

#model?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/roseflow/chat/message.rb', line 22

def model?
  %w(system assistant).include?(role)
end

#system?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/roseflow/chat/message.rb', line 18

def system?
  role == "system"
end

#user?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/roseflow/chat/message.rb', line 14

def user?
  role == "user"
end