Class: LLM::DeepSeek

Inherits:
OpenAI show all
Defined in:
lib/llm/providers/deepseek.rb,
lib/llm/providers/deepseek/format.rb

Overview

The DeepSeek class implements a provider for DeepSeek through its OpenAI-compatible API available via their web platform.

Examples:

#!/usr/bin/env ruby
require "llm"

llm = LLM.deepseek(key: ENV["KEY"])
bot = LLM::Bot.new(llm)
bot.chat ["Tell me about this photo", File.open("/images/cat.jpg", "rb")]
bot.messages.select(&:assistant?).each { print "[#{_1.role}]", _1.content, "\n" }

Constant Summary

Constants inherited from OpenAI

OpenAI::HOST

Instance Method Summary collapse

Methods inherited from OpenAI

#assistant_role, #complete, #embed, #models

Methods inherited from Provider

#assistant_role, #chat, #chat!, #complete, #embed, #inspect, #models, #respond, #respond!, #schema, #with

Constructor Details

#initialize(host: "api.deepseek.com", port: 443, ssl: true) ⇒ LLM::DeepSeek

Parameters:

  • key (String, nil)

    The secret key for authentication

  • host (String) (defaults to: "api.deepseek.com")

    The host address of the LLM provider

  • port (Integer) (defaults to: 443)

    The port number

  • timeout (Integer)

    The number of seconds to wait for a response

  • ssl (Boolean) (defaults to: true)

    Whether to use SSL for the connection



27
28
29
# File 'lib/llm/providers/deepseek.rb', line 27

def initialize(host: "api.deepseek.com", port: 443, ssl: true, **)
  super
end

Instance Method Details

#default_modelString

Returns the default model for chat completions

Returns:

  • (String)

See Also:



71
72
73
# File 'lib/llm/providers/deepseek.rb', line 71

def default_model
  "deepseek-chat"
end

#filesObject

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/llm/providers/deepseek.rb', line 33

def files
  raise NotImplementedError
end

#imagesObject

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/llm/providers/deepseek.rb', line 39

def images
  raise NotImplementedError
end

#audioObject

Raises:

  • (NotImplementedError)


45
46
47
# File 'lib/llm/providers/deepseek.rb', line 45

def audio
  raise NotImplementedError
end

#moderationsObject

Raises:

  • (NotImplementedError)


51
52
53
# File 'lib/llm/providers/deepseek.rb', line 51

def moderations
  raise NotImplementedError
end

#responsesObject

Raises:

  • (NotImplementedError)


57
58
59
# File 'lib/llm/providers/deepseek.rb', line 57

def responses
  raise NotImplementedError
end

#vector_storesObject

Raises:

  • (NotImplementedError)


63
64
65
# File 'lib/llm/providers/deepseek.rb', line 63

def vector_stores
  raise NotImplementedError
end