Class: SkillBench::Migration::ProviderMigrator
- Inherits:
-
Object
- Object
- SkillBench::Migration::ProviderMigrator
- Defined in:
- lib/skill_bench/migration/provider_migrator.rb
Overview
Migrates old provider classes to new YAML-based configuration
Class Method Summary collapse
-
.migrate(providers, yaml_path = '.agent-eval.yml') ⇒ Object
Migrate providers to YAML config file.
Class Method Details
.migrate(providers, yaml_path = '.agent-eval.yml') ⇒ Object
Migrate providers to YAML config file
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/skill_bench/migration/provider_migrator.rb', line 13 def self.migrate(providers, yaml_path = '.agent-eval.yml') existing = if File.exist?(yaml_path) YAML.safe_load_file(yaml_path, permitted_classes: [], aliases: false) || {} else {} end existing['providers'] ||= {} providers.each do |name, config| existing['providers'][name.to_s] = config.transform_keys(&:to_s) end File.write(yaml_path, existing.to_yaml) end |