Module: Roast::Tools::CodingAgent
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/roast/tools/coding_agent.rb', line 14 def included(base) base.class_eval do function( :coding_agent, "AI-powered coding agent that runs Claude Code CLI with the given prompt", prompt: { type: "string", description: "The prompt to send to Claude Code" }, ) do |params| Roast::Tools::CodingAgent.call(params[:prompt]) end end end |
Instance Method Details
#call(prompt) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/roast/tools/coding_agent.rb', line 27 def call(prompt) Roast::Helpers::Logger.info("🤖 Running CodingAgent\n") run_claude_code(prompt) rescue StandardError => e "Error running CodingAgent: #{e.}".tap do || Roast::Helpers::Logger.error( + "\n") Roast::Helpers::Logger.debug(e.backtrace.join("\n") + "\n") if ENV["DEBUG"] end end |