Class: SkillBench::Clients::ProviderConfig
- Inherits:
-
Object
- Object
- SkillBench::Clients::ProviderConfig
- Defined in:
- lib/skill_bench/clients/provider_config.rb
Overview
Service object to load and validate provider configuration.
Class Method Summary collapse
-
.call(provider:, options: {}) ⇒ Hash
Standardized configuration.
Instance Method Summary collapse
-
#call ⇒ Hash
Loads and returns standardized provider configuration.
-
#initialize(provider, options) ⇒ ProviderConfig
constructor
A new instance of ProviderConfig.
Constructor Details
#initialize(provider, options) ⇒ ProviderConfig
Returns a new instance of ProviderConfig.
16 17 18 19 20 |
# File 'lib/skill_bench/clients/provider_config.rb', line 16 def initialize(provider, ) @provider = provider.to_sym @options = @config = SkillBench::Config.for_provider(@provider) || {} end |
Class Method Details
.call(provider:, options: {}) ⇒ Hash
Returns standardized configuration.
12 13 14 |
# File 'lib/skill_bench/clients/provider_config.rb', line 12 def self.call(provider:, options: {}) new(provider, ).call end |
Instance Method Details
#call ⇒ Hash
Loads and returns standardized provider configuration.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/skill_bench/clients/provider_config.rb', line 25 def call { api_key: fetch_config(:api_key), model: fetch_config(:model), base_url: fetch_config(:base_url), request_path: fetch_config(:request_path), provider_name: @provider.to_s.capitalize, # Provider-specific extras (nil when not present) endpoint: fetch_config(:endpoint), location: fetch_config(:location), project_id: fetch_config(:project_id), api_version: fetch_config(:api_version) } end |