Class: Brute::Tools::TodoWrite
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- Brute::Tools::TodoWrite
- Defined in:
- lib/brute/tools/todo_write.rb
Instance Method Summary collapse
Instance Method Details
#execute(todos:) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/brute/tools/todo_write.rb', line 34 def execute(todos:) items = todos.map do |t| t = t.transform_keys(&:to_sym) if t.is_a?(Hash) {id: t[:id], content: t[:content], status: t[:status]} end Brute::Store::TodoStore.replace(items) {success: true, count: items.size} end |
#name ⇒ Object
32 |
# File 'lib/brute/tools/todo_write.rb', line 32 def name; "todo_write"; end |