Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default modal for new conversations reverting to Mixtral after restarting Brave #22649

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions components/ai_chat/core/browser/conversation_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,7 @@ void ConversationDriver::ChangeModel(const std::string& model_key) {
}

std::string ConversationDriver::GetDefaultModel() {
const std::string* current_default =
pref_service_->GetUserPrefValue(prefs::kDefaultModelKey)->GetIfString();
if (current_default) {
return *current_default;
}

if (last_premium_status_ == mojom::PremiumStatus::Active ||
last_premium_status_ == mojom::PremiumStatus::ActiveDisconnected) {
return features::kAIModelsPremiumDefaultKey.Get();
}

current_default = pref_service_->GetDefaultPrefValue(prefs::kDefaultModelKey)
->GetIfString();

return current_default ? *current_default
: features::kAIModelsDefaultKey.Get();
return pref_service_->GetString(prefs::kDefaultModelKey);
}

void ConversationDriver::SetDefaultModel(const std::string& model_key) {
Expand All @@ -224,8 +209,7 @@ void ConversationDriver::SetDefaultModel(const std::string& model_key) {
return;
}

pref_service_->SetDefaultPrefValue(prefs::kDefaultModelKey,
base::Value(model_key));
pref_service_->SetString(prefs::kDefaultModelKey, model_key);
}

const mojom::Model& ConversationDriver::GetCurrentModel() {
Expand Down
Loading