#ifndef COMPONENTS_OPTIMIZATION_GUIDE_CORE_MODEL_EXECUTION_MODEL_EXECUTION_UTIL_H_
#define COMPONENTS_OPTIMIZATION_GUIDE_CORE_MODEL_EXECUTION_MODEL_EXECUTION_UTIL_H_
#include <memory>
#include "base/check.h"
#include "base/notreached.h"
#include "components/optimization_guide/core/model_execution/model_execution_prefs.h"
#include "components/optimization_guide/core/optimization_guide_util.h"
#include "components/optimization_guide/proto/model_quality_service.pb.h"
#include "components/optimization_guide/proto/on_device_model_execution_config.pb.h"
#include "services/on_device_model/public/mojom/on_device_model_service.mojom.h"
namespace optimization_guide {
template <typename FeatureType>
void SetExecutionRequestTemplate(
proto::LogAiDataRequest& log_ai_request,
const google::protobuf::MessageLite& request_metadata) { … }
template <typename FeatureType>
void SetExecutionResponseTemplate(proto::LogAiDataRequest& log_ai_request,
const proto::Any& response_metadata) { … }
void SetExecutionRequest(ModelBasedCapabilityKey feature,
proto::LogAiDataRequest& log_ai_request,
const google::protobuf::MessageLite& request_metadata);
void SetExecutionResponse(ModelBasedCapabilityKey feature,
proto::LogAiDataRequest& log_ai_request,
const proto::Any& response_metadata);
model_execution::prefs::GenAILocalFoundationalModelEnterprisePolicySettings
GetGenAILocalFoundationalModelEnterprisePolicySettings(
PrefService* local_state);
OnDeviceModelLoadResult ConvertToOnDeviceModelLoadResult(
on_device_model::mojom::LoadModelResult result);
std::unique_ptr<proto::OnDeviceModelExecutionConfig>
ReadOnDeviceModelExecutionConfig(const base::FilePath& config_path);
bool WasOnDeviceEligibleFeatureRecentlyUsed(ModelBasedCapabilityKey feature,
const PrefService& local_state);
}
#endif