Class: SwarmMemory::Tools::MemoryDelete
- Inherits:
-
SwarmSDK::Tools::Base
- Object
- SwarmSDK::Tools::Base
- SwarmMemory::Tools::MemoryDelete
- Defined in:
- lib/swarm_memory/tools/memory_delete.rb
Overview
Tool for deleting content from memory storage
Removes entries that are no longer relevant. Each agent has its own isolated memory storage.
Instance Method Summary collapse
-
#execute(file_path:) ⇒ String
Execute the tool.
-
#initialize(storage:) ⇒ MemoryDelete
constructor
Initialize with storage instance.
-
#name ⇒ Object
Override name to return simple "MemoryDelete".
Constructor Details
#initialize(storage:) ⇒ MemoryDelete
Initialize with storage instance
72 73 74 75 |
# File 'lib/swarm_memory/tools/memory_delete.rb', line 72 def initialize(storage:) super() @storage = storage end |
Instance Method Details
#execute(file_path:) ⇒ String
Execute the tool
86 87 88 89 90 91 |
# File 'lib/swarm_memory/tools/memory_delete.rb', line 86 def execute(file_path:) @storage.delete(file_path: file_path) "Deleted memory://#{file_path}" rescue ArgumentError => e validation_error(e.) end |
#name ⇒ Object
Override name to return simple "MemoryDelete"
78 79 80 |
# File 'lib/swarm_memory/tools/memory_delete.rb', line 78 def name "MemoryDelete" end |