Class: SwarmMemory::Tools::MemoryDelete
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- 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
71 72 73 74 |
# File 'lib/swarm_memory/tools/memory_delete.rb', line 71 def initialize(storage:) super() @storage = storage end |
Instance Method Details
#execute(file_path:) ⇒ String
Execute the tool
85 86 87 88 89 90 |
# File 'lib/swarm_memory/tools/memory_delete.rb', line 85 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"
77 78 79 |
# File 'lib/swarm_memory/tools/memory_delete.rb', line 77 def name "MemoryDelete" end |