feat: Add DeepSeek provider

This commit is contained in:
Petr Mironychev
2026-05-29 12:41:18 +02:00
parent ea67ba0e2a
commit 033c0e8652
17 changed files with 212 additions and 10 deletions

View File

@@ -121,6 +121,28 @@ QVector<AIConfiguration> ConfigurationManager::getPredefinedConfigurations(
qwenMax.type = type;
qwenMax.isPredefined = true;
AIConfiguration deepSeekFlash;
deepSeekFlash.id = "preset_deepseek_flash";
deepSeekFlash.name = "DeepSeek V4 Flash";
deepSeekFlash.provider = "DeepSeek";
deepSeekFlash.model = "deepseek-v4-flash";
deepSeekFlash.url = "https://api.deepseek.com";
deepSeekFlash.customEndpoint = "";
deepSeekFlash.templateName = "OpenAI Compatible";
deepSeekFlash.type = type;
deepSeekFlash.isPredefined = true;
AIConfiguration deepSeekPro;
deepSeekPro.id = "preset_deepseek_pro";
deepSeekPro.name = "DeepSeek V4 Pro";
deepSeekPro.provider = "DeepSeek";
deepSeekPro.model = "deepseek-v4-pro";
deepSeekPro.url = "https://api.deepseek.com";
deepSeekPro.customEndpoint = "";
deepSeekPro.templateName = "OpenAI Compatible";
deepSeekPro.type = type;
deepSeekPro.isPredefined = true;
AIConfiguration gpt;
gpt.id = "preset_gpt";
gpt.name = "gpt-5.5";
@@ -141,6 +163,8 @@ QVector<AIConfiguration> ConfigurationManager::getPredefinedConfigurations(
presets.append(geminiFlash);
presets.append(qwenPlus);
presets.append(qwenMax);
presets.append(deepSeekFlash);
presets.append(deepSeekPro);
return presets;
}

View File

@@ -132,6 +132,15 @@ ProviderSettings::ProviderSettings()
qwenApiKey.setDefaultValue("");
qwenApiKey.setAutoApply(true);
// DeepSeek Settings
deepSeekApiKey.setSettingsKey(Constants::DEEPSEEK_API_KEY);
deepSeekApiKey.setLabelText(Tr::tr("DeepSeek API Key:"));
deepSeekApiKey.setDisplayStyle(Utils::StringAspect::LineEditDisplay);
deepSeekApiKey.setPlaceHolderText(Tr::tr("Enter your API key here"));
deepSeekApiKey.setHistoryCompleter(Constants::DEEPSEEK_API_KEY_HISTORY);
deepSeekApiKey.setDefaultValue("");
deepSeekApiKey.setAutoApply(true);
resetToDefaults.m_buttonText = Tr::tr("Reset Page to Defaults");
readSettings();
@@ -163,6 +172,8 @@ ProviderSettings::ProviderSettings()
Group{title(Tr::tr("llama.cpp Settings")), Column{llamaCppApiKey}},
Space{8},
Group{title(Tr::tr("Qwen (Alibaba) Settings")), Column{qwenApiKey}},
Space{8},
Group{title(Tr::tr("DeepSeek Settings")), Column{deepSeekApiKey}},
Stretch{1}};
});
}
@@ -201,6 +212,9 @@ void ProviderSettings::setupConnections()
llamaCppApiKey.writeSettings();
});
connect(&qwenApiKey, &ButtonAspect::changed, this, [this]() { qwenApiKey.writeSettings(); });
connect(&deepSeekApiKey, &ButtonAspect::changed, this, [this]() {
deepSeekApiKey.writeSettings();
});
}
void ProviderSettings::resetSettingsToDefaults()
@@ -224,6 +238,7 @@ void ProviderSettings::resetSettingsToDefaults()
resetAspect(ollamaBasicAuthApiKey);
resetAspect(llamaCppApiKey);
resetAspect(qwenApiKey);
resetAspect(deepSeekApiKey);
writeSettings();
}
}

View File

@@ -29,6 +29,7 @@ public:
Utils::StringAspect ollamaBasicAuthApiKey{this};
Utils::StringAspect llamaCppApiKey{this};
Utils::StringAspect qwenApiKey{this};
Utils::StringAspect deepSeekApiKey{this};
private:
void setupConnections();

View File

@@ -165,6 +165,8 @@ const char LLAMA_CPP_API_KEY[] = "QodeAssist.llamaCppApiKey";
const char LLAMA_CPP_API_KEY_HISTORY[] = "QodeAssist.llamaCppApiKeyHistory";
const char QWEN_API_KEY[] = "QodeAssist.qwenApiKey";
const char QWEN_API_KEY_HISTORY[] = "QodeAssist.qwenApiKeyHistory";
const char DEEPSEEK_API_KEY[] = "QodeAssist.deepSeekApiKey";
const char DEEPSEEK_API_KEY_HISTORY[] = "QodeAssist.deepSeekApiKeyHistory";
const char CLAUDE_ENABLE_PROMPT_CACHING[] = "QodeAssist.claudeEnablePromptCaching";
const char CLAUDE_USE_EXTENDED_CACHE_TTL[] = "QodeAssist.claudeUseExtendedCacheTTL";