Class: Rixie::Context::Summary
- Inherits:
-
Object
- Object
- Rixie::Context::Summary
- Defined in:
- lib/rixie/context/summary.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(content:) ⇒ Summary
constructor
A new instance of Summary.
- #to_message ⇒ Object
- #to_store ⇒ Object
Constructor Details
#initialize(content:) ⇒ Summary
Returns a new instance of Summary.
8 9 10 |
# File 'lib/rixie/context/summary.rb', line 8 def initialize(content:) @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
6 7 8 |
# File 'lib/rixie/context/summary.rb', line 6 def content @content end |
Class Method Details
.from_store(entry) ⇒ Object
12 13 14 |
# File 'lib/rixie/context/summary.rb', line 12 def self.from_store(entry) new(content: entry["content"]) end |
Instance Method Details
#to_message ⇒ Object
16 17 18 |
# File 'lib/rixie/context/summary.rb', line 16 def [Message::System.new(content: "Previous conversation summary:\n#{@content}")] end |
#to_store ⇒ Object
20 21 22 |
# File 'lib/rixie/context/summary.rb', line 20 def to_store {"type" => "summary", "content" => @content} end |