Sha256: 20ceafdd0c82bacba8280d557cd9695e22299ca595ed8a6a4beabbb4323aec2e

Contents?: true

Size: 857 Bytes

Versions: 6

Compression:

Stored size: 857 Bytes

Contents

module OpenAISwarm
  module Agents
    class StrategyOptions
      attr_accessor :switch_agent_reset_message,
                    :prevent_agent_reentry

      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
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-openai-swarm-0.5.1 lib/ruby-openai-swarm/agents/strategy_options.rb
ruby-openai-swarm-0.5.0 lib/ruby-openai-swarm/agents/strategy_options.rb
ruby-openai-swarm-0.4.0.2 lib/ruby-openai-swarm/agents/strategy_options.rb
ruby-openai-swarm-0.4.0.1 lib/ruby-openai-swarm/agents/strategy_options.rb
ruby-openai-swarm-0.4.0 lib/ruby-openai-swarm/agents/strategy_options.rb
ruby-openai-swarm-0.3.1 lib/ruby-openai-swarm/agents/strategy_options.rb