Class: RCrewAI::Process::Hierarchical

Inherits:
Base
  • Object
show all
Defined in:
lib/rcrewai/process.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#crew, #logger

Instance Method Summary collapse

Constructor Details

#initialize(crew) ⇒ Hierarchical

Returns a new instance of Hierarchical.



55
56
57
58
59
60
# File 'lib/rcrewai/process.rb', line 55

def initialize(crew)
  super
  @manager_agent = find_or_create_manager
  @hierarchy = build_hierarchy
  validate_hierarchy!
end

Instance Attribute Details

#hierarchyObject (readonly)

Returns the value of attribute hierarchy.



53
54
55
# File 'lib/rcrewai/process.rb', line 53

def hierarchy
  @hierarchy
end

#manager_agentObject (readonly)

Returns the value of attribute manager_agent.



53
54
55
# File 'lib/rcrewai/process.rb', line 53

def manager_agent
  @manager_agent
end

Instance Method Details

#executeObject



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/rcrewai/process.rb', line 62

def execute
  log_execution_start
  @logger.info "Hierarchical execution with manager: #{manager_agent.name}"

  # Manager coordinates all execution
  execution_plan = create_execution_plan
  results = execute_with_manager(execution_plan)

  log_execution_end(results)
  results
end