Class: OpenAISwarm::Agents::StrategyOptions
- Inherits:
-
Object
- Object
- OpenAISwarm::Agents::StrategyOptions
- Defined in:
- lib/ruby-openai-swarm/agents/strategy_options.rb
Instance Attribute Summary collapse
-
#prevent_agent_reentry ⇒ Object
Returns the value of attribute prevent_agent_reentry.
-
#switch_agent_reset_message ⇒ Object
Returns the value of attribute switch_agent_reset_message.
Instance Method Summary collapse
-
#initialize(strategy = {}) ⇒ StrategyOptions
constructor
A new instance of StrategyOptions.
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 = {}) = 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_reentry ⇒ Object
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_message ⇒ Object
Returns the value of attribute switch_agent_reset_message.
4 5 6 |
# File 'lib/ruby-openai-swarm/agents/strategy_options.rb', line 4 def end |