mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
feat: Add llama.cpp api key support
This commit is contained in:
@@ -97,6 +97,15 @@ ProviderSettings::ProviderSettings()
|
||||
ollamaBasicAuthApiKey.setDefaultValue("");
|
||||
ollamaBasicAuthApiKey.setAutoApply(true);
|
||||
|
||||
// llama.cpp Settings
|
||||
llamaCppApiKey.setSettingsKey(Constants::LLAMA_CPP_API_KEY);
|
||||
llamaCppApiKey.setLabelText(Tr::tr("llama.cpp API Key:"));
|
||||
llamaCppApiKey.setDisplayStyle(Utils::StringAspect::LineEditDisplay);
|
||||
llamaCppApiKey.setPlaceHolderText(Tr::tr("Enter your API key here"));
|
||||
llamaCppApiKey.setHistoryCompleter(Constants::LLAMA_CPP_API_KEY_HISTORY);
|
||||
llamaCppApiKey.setDefaultValue("");
|
||||
llamaCppApiKey.setAutoApply(true);
|
||||
|
||||
resetToDefaults.m_buttonText = Tr::tr("Reset Page to Defaults");
|
||||
|
||||
readSettings();
|
||||
@@ -122,6 +131,8 @@ ProviderSettings::ProviderSettings()
|
||||
Group{title(Tr::tr("Google AI Settings")), Column{googleAiApiKey}},
|
||||
Space{8},
|
||||
Group{title(Tr::tr("Ollama Settings")), Column{ollamaBasicAuthApiKey}},
|
||||
Space{8},
|
||||
Group{title(Tr::tr("llama.cpp Settings")), Column{llamaCppApiKey}},
|
||||
Stretch{1}};
|
||||
});
|
||||
}
|
||||
@@ -150,6 +161,9 @@ void ProviderSettings::setupConnections()
|
||||
connect(&ollamaBasicAuthApiKey, &ButtonAspect::changed, this, [this]() {
|
||||
ollamaBasicAuthApiKey.writeSettings();
|
||||
});
|
||||
connect(&llamaCppApiKey, &ButtonAspect::changed, this, [this]() {
|
||||
llamaCppApiKey.writeSettings();
|
||||
});
|
||||
}
|
||||
|
||||
void ProviderSettings::resetSettingsToDefaults()
|
||||
@@ -169,6 +183,7 @@ void ProviderSettings::resetSettingsToDefaults()
|
||||
resetAspect(mistralAiApiKey);
|
||||
resetAspect(googleAiApiKey);
|
||||
resetAspect(ollamaBasicAuthApiKey);
|
||||
resetAspect(llamaCppApiKey);
|
||||
writeSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ public:
|
||||
Utils::StringAspect codestralApiKey{this};
|
||||
Utils::StringAspect googleAiApiKey{this};
|
||||
Utils::StringAspect ollamaBasicAuthApiKey{this};
|
||||
Utils::StringAspect llamaCppApiKey{this};
|
||||
|
||||
private:
|
||||
void setupConnections();
|
||||
|
||||
@@ -145,6 +145,8 @@ const char GOOGLE_AI_API_KEY[] = "QodeAssist.googleAiApiKey";
|
||||
const char GOOGLE_AI_API_KEY_HISTORY[] = "QodeAssist.googleAiApiKeyHistory";
|
||||
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";
|
||||
|
||||
// context settings
|
||||
const char CC_READ_FULL_FILE[] = "QodeAssist.ccReadFullFile";
|
||||
|
||||
Reference in New Issue
Block a user