Class: Riffer::Messages::System

Inherits:
Base
  • Object
show all
Defined in:
lib/riffer/messages/system.rb

Overview

Represents a system message (instructions) in a conversation.

msg = Riffer::Messages::System.new("You are a helpful assistant.")
msg.role     # => :system
msg.content  # => "You are a helpful assistant."

Instance Attribute Summary

Attributes inherited from Base

#content

Instance Method Summary collapse

Methods inherited from Base

#initialize, #to_h

Constructor Details

This class inherits a constructor from Riffer::Messages::Base

Instance Method Details

#+(other) ⇒ Object

– : (Riffer::Messages::System) -> Riffer::Messages::System



19
20
21
# File 'lib/riffer/messages/system.rb', line 19

def +(other)
  self.class.new("#{content}\n\n#{other.content}")
end

#roleObject

– : () -> Symbol



13
14
15
# File 'lib/riffer/messages/system.rb', line 13

def role
  :system
end