Class: RobotLab::TextMessage
- Defined in:
- lib/robot_lab/message.rb
Overview
Text message from system, user, or assistant
Constant Summary
Constants inherited from Message
Message::VALID_ROLES, Message::VALID_STOP_REASONS, Message::VALID_TYPES
Instance Attribute Summary
Attributes inherited from Message
#content, #role, #stop_reason, #type
Instance Method Summary collapse
-
#initialize(role:, content:, stop_reason: nil) ⇒ TextMessage
constructor
Creates a new TextMessage instance.
Methods inherited from Message
#assistant?, from_hash, #stopped?, #system?, #text?, #to_h, #to_json, #tool_call?, #tool_result?, #tool_stop?, #user?
Constructor Details
#initialize(role:, content:, stop_reason: nil) ⇒ TextMessage
Creates a new TextMessage instance.
153 154 155 |
# File 'lib/robot_lab/message.rb', line 153 def initialize(role:, content:, stop_reason: nil) super(type: "text", role: role, content: content, stop_reason: stop_reason) end |