Class: Bristow::Agents::Supervisor

Inherits:
Bristow::Agent show all
Defined in:
lib/bristow/agents/supervisor.rb

Instance Attribute Summary collapse

Attributes inherited from Bristow::Agent

#chat_history

Instance Method Summary collapse

Methods inherited from Bristow::Agent

chat, #chat, #formatted_functions, #handle_function_call

Methods included from Sgetter

included

Constructor Details

#initialize(child_agents:, agency:, custom_instructions: nil, termination: self.class.termination) ⇒ Supervisor

Returns a new instance of Supervisor.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/bristow/agents/supervisor.rb', line 27

def initialize(child_agents:, agency:, custom_instructions: nil, termination: self.class.termination)
  super()
  @custom_instructions = custom_instructions || self.class.custom_instructions
  @system_message = build_system_message(child_agents)
  @agency = agency
  @custom_instructions = custom_instructions || self.class.custom_instructions
  @termination = termination
  agency.agents << self
  @functions ||= []
  @functions << Functions::Delegate.new(self, agency)
end

Instance Attribute Details

#agencyObject (readonly)

Returns the value of attribute agency.



6
7
8
# File 'lib/bristow/agents/supervisor.rb', line 6

def agency
  @agency
end