Class: LLM::DeepSeek
- Includes:
- DeepSeek::RequestAdapter
- Defined in:
- lib/llm/providers/deepseek.rb,
lib/llm/providers/deepseek/files.rb,
lib/llm/providers/deepseek/images.rb,
lib/llm/providers/deepseek/request_adapter.rb,
lib/llm/providers/deepseek/response_adapter.rb
Overview
The DeepSeek class implements a provider for DeepSeek through its OpenAI-compatible API available via their web platform.
Defined Under Namespace
Constant Summary
Constants inherited from OpenAI
Instance Method Summary collapse
- #retry_errors ⇒ Array<Exception>
-
#name ⇒ Symbol
Returns the provider's name.
-
#files ⇒ LLM::DeepSeek::Files
Provides an interface to DeepSeek's files API.
- #images ⇒ Object
- #audio ⇒ Object
- #moderations ⇒ Object
- #responses ⇒ Object
- #vector_stores ⇒ Object
-
#default_model ⇒ String
Returns the default model for chat completions.
- #initialize(host: "api.deepseek.com", port: 443, ssl: true) ⇒ LLM::DeepSeek constructor
Methods inherited from OpenAI
#adapt_function, #complete, #embed, #models, #server_tools, #web_search
Methods inherited from Provider
#adapt_function, #assistant_role, #build_messages, #chat, #complete, #developer_role, #embed, #host, #inspect, #interrupt!, #key?, #models, #ocr, #port, #registry, #request_owner, #respond, #retry_budget, #schema, #server_tool, #server_tools, #system_role, #tool_role, #tracer, #tracer=, #user_role, #web_search, #with, #with_tracer
Constructor Details
#initialize(host: "api.deepseek.com", port: 443, ssl: true) ⇒ LLM::DeepSeek
30 31 32 |
# File 'lib/llm/providers/deepseek.rb', line 30 def initialize(host: "api.deepseek.com", port: 443, ssl: true, **) super end |
Instance Method Details
#retry_errors ⇒ Array<Exception>
This method extends the default errors that are retried to include LLM::ServerError - a common error that DeepSeek returns when it is overloaded.
94 95 96 |
# File 'lib/llm/providers/deepseek.rb', line 94 def retry_errors super.concat [LLM::ServerError] end |
#name ⇒ Symbol
Returns the provider's name
37 38 39 |
# File 'lib/llm/providers/deepseek.rb', line 37 def name :deepseek end |
#files ⇒ LLM::DeepSeek::Files
Provides an interface to DeepSeek's files API
45 46 47 |
# File 'lib/llm/providers/deepseek.rb', line 45 def files LLM::DeepSeek::Files.new(self) end |
#images ⇒ Object
51 52 53 |
# File 'lib/llm/providers/deepseek.rb', line 51 def images LLM::DeepSeek::Images.new(self) end |
#audio ⇒ Object
57 58 59 |
# File 'lib/llm/providers/deepseek.rb', line 57 def audio raise NotImplementedError end |
#moderations ⇒ Object
63 64 65 |
# File 'lib/llm/providers/deepseek.rb', line 63 def moderations raise NotImplementedError end |
#responses ⇒ Object
69 70 71 |
# File 'lib/llm/providers/deepseek.rb', line 69 def responses raise NotImplementedError end |
#vector_stores ⇒ Object
75 76 77 |
# File 'lib/llm/providers/deepseek.rb', line 75 def vector_stores raise NotImplementedError end |
#default_model ⇒ String
Returns the default model for chat completions
83 84 85 |
# File 'lib/llm/providers/deepseek.rb', line 83 def default_model "deepseek-flash" end |