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.



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

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



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

def content
  @content
end

#roleObject (readonly)

Returns the value of attribute role.



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

def role
  @role
end

Instance Method Details

#to_hObject



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

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