Class: MCP::Prompt::Message
- Inherits:
-
Object
- Object
- MCP::Prompt::Message
- Defined in:
- lib/mcp/prompt/message.rb
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
8 9 10 11 |
# File 'lib/mcp/prompt/message.rb', line 8 def initialize(role:, content:) @role = role @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
6 7 8 |
# File 'lib/mcp/prompt/message.rb', line 6 def content @content end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
6 7 8 |
# File 'lib/mcp/prompt/message.rb', line 6 def role @role end |
Instance Method Details
#to_h ⇒ Object
13 14 15 |
# File 'lib/mcp/prompt/message.rb', line 13 def to_h { role:, content: content.to_h }.compact end |