Class: Cloudflare::AI::Message

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serializers::JSON, ActiveModel::Validations
Defined in:
lib/cloudflare/ai/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(role:, content:) ⇒ Message

Returns a new instance of Message.



12
13
14
15
# File 'lib/cloudflare/ai/message.rb', line 12

def initialize(role:, content:)
  @role = role
  @content = content
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



7
8
9
# File 'lib/cloudflare/ai/message.rb', line 7

def content
  @content
end

#roleObject

Returns the value of attribute role.



7
8
9
# File 'lib/cloudflare/ai/message.rb', line 7

def role
  @role
end

Instance Method Details

#attributesObject



17
18
19
# File 'lib/cloudflare/ai/message.rb', line 17

def attributes
  {role: role, content: content}
end