Class: SkillBench::Services::SourcePathResolverService
- Inherits:
-
Object
- Object
- SkillBench::Services::SourcePathResolverService
- Defined in:
- lib/skill_bench/services/source_path_resolver_service.rb
Overview
Resolves the source path for context hydration.
Class Method Summary collapse
-
.call(evaluation) ⇒ String?
Resolves the source path for context hydration.
Instance Method Summary collapse
-
#call ⇒ String?
Resolves the source path for context hydration.
-
#initialize(evaluation) ⇒ SourcePathResolverService
constructor
A new instance of SourcePathResolverService.
Constructor Details
#initialize(evaluation) ⇒ SourcePathResolverService
Returns a new instance of SourcePathResolverService.
21 22 23 |
# File 'lib/skill_bench/services/source_path_resolver_service.rb', line 21 def initialize(evaluation) @evaluation = evaluation end |
Class Method Details
.call(evaluation) ⇒ String?
Resolves the source path for context hydration.
Tries the eval’s ‘source/` subdirectory first, then falls back to SourcePathResolver inference.
16 17 18 |
# File 'lib/skill_bench/services/source_path_resolver_service.rb', line 16 def self.call(evaluation) new(evaluation).call end |
Instance Method Details
#call ⇒ String?
Resolves the source path for context hydration.
Tries the eval’s ‘source/` subdirectory first, then falls back to SourcePathResolver inference.
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/skill_bench/services/source_path_resolver_service.rb', line 31 def call eval_path = @evaluation.path eval_source = File.join(eval_path, 'source') return eval_source if Dir.exist?(eval_source) sources = SkillBench::Config.skill_sources || {} inferred = Execution::SourcePathResolver.call( eval_folder_path: eval_path.to_s, skill_sources: sources ) inferred if inferred && Dir.exist?(inferred) end |