Class: SkillBench::Services::ProviderResolver

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

Overview

Resolves the provider and its configuration.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.callHash

Resolves the provider and its configuration.

Returns:

  • (Hash)

    Result with keys:

    • success: Boolean indicating if resolution succeeded

    • provider: The resolved provider instance

    • config: The merged provider config (if successful)

    • error: The error object (if failed)



21
22
23
# File 'lib/skill_bench/services/provider_resolver.rb', line 21

def self.call
  new.call
end

Instance Method Details

#callHash

Resolves the provider and its configuration.

Returns:

  • (Hash)

    Result with keys:

    • success: Boolean indicating if resolution succeeded

    • provider: The resolved provider instance

    • config: The merged provider config (if successful)

    • error: The error object (if failed)



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/skill_bench/services/provider_resolver.rb', line 32

def call
  provider = resolve_provider
  config_result = resolve_provider_config(provider)

  if config_result[:success]
    {
      success: true,
      provider: provider,
      config: config_result[:config]
    }
  else
    {
      success: false,
      provider: provider,
      error: config_result[:error]
    }
  end
end