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.
19 20 21 22 23 |
# File 'lib/skill_bench/clients/provider_config.rb', line 19 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.
13 14 15 |
# File 'lib/skill_bench/clients/provider_config.rb', line 13 def self.call(provider:, options: {}) new(provider, ).call end |
Instance Method Details
#call ⇒ Hash
Loads and returns standardized provider configuration.
The resolved transport URLs (base_url and, for Azure, endpoint) are
validated before being returned: they must be absolute http(s) URLs, and
a credential is never sent over cleartext http to a non-loopback host.
34 35 36 37 |
# File 'lib/skill_bench/clients/provider_config.rb', line 34 def call validate_transport_urls! standardized_config end |