Class: Rixie::Context::Summary

Inherits:
Object
  • Object
show all
Defined in:
lib/rixie/context/summary.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#contentObject (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_messageObject



16
17
18
# File 'lib/rixie/context/summary.rb', line 16

def to_message
  [Message::System.new(content: "Previous conversation summary:\n#{@content}")]
end

#to_storeObject



20
21
22
# File 'lib/rixie/context/summary.rb', line 20

def to_store
  {"type" => "summary", "content" => @content}
end