Class: LaunchDarkly::Server::AI::Message
- Inherits:
-
Object
- Object
- LaunchDarkly::Server::AI::Message
- Defined in:
- lib/server/ai/client.rb
Overview
Holds AI role and content.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
-
#initialize(role, content) ⇒ Message
constructor
A new instance of Message.
- #to_h ⇒ Object
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
#content ⇒ Object (readonly)
Returns the value of attribute content.
20 21 22 |
# File 'lib/server/ai/client.rb', line 20 def content @content end |
#role ⇒ Object (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_h ⇒ Object
27 28 29 30 31 32 |
# File 'lib/server/ai/client.rb', line 27 def to_h { role: @role, content: @content, } end |