Module: ActiveGenie

Defined in:
lib/active_genie/ranker/tournament.rb,
lib/active_genie.rb,
lib/active_genie/lister.rb,
lib/active_genie/logger.rb,
lib/active_genie/ranker.rb,
lib/active_genie/scorer.rb,
lib/active_genie/extractor.rb,
lib/active_genie/comparator.rb,
lib/active_genie/ranker/elo.rb,
lib/active_genie/lister/feud.rb,
lib/active_genie/configuration.rb,
lib/active_genie/lister/juries.rb,
lib/active_genie/extractor/data.rb,
lib/active_genie/ranker/scoring.rb,
lib/active_genie/entities/player.rb,
lib/active_genie/entities/result.rb,
lib/active_genie/utils/text_case.rb,
lib/active_genie/comparator/fight.rb,
lib/active_genie/entities/players.rb,
lib/active_genie/extractor/litote.rb,
lib/active_genie/utils/deep_merge.rb,
lib/active_genie/comparator/debate.rb,
lib/active_genie/scorer/jury_bench.rb,
lib/active_genie/utils/base_module.rb,
lib/active_genie/configs/llm_config.rb,
lib/active_genie/configs/log_config.rb,
lib/active_genie/utils/call_wrapper.rb,
lib/active_genie/configs/base_config.rb,
lib/active_genie/ranker/free_for_all.rb,
lib/active_genie/utils/fiber_by_batch.rb,
lib/active_genie/configs/lister_config.rb,
lib/active_genie/configs/ranker_config.rb,
lib/active_genie/extractor/explanation.rb,
lib/active_genie/providers/base_provider.rb,
lib/active_genie/configs/extractor_config.rb,
lib/active_genie/configs/providers_config.rb,
lib/active_genie/providers/google_provider.rb,
lib/active_genie/providers/openai_provider.rb,
lib/active_genie/errors/invalid_model_error.rb,
lib/active_genie/providers/unified_provider.rb,
lib/active_genie/providers/deepseek_provider.rb,
lib/active_genie/errors/provider_server_error.rb,
lib/active_genie/providers/anthropic_provider.rb,
lib/active_genie/errors/invalid_provider_error.rb,
lib/active_genie/configs/providers/google_config.rb,
lib/active_genie/configs/providers/openai_config.rb,
lib/active_genie/configs/providers/provider_base.rb,
lib/active_genie/errors/invalid_log_output_error.rb,
lib/active_genie/configs/providers/deepseek_config.rb,
lib/active_genie/configs/providers/anthropic_config.rb,
lib/active_genie/errors/without_available_provider_error.rb

Overview

This class orchestrates player ranking through multiple evaluation stages using Elo ranking and free-for-all match simulations.

  1. Sets initial scores

  2. Eliminates low performers

  3. Runs Elo ranking (for large groups)

  4. Conducts free-for-all matches

Examples:

Basic usage

Ranker.tournament(players, criteria)

Returns:

  • (Hash)

    Final ranked player results

Defined Under Namespace

Modules: CallWrapper, Comparator, Config, DeepMerge, Extractor, FiberByBatch, Lister, Providers, Ranker, Scorer, TextCase Classes: BaseModule, Configuration, InvalidLogOutputError, InvalidModelError, InvalidProviderError, Logger, ProviderServerError, Result, WithoutAvailableProviderError

Constant Summary collapse

VERSION =
File.read(File.expand_path('../VERSION', __dir__)).strip

Class Method Summary collapse

Class Method Details

.configurationObject



24
25
26
# File 'lib/active_genie.rb', line 24

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



20
21
22
# File 'lib/active_genie.rb', line 20

def configure
  yield(configuration) if block_given?
end

.load_tasksObject



40
41
42
43
44
45
# File 'lib/active_genie.rb', line 40

def load_tasks
  return unless defined?(Rake)

  Rake::Task.define_task(:environment)
  Dir.glob(File.join(__dir__, 'tasks', '*.rake')).each { |r| load r }
end

.loggerObject



36
37
38
# File 'lib/active_genie.rb', line 36

def logger
  @logger ||= Logger.new
end

.new_configuration(new_config) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/active_genie.rb', line 28

def new_configuration(new_config)
  return new_config if new_config.instance_of?(Configuration)

  Configuration.new(
    DeepMerge.call(@configuration.to_h, new_config)
  )
end