Class: Zephira::Tools::MemoryDelete
Instance Attribute Summary
Attributes inherited from BaseTool
#agent, #args
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseTool
announces_intent?, #arg, #error_result, #initialize, read_only?, run, #success_result, #validate
Class Method Details
.description ⇒ Object
11
12
13
|
# File 'lib/zephira/tools/memory_delete.rb', line 11
def description
"Delete a named key from persistent memory."
end
|
.name ⇒ Object
7
8
9
|
# File 'lib/zephira/tools/memory_delete.rb', line 7
def name
"memory_delete"
end
|
.parameters ⇒ Object
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/zephira/tools/memory_delete.rb', line 15
def parameters
{
type: "object",
properties: {
key: {type: "string", description: "Memory key to delete"},
intent: {type: "string", description: "Brief summary of intent of the operation, meant to be used for context compaction and presentation to the user. Use active voice (e.g., 'Reading X to do Y')."}
},
required: ["key", "intent"]
}
end
|
Instance Method Details
#run ⇒ Object
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/zephira/tools/memory_delete.rb', line 27
def run
key = validate(arg(:key), arg_path: "key", type: String)
unless MemoryStore.delete(key)
return error_result(message: "Key not found: #{key}")
end
agent.status.verbose(" • Memory deleted: '#{key}'")
success_result("Memory deleted: '#{key}'")
end
|