Class: LaunchDarkly::Server::AI::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/server/ai/client.rb

Overview

Holds AI role and content.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(role, content) ⇒ Message

Returns a new instance of Message.



23
24
25
26
# File 'lib/server/ai/client.rb', line 23

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



21
22
23
# File 'lib/server/ai/client.rb', line 21

def content
  @content
end

#roleObject (readonly)

Returns the value of attribute role.



21
22
23
# File 'lib/server/ai/client.rb', line 21

def role
  @role
end

Instance Method Details

#to_hObject



28
29
30
31
32
33
# File 'lib/server/ai/client.rb', line 28

def to_h
  {
    role: @role,
    content: @content,
  }
end