feat: Add Google AI provider and template

This commit is contained in:
Petr Mironychev
2025-02-25 14:14:48 +01:00
parent 1b06a651f0
commit 7ba615a72d
16 changed files with 524 additions and 47 deletions

View File

@ -87,6 +87,15 @@ ProviderSettings::ProviderSettings()
mistralAiApiKey.setDefaultValue("");
mistralAiApiKey.setAutoApply(true);
// GoogleAI Settings
googleAiApiKey.setSettingsKey(Constants::GOOGLE_AI_API_KEY);
googleAiApiKey.setLabelText(Tr::tr("Google AI API Key:"));
googleAiApiKey.setDisplayStyle(Utils::StringAspect::LineEditDisplay);
googleAiApiKey.setPlaceHolderText(Tr::tr("Enter your API key here"));
googleAiApiKey.setHistoryCompleter(Constants::GOOGLE_AI_API_KEY_HISTORY);
googleAiApiKey.setDefaultValue("");
googleAiApiKey.setAutoApply(true);
resetToDefaults.m_buttonText = Tr::tr("Reset Page to Defaults");
readSettings();
@ -108,6 +117,8 @@ ProviderSettings::ProviderSettings()
Group{title(Tr::tr("Claude Settings")), Column{claudeApiKey}},
Space{8},
Group{title(Tr::tr("Mistral AI Settings")), Column{mistralAiApiKey}},
Space{8},
Group{title(Tr::tr("Google AI Settings")), Column{googleAiApiKey}},
Stretch{1}};
});
}
@ -140,6 +151,8 @@ void ProviderSettings::resetSettingsToDefaults()
resetAspect(openAiCompatApiKey);
resetAspect(claudeApiKey);
resetAspect(openAiApiKey);
resetAspect(mistralAiApiKey);
resetAspect(googleAiApiKey);
}
}

View File

@ -38,6 +38,7 @@ public:
Utils::StringAspect claudeApiKey{this};
Utils::StringAspect openAiApiKey{this};
Utils::StringAspect mistralAiApiKey{this};
Utils::StringAspect googleAiApiKey{this};
private:
void setupConnections();

View File

@ -102,6 +102,8 @@ const char OPEN_AI_API_KEY[] = "QodeAssist.openAiApiKey";
const char OPEN_AI_API_KEY_HISTORY[] = "QodeAssist.openAiApiKeyHistory";
const char MISTRAL_AI_API_KEY[] = "QodeAssist.mistralAiApiKey";
const char MISTRAL_AI_API_KEY_HISTORY[] = "QodeAssist.mistralAiApiKeyHistory";
const char GOOGLE_AI_API_KEY[] = "QodeAssist.googleAiApiKey";
const char GOOGLE_AI_API_KEY_HISTORY[] = "QodeAssist.googleAiApiKeyHistory";
// context settings
const char CC_READ_FULL_FILE[] = "QodeAssist.ccReadFullFile";