Class: Brute::Tools::TodoWrite
Instance Method Summary
collapse
Methods inherited from Brute::Tool
#call, description, #description, param, param_definitions, params, #params, #params_schema
Instance Method Details
#execute(todos:) ⇒ Object
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/brute/tools/todo_write.rb', line 36
def execute(todos:)
items = todos.map do |t|
if t.is_a?(Hash)
t = t.transform_keys(&:to_sym)
end
{id: t[:id], content: t[:content], status: t[:status]}
end
Brute::Tools::TodoList::Store.replace(items)
{success: true, count: items.size}
end
|
#name ⇒ Object
34
|
# File 'lib/brute/tools/todo_write.rb', line 34
def name; "todo_write"; end
|