diff --git a/lib/ruby_llm/configuration.rb b/lib/ruby_llm/configuration.rb index c1f93ed1b..21ba190d3 100644 --- a/lib/ruby_llm/configuration.rb +++ b/lib/ruby_llm/configuration.rb @@ -14,6 +14,7 @@ class Configuration :vertexai_project_id, :vertexai_location, :deepseek_api_key, + :deepseek_api_base, :perplexity_api_key, :bedrock_api_key, :bedrock_secret_key, diff --git a/lib/ruby_llm/providers/deepseek.rb b/lib/ruby_llm/providers/deepseek.rb index 41e07bfc8..1dbcc69fd 100644 --- a/lib/ruby_llm/providers/deepseek.rb +++ b/lib/ruby_llm/providers/deepseek.rb @@ -7,7 +7,7 @@ class DeepSeek < OpenAI include DeepSeek::Chat def api_base - 'https://api.deepseek.com' + @config.deepseek_api_base || 'https://api.deepseek.com' end def headers diff --git a/spec/support/rubyllm_configuration.rb b/spec/support/rubyllm_configuration.rb index 888b3a022..2a1282b44 100644 --- a/spec/support/rubyllm_configuration.rb +++ b/spec/support/rubyllm_configuration.rb @@ -11,6 +11,7 @@ config.anthropic_api_key = ENV.fetch('ANTHROPIC_API_KEY', 'test') config.gemini_api_key = ENV.fetch('GEMINI_API_KEY', 'test') config.deepseek_api_key = ENV.fetch('DEEPSEEK_API_KEY', 'test') + config.deepseek_api_base = ENV.fetch('DEEPSEEK_API_BASE', nil) config.perplexity_api_key = ENV.fetch('PERPLEXITY_API_KEY', 'test') config.openrouter_api_key = ENV.fetch('OPENROUTER_API_KEY', 'test') config.xai_api_key = ENV.fetch('XAI_API_KEY', 'test')