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.
24 25 26 27 |
# File 'lib/server/ai/client.rb', line 24 def initialize(role, content) @role = role @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
22 23 24 |
# File 'lib/server/ai/client.rb', line 22 def content @content end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
22 23 24 |
# File 'lib/server/ai/client.rb', line 22 def role @role end |
Instance Method Details
#to_h ⇒ Object
29 30 31 32 33 34 |
# File 'lib/server/ai/client.rb', line 29 def to_h { role: @role, content: @content, } end |