Class: Nanobot::Agent::Tools::ScheduleRemove
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- Nanobot::Agent::Tools::ScheduleRemove
- Defined in:
- lib/nanobot/agent/tools/schedule.rb
Overview
Tool for removing scheduled tasks
Instance Method Summary collapse
- #execute(id:) ⇒ Object
-
#initialize(store:) ⇒ ScheduleRemove
constructor
A new instance of ScheduleRemove.
Constructor Details
#initialize(store:) ⇒ ScheduleRemove
Returns a new instance of ScheduleRemove.
78 79 80 81 |
# File 'lib/nanobot/agent/tools/schedule.rb', line 78 def initialize(store:) super() @store = store end |
Instance Method Details
#execute(id:) ⇒ Object
83 84 85 86 87 88 89 90 |
# File 'lib/nanobot/agent/tools/schedule.rb', line 83 def execute(id:) # Support partial ID matching schedule = @store.get(id) || @store.list.find { |s| s.id.start_with?(id) } return "Schedule not found: #{id}" unless schedule @store.remove(schedule.id) "Removed schedule #{schedule.id} (#{schedule.kind}: #{schedule.expression})" end |