Class: SkillBench::Services::EvalResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/services/eval_resolver.rb

Overview

Resolves an eval from a name or path.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(eval_name) ⇒ EvalResolver

Returns a new instance of EvalResolver.

Parameters:

  • eval_name (String)

    Name or path of the eval



19
20
21
# File 'lib/skill_bench/services/eval_resolver.rb', line 19

def initialize(eval_name)
  @eval_name = eval_name
end

Class Method Details

.call(eval_name) ⇒ SkillBench::Models::Eval

Resolves an eval from a name or path.

Parameters:

  • eval_name (String)

    Name or path of the eval to resolve

Returns:

Raises:

  • (Errno::ENOENT)

    when the eval directory does not exist



14
15
16
# File 'lib/skill_bench/services/eval_resolver.rb', line 14

def self.call(eval_name)
  new(eval_name).call
end

Instance Method Details

#callSkillBench::Models::Eval

Resolves the eval from the name or path.

Returns:

Raises:

  • (Errno::ENOENT)

    when the eval directory does not exist



27
28
29
30
# File 'lib/skill_bench/services/eval_resolver.rb', line 27

def call
  eval_path = @eval_name.include?('/') ? @eval_name : "evals/#{@eval_name}"
  SkillBench::Models::Eval.load(eval_path)
end