Class: FuncBot::Bots::History
- Inherits:
-
Object
- Object
- FuncBot::Bots::History
- Defined in:
- lib/func_bot/bots/history.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
Returns the value of attribute messages.
Instance Method Summary collapse
- #chronicle(role, prompt, name = nil) ⇒ Object
-
#initialize ⇒ History
constructor
A new instance of History.
- #payload ⇒ Object
Constructor Details
#initialize ⇒ History
Returns a new instance of History.
6 7 8 |
# File 'lib/func_bot/bots/history.rb', line 6 def initialize @messages = [] end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
4 5 6 |
# File 'lib/func_bot/bots/history.rb', line 4 def @messages end |
Instance Method Details
#chronicle(role, prompt, name = nil) ⇒ Object
10 11 12 |
# File 'lib/func_bot/bots/history.rb', line 10 def chronicle(role, prompt, name = nil) << Message.new(role, prompt, name) end |
#payload ⇒ Object
14 15 16 |
# File 'lib/func_bot/bots/history.rb', line 14 def payload .map(&:data) end |