chromium/components/optimization_guide/core/model_execution/model_execution_prefs.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/optimization_guide/core/model_execution/model_execution_prefs.h"

#include "base/notreached.h"
#include "components/optimization_guide/core/feature_registry/enterprise_policy_registry.h"
#include "components/optimization_guide/core/feature_registry/feature_registration.h"
#include "components/optimization_guide/core/model_execution/feature_keys.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"

namespace optimization_guide::model_execution::prefs {

void RegisterProfilePrefs(PrefRegistrySimple* registry) {}

namespace localstate {

// Preference of the last version checked. Used to determine when the
// disconnect count is reset.
const char kOnDeviceModelChromeVersion[] =;

// Preference where number of disconnects (crashes) of on device model is
// stored.
const char kOnDeviceModelCrashCount[] =;

// Preference where number of timeouts of on device model is stored.
const char kOnDeviceModelTimeoutCount[] =;

const char kOnDeviceModelValidationResult[] =;

// Stores the last computed `OnDeviceModelPerformanceClass` of the device.
const char kOnDevicePerformanceClass[] =;

// A timestamp for the last time various features were used which could have
// benefited from the on-device model. These are on-device eligible features,
// and this will be used to help decide whether to acquire the on device base
// model and the adaptation model.
//
// For historical reasons, the compose pref was named generically and is
// continued to be used.

const char kLastTimeComposeWasUsed[] =;

const char kLastTimePromptApiWasUsed[] =;

const char kLastTimeSummarizeApiWasUsed[] =;

const char kLastTimeTestFeatureWasUsed[] =;

const char kLastTimeHistorySearchWasUsed[] =;

// A timestamp for the last time the on-device model was eligible for download.
const char kLastTimeEligibleForOnDeviceModelDownload[] =;

// An integer pref that contains the user's client id.
const char kModelQualityLogggingClientId[] =;

// An integer pref for the on-device GenAI foundational model enterprise policy
// settings.
const char kGenAILocalFoundationalModelEnterprisePolicySettings[] =;

}  // namespace localstate

void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {}

// LINT.IfChange(GetOnDeviceFeatureRecentlyUsedPref)
const char* GetOnDeviceFeatureRecentlyUsedPref(
    ModelBasedCapabilityKey feature) {}
// LINT.ThenChange(//components/optimization_guide/core/model_execution/model_execution_features.cc:IsOnDeviceModelEnabled)

}  // namespace optimization_guide::model_execution::prefs