Class: RailsAi::Agents::TechnicalAgent
- Defined in:
- lib/rails_ai/agents/specialized_agents.rb
Overview
Technical Agent - Specialized in technical tasks and problem-solving
Instance Attribute Summary
Attributes inherited from BaseAgent
#active_tasks, #capabilities, #completed_tasks, #created_at, #failed_tasks, #last_activity, #memory, #name, #role, #state
Instance Method Summary collapse
- #code_review(code, language: :ruby) ⇒ Object
- #design_system(requirements) ⇒ Object
-
#initialize(name: "TechnicalAgent", **opts) ⇒ TechnicalAgent
constructor
A new instance of TechnicalAgent.
- #solve_problem(problem_description, approach: :systematic) ⇒ Object
Methods inherited from BaseAgent
#accept_delegated_task, #assign_task, #can_handle_task?, #collaborate_with, #complete_task, #decide_next_action, #delegate_task, #fail_task, #forget, #get_messages, #has_capability?, #health_check, #pause!, #recall, #receive_message, #remember, #resume!, #send_message, #start!, #status, #stop!, #think
Constructor Details
#initialize(name: "TechnicalAgent", **opts) ⇒ TechnicalAgent
Returns a new instance of TechnicalAgent.
183 184 185 186 187 188 189 190 |
# File 'lib/rails_ai/agents/specialized_agents.rb', line 183 def initialize(name: "TechnicalAgent", **opts) super( name: name, role: "Technical Specialist", capabilities: [:programming, :debugging, :system_design, :troubleshooting], **opts ) end |
Instance Method Details
#code_review(code, language: :ruby) ⇒ Object
202 203 204 205 206 207 208 209 210 |
# File 'lib/rails_ai/agents/specialized_agents.rb', line 202 def code_review(code, language: :ruby) return "[stubbed] Code review for #{language} code" if RailsAi.config.stub_responses review_prompt = build_code_review_prompt(code, language) result = think(review_prompt, context: { code: code, language: language }) remember("code_review_#{code.hash}", result, importance: :normal) result end |
#design_system(requirements) ⇒ Object
212 213 214 215 216 217 218 219 220 |
# File 'lib/rails_ai/agents/specialized_agents.rb', line 212 def design_system(requirements) return "[stubbed] System design for: #{requirements}" if RailsAi.config.stub_responses design_prompt = build_system_design_prompt(requirements) result = think(design_prompt, context: { requirements: requirements }) remember("system_design_#{requirements.hash}", result, importance: :high) result end |
#solve_problem(problem_description, approach: :systematic) ⇒ Object
192 193 194 195 196 197 198 199 200 |
# File 'lib/rails_ai/agents/specialized_agents.rb', line 192 def solve_problem(problem_description, approach: :systematic) return "[stubbed] Solution for: #{problem_description}" if RailsAi.config.stub_responses problem_prompt = build_problem_solving_prompt(problem_description, approach) result = think(problem_prompt, context: { problem: problem_description, approach: approach }) remember("solution_#{problem_description.hash}", result, importance: :high) result end |