Class: Anthemic::Memory::Base
- Inherits:
-
Object
- Object
- Anthemic::Memory::Base
- Defined in:
- lib/anthemic/memory/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#add(role:, content:) ⇒ void
Add a message to memory.
-
#get(query) ⇒ Array<Hash>
Get relevant messages based on a query.
-
#summarize ⇒ String
Summarize the memory contents.
-
#to_context ⇒ String
Convert memory to a context string for inclusion in prompts.
Instance Method Details
#add(role:, content:) ⇒ void
This method returns an undefined value.
Add a message to memory
11 12 13 |
# File 'lib/anthemic/memory/base.rb', line 11 def add(role:, content:) raise NotImplementedError, "Subclasses must implement #add" end |
#get(query) ⇒ Array<Hash>
Get relevant messages based on a query
19 20 21 |
# File 'lib/anthemic/memory/base.rb', line 19 def get(query) raise NotImplementedError, "Subclasses must implement #get" end |
#summarize ⇒ String
Summarize the memory contents
33 34 35 |
# File 'lib/anthemic/memory/base.rb', line 33 def summarize raise NotImplementedError, "Subclasses must implement #summarize" end |
#to_context ⇒ String
Convert memory to a context string for inclusion in prompts
26 27 28 |
# File 'lib/anthemic/memory/base.rb', line 26 def to_context raise NotImplementedError, "Subclasses must implement #to_context" end |