Method: OmniAI::Client.discover

Defined in:
lib/omniai/client.rb

.discoverOmniAI::Client

Discover a client by provider (‘openai’ then ‘anthropic’ then ‘google’ then ‘mistral’ then ‘deepseek’).

Raises:



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/omniai/client.rb', line 112

def self.discover(**)
  %i[openai anthropic google mistral deepseek].each do |provider|
    return find(provider:, **)
  rescue LoadError
    next
  end

  raise LoadError, <<~TEXT
    Please run one of the following commands to install a provider specific gem:

      `gem install omniai-openai`
      `gem install omniai-anthropic`
      `gem install omniai-deepseek`
      `gem install omniai-llama`
      `gem install omniai-google`
      `gem install omniai-mistral`
  TEXT
end