Class: OmniAI::DeepSeek::Client
- Inherits:
 - 
      Client
      
        
- Object
 - Client
 - OmniAI::DeepSeek::Client
 
 
- Defined in:
 - lib/omniai/deepseek/client.rb
 
Overview
An DeepSeek client implementation. Usage:
w/ ‘api_key“:
client = OmniAI::DeepSeek::Client.new(api_key: '...')
w/ ENV:
ENV['DEEPSEEK_API_KEY'] = '...'
client = OmniAI::DeepSeek::Client.new
w/ config:
OmniAI::DeepSeek.configure do |config|
  config.api_key = '...'
end
client = OmniAI::DeepSeek::Client.new
  Instance Method Summary collapse
- #chat(messages = nil, model: Chat::DEFAULT_MODEL, temperature: nil, format: nil, stream: nil, tools: nil) {|prompt| ... } ⇒ OmniAI::Chat::Completion
 - #connection ⇒ HTTP::Client
 - 
  
    
      #initialize(api_key: OmniAI::DeepSeek.config.api_key, host: OmniAI::DeepSeek.config.host, logger: OmniAI::DeepSeek.config.logger, timeout: OmniAI::DeepSeek.config.timeout)  ⇒ Client 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Client.
 
Constructor Details
#initialize(api_key: OmniAI::DeepSeek.config.api_key, host: OmniAI::DeepSeek.config.host, logger: OmniAI::DeepSeek.config.logger, timeout: OmniAI::DeepSeek.config.timeout) ⇒ Client
Returns a new instance of Client.
      27 28 29 30 31 32 33 34  | 
    
      # File 'lib/omniai/deepseek/client.rb', line 27 def initialize( api_key: OmniAI::DeepSeek.config.api_key, host: OmniAI::DeepSeek.config.host, logger: OmniAI::DeepSeek.config.logger, timeout: OmniAI::DeepSeek.config.timeout ) super end  | 
  
Instance Method Details
#chat(messages = nil, model: Chat::DEFAULT_MODEL, temperature: nil, format: nil, stream: nil, tools: nil) {|prompt| ... } ⇒ OmniAI::Chat::Completion
      58 59 60  | 
    
      # File 'lib/omniai/deepseek/client.rb', line 58 def chat( = nil, model: Chat::DEFAULT_MODEL, temperature: nil, format: nil, stream: nil, tools: nil, &) Chat.process!(, model:, temperature:, format:, stream:, tools:, client: self, &) end  | 
  
#connection ⇒ HTTP::Client
      37 38 39 40 41 42 43  | 
    
      # File 'lib/omniai/deepseek/client.rb', line 37 def connection @connection ||= begin http = super http = http.auth("Bearer #{@api_key}") if @api_key http end end  |