Class: AIA::TaskExecutor
- Inherits:
-
Object
- Object
- AIA::TaskExecutor
- Includes:
- ContentExtractor
- Defined in:
- lib/aia/task_executor.rb
Instance Method Summary collapse
-
#execute(task, robot, step_def, prompt, prior_results) ⇒ String
Execute a single task step against the assigned robot.
-
#initialize(task_coordinator:) ⇒ TaskExecutor
constructor
A new instance of TaskExecutor.
Methods included from ContentExtractor
#extract_content, #extract_network_content, #format_duration, #output_to_file, #present_result, #store_results_in_memory
Constructor Details
#initialize(task_coordinator:) ⇒ TaskExecutor
Returns a new instance of TaskExecutor.
13 14 15 |
# File 'lib/aia/task_executor.rb', line 13 def initialize(task_coordinator:) @coordinator = task_coordinator end |
Instance Method Details
#execute(task, robot, step_def, prompt, prior_results) ⇒ String
Execute a single task step against the assigned robot.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/aia/task_executor.rb', line 25 def execute(task, robot, step_def, prompt, prior_results) @coordinator.claim_task(task.id, robot.name) context = build_step_context(prompt, step_def[:title], prior_results) result = robot.run(context, mcp: :inherit, tools: :inherit) content = extract_content(result) @coordinator.complete_task(task.id, result: content[0, 200], robot_name: robot.name) content end |