Class: SentinelRb::Client::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/sentinel_rb/client.rb

Overview

Factory for creating LLM client instances

Class Method Summary collapse

Class Method Details

.create(config) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sentinel_rb/client.rb', line 11

def self.create(config)
  provider = config.provider

  case provider
  when "openai"
    OpenAI.new(config)
  when "mock"
    Mock.new(config)
  else
    raise ArgumentError, "Unsupported provider: #{provider}. Supported providers: openai, mock"
  end
end