Class: ActiveAgent::Memory::Base
- Inherits:
-
Object
- Object
- ActiveAgent::Memory::Base
- Defined in:
- lib/active_agent/memory/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#conversation_id ⇒ Object
readonly
Returns the value of attribute conversation_id.
Instance Method Summary collapse
-
#add_message(role:, content:, **options) ⇒ Object
Adds a message to memory.
-
#clear ⇒ Object
Clears the memory for this conversation.
-
#initialize(conversation_id:) ⇒ Base
constructor
A new instance of Base.
-
#messages ⇒ Object
Returns array of message hashes: [ { role: ‘user’, content: ‘hello’ }, … ].
Constructor Details
#initialize(conversation_id:) ⇒ Base
Returns a new instance of Base.
8 9 10 |
# File 'lib/active_agent/memory/base.rb', line 8 def initialize(conversation_id:) @conversation_id = conversation_id end |
Instance Attribute Details
#conversation_id ⇒ Object (readonly)
Returns the value of attribute conversation_id.
6 7 8 |
# File 'lib/active_agent/memory/base.rb', line 6 def conversation_id @conversation_id end |
Instance Method Details
#add_message(role:, content:, **options) ⇒ Object
Adds a message to memory
19 20 21 |
# File 'lib/active_agent/memory/base.rb', line 19 def (role:, content:, **) raise NotImplementedError end |
#clear ⇒ Object
Clears the memory for this conversation
24 25 26 |
# File 'lib/active_agent/memory/base.rb', line 24 def clear raise NotImplementedError end |
#messages ⇒ Object
Returns array of message hashes:
- { role: ‘user’, content: ‘hello’ }, …
14 15 16 |
# File 'lib/active_agent/memory/base.rb', line 14 def raise NotImplementedError end |