Class: AIA::ReskillRobotTool

Inherits:
RubyLLM::Tool
  • Object
show all
Defined in:
lib/aia/tools/reskill_robot_tool.rb

Instance Method Summary collapse

Instance Method Details

#execute(name:, skills: nil, system_prompt: nil) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/aia/tools/reskill_robot_tool.rb', line 25

def execute(name:, skills: nil, system_prompt: nil)
  prompt = system_prompt.to_s.strip
  robot = AIA::Crew.reskill(
    name,
    skills:        split_skills(skills),
    system_prompt: prompt.empty? ? nil : prompt
  )
  "Reset '#{robot.name}' to a clean slate with its new role. Address it with @#{robot.name}."
rescue AIA::CrewError => e
  "Could not reskill '#{name}': #{e.message}"
end