class OmniAI::DeepSeek::Client

client = OmniAI::DeepSeek::Client.new
end
config.api_key = ‘…’
OmniAI::DeepSeek.configure do |config|
w/ config:
client = OmniAI::DeepSeek::Client.new<br>ENV = ‘…’
w/ ENV:
client = OmniAI::DeepSeek::Client.new(api_key: ‘…’)
w/ ‘api_key“:
An DeepSeek client implementation. Usage:

def chat(messages = nil, model: Chat::DEFAULT_MODEL, temperature: nil, format: nil, stream: nil, tools: nil, &)

Returns:
  • (OmniAI::Chat::Completion) -

Other tags:
    Yieldparam: prompt -

Other tags:
    Yield: -

Parameters:
  • tools (Array, nil) -- optional
  • stream (Proc, nil) -- optional
  • temperature (Float, nil) -- optional
  • format (Symbol) -- optional :text or :json
  • model (String) -- optional
  • messages (String) -- optional

Raises:
  • (OmniAI::Error) -
def chat(messages = nil, model: Chat::DEFAULT_MODEL, temperature: nil, format: nil, stream: nil, tools: nil, &)
  Chat.process!(messages, model:, temperature:, format:, stream:, tools:, client: self, &)
end

def connection

Returns:
  • (HTTP::Client) -
def connection
  @connection ||= begin
    http = super
    http = http.auth("Bearer #{@api_key}") if @api_key
    http
  end
end

def initialize(

Parameters:
  • timeout (Integer, nil) -- optional - defaults to `OmniAI::DeepSeek.config.timeout`
  • logger (Logger, nil) -- optional - defaults to `OmniAI::DeepSeek.config.logger`
  • host (String) -- optional - defaults to `OmniAI::DeepSeek.config.host`
  • api_key (String, nil) -- optional - defaults to `OmniAI::DeepSeek.config.api_key`
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