mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 10:59:30 -04:00
feat: Add Qwen provider
This commit is contained in:
@@ -99,6 +99,28 @@ QVector<AIConfiguration> ConfigurationManager::getPredefinedConfigurations(
|
||||
geminiFlash.type = type;
|
||||
geminiFlash.isPredefined = true;
|
||||
|
||||
AIConfiguration qwenPlus;
|
||||
qwenPlus.id = "preset_qwen_plus";
|
||||
qwenPlus.name = "Qwen3.6 Plus";
|
||||
qwenPlus.provider = "Qwen (OpenAI Response)";
|
||||
qwenPlus.model = "qwen3.6-plus";
|
||||
qwenPlus.url = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1";
|
||||
qwenPlus.customEndpoint = "";
|
||||
qwenPlus.templateName = "OpenAI Responses";
|
||||
qwenPlus.type = type;
|
||||
qwenPlus.isPredefined = true;
|
||||
|
||||
AIConfiguration qwenMax;
|
||||
qwenMax.id = "preset_qwen_max";
|
||||
qwenMax.name = "Qwen3.7 Max";
|
||||
qwenMax.provider = "Qwen (OpenAI Response)";
|
||||
qwenMax.model = "qwen3.7-max";
|
||||
qwenMax.url = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1";
|
||||
qwenMax.customEndpoint = "";
|
||||
qwenMax.templateName = "OpenAI Responses";
|
||||
qwenMax.type = type;
|
||||
qwenMax.isPredefined = true;
|
||||
|
||||
AIConfiguration gpt;
|
||||
gpt.id = "preset_gpt";
|
||||
gpt.name = "gpt-5.5";
|
||||
@@ -117,6 +139,8 @@ QVector<AIConfiguration> ConfigurationManager::getPredefinedConfigurations(
|
||||
presets.append(codestral);
|
||||
presets.append(mistral);
|
||||
presets.append(geminiFlash);
|
||||
presets.append(qwenPlus);
|
||||
presets.append(qwenMax);
|
||||
|
||||
return presets;
|
||||
}
|
||||
|
||||
@@ -123,6 +123,15 @@ ProviderSettings::ProviderSettings()
|
||||
llamaCppApiKey.setDefaultValue("");
|
||||
llamaCppApiKey.setAutoApply(true);
|
||||
|
||||
// Qwen (Alibaba) Settings
|
||||
qwenApiKey.setSettingsKey(Constants::QWEN_API_KEY);
|
||||
qwenApiKey.setLabelText(Tr::tr("Qwen API Key:"));
|
||||
qwenApiKey.setDisplayStyle(Utils::StringAspect::LineEditDisplay);
|
||||
qwenApiKey.setPlaceHolderText(Tr::tr("Enter your API key here"));
|
||||
qwenApiKey.setHistoryCompleter(Constants::QWEN_API_KEY_HISTORY);
|
||||
qwenApiKey.setDefaultValue("");
|
||||
qwenApiKey.setAutoApply(true);
|
||||
|
||||
resetToDefaults.m_buttonText = Tr::tr("Reset Page to Defaults");
|
||||
|
||||
readSettings();
|
||||
@@ -152,6 +161,8 @@ ProviderSettings::ProviderSettings()
|
||||
Group{title(Tr::tr("Ollama Settings")), Column{ollamaBasicAuthApiKey}},
|
||||
Space{8},
|
||||
Group{title(Tr::tr("llama.cpp Settings")), Column{llamaCppApiKey}},
|
||||
Space{8},
|
||||
Group{title(Tr::tr("Qwen (Alibaba) Settings")), Column{qwenApiKey}},
|
||||
Stretch{1}};
|
||||
});
|
||||
}
|
||||
@@ -189,6 +200,7 @@ void ProviderSettings::setupConnections()
|
||||
connect(&llamaCppApiKey, &ButtonAspect::changed, this, [this]() {
|
||||
llamaCppApiKey.writeSettings();
|
||||
});
|
||||
connect(&qwenApiKey, &ButtonAspect::changed, this, [this]() { qwenApiKey.writeSettings(); });
|
||||
}
|
||||
|
||||
void ProviderSettings::resetSettingsToDefaults()
|
||||
@@ -211,6 +223,7 @@ void ProviderSettings::resetSettingsToDefaults()
|
||||
resetAspect(googleAiApiKey);
|
||||
resetAspect(ollamaBasicAuthApiKey);
|
||||
resetAspect(llamaCppApiKey);
|
||||
resetAspect(qwenApiKey);
|
||||
writeSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ public:
|
||||
Utils::StringAspect googleAiApiKey{this};
|
||||
Utils::StringAspect ollamaBasicAuthApiKey{this};
|
||||
Utils::StringAspect llamaCppApiKey{this};
|
||||
Utils::StringAspect qwenApiKey{this};
|
||||
|
||||
private:
|
||||
void setupConnections();
|
||||
|
||||
@@ -163,6 +163,8 @@ const char OLLAMA_BASIC_AUTH_API_KEY[] = "QodeAssist.ollamaBasicAuthApiKey";
|
||||
const char OLLAMA_BASIC_AUTH_API_KEY_HISTORY[] = "QodeAssist.ollamaBasicAuthApiKeyHistory";
|
||||
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 CLAUDE_ENABLE_PROMPT_CACHING[] = "QodeAssist.claudeEnablePromptCaching";
|
||||
const char CLAUDE_USE_EXTENDED_CACHE_TTL[] = "QodeAssist.claudeUseExtendedCacheTTL";
|
||||
|
||||
Reference in New Issue
Block a user