Class: Brute::Tools::TodoWrite

Inherits:
LLM::Tool
  • Object
show all
Defined in:
lib/brute/tools/todo_write.rb

Instance Method Summary collapse

Instance Method Details

#call(todos:) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/brute/tools/todo_write.rb', line 27

def call(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::TodoStore.replace(items)
  {success: true, count: items.size}
end