Class: Deepseek::Client
- Inherits:
-
Object
- Object
- Deepseek::Client
- Defined in:
- lib/deepseek/client.rb
Class Method Summary collapse
Instance Method Summary collapse
- #chat_completions(params) ⇒ Object
- #fim_completions(params) ⇒ Object
-
#initialize(api_key = nil, url = DEFAULT_URL) ⇒ Client
constructor
A new instance of Client.
- #models ⇒ Object
- #user_balance ⇒ Object
Constructor Details
#initialize(api_key = nil, url = DEFAULT_URL) ⇒ Client
Returns a new instance of Client.
10 11 12 13 |
# File 'lib/deepseek/client.rb', line 10 def initialize(api_key = nil, url = DEFAULT_URL) @api_key = api_key || ENV.fetch("DEEPSEEK_API_KEY") @url = url end |
Class Method Details
.beta ⇒ Object
15 16 17 |
# File 'lib/deepseek/client.rb', line 15 def self.beta new(nil, BETA_URL) end |
Instance Method Details
#chat_completions(params) ⇒ Object
19 20 21 |
# File 'lib/deepseek/client.rb', line 19 def chat_completions(params) handle_response(conn.post("chat/completions", params)) end |
#fim_completions(params) ⇒ Object
23 24 25 |
# File 'lib/deepseek/client.rb', line 23 def fim_completions(params) handle_response(conn.post("completions", params)) end |
#models ⇒ Object
27 28 29 |
# File 'lib/deepseek/client.rb', line 27 def models handle_response(conn.get("models")) end |
#user_balance ⇒ Object
31 32 33 |
# File 'lib/deepseek/client.rb', line 31 def user_balance handle_response(conn.get("user/balance")) end |