Class: OpenAISwarm::Agents::StrategyOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-openai-swarm/agents/strategy_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(strategy = {}) ⇒ StrategyOptions

Returns a new instance of StrategyOptions.



7
8
9
10
11
12
13
14
15
# File 'lib/ruby-openai-swarm/agents/strategy_options.rb', line 7

def initialize(strategy = {})
  @switch_agent_reset_message = strategy[:switch_agent_reset_message] || false
  # INFO:
  # 1. When `prevent_agent_reentry` is false, LLM is used to control the agent's jump.
  #    - In this case, there is a possibility of an infinite loop, so additional mechanisms (e.g., jump count limit) are needed to avoid it.
  # 2. When `prevent_agent_reentry` is true, it prevents the agent from being called again if it has already been called.
  #    - In this case, if an agent has already been called, it will not be called again.
  @prevent_agent_reentry = strategy[:prevent_agent_reentry] || false
end

Instance Attribute Details

#prevent_agent_reentryObject

Returns the value of attribute prevent_agent_reentry.



4
5
6
# File 'lib/ruby-openai-swarm/agents/strategy_options.rb', line 4

def prevent_agent_reentry
  @prevent_agent_reentry
end

#switch_agent_reset_messageObject

Returns the value of attribute switch_agent_reset_message.



4
5
6
# File 'lib/ruby-openai-swarm/agents/strategy_options.rb', line 4

def switch_agent_reset_message
  @switch_agent_reset_message
end