#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/segmentation_platform/embedder/default_model/database_api_clients.h"
#include <memory>
#include <set>
#include <string>
#include <string_view>
#include "base/logging.h"
#include "base/metrics/metrics_hashes.h"
#include "base/strings/stringprintf.h"
#include "components/segmentation_platform/internal/database/ukm_types.h"
#include "components/segmentation_platform/internal/metadata/metadata_writer.h"
#include "components/segmentation_platform/public/config.h"
#include "components/segmentation_platform/public/constants.h"
#include "components/segmentation_platform/public/model_provider.h"
#include "components/segmentation_platform/public/proto/model_metadata.pb.h"
namespace segmentation_platform {
namespace {
SegmentId;
constexpr SegmentId kSegmentId = …;
constexpr int64_t kModelVersion = …;
struct CustomEvent { … };
constexpr std::array<const char*, 3> kTestMetricNames{ … };
constexpr std::array<CustomEvent, 3> kRegisteredCustomEvents{ … };
void AddCustomEvent(const CustomEvent& custom_event, MetadataWriter& writer) { … }
}
std::unique_ptr<Config> DatabaseApiClients::GetConfig() { … }
void DatabaseApiClients::AddSumGroupQuery(
MetadataWriter& writer,
std::string_view event_name,
const std::set<std::string>& metric_names,
int days) { … }
void DatabaseApiClients::AddSumQuery(MetadataWriter& writer,
std::string_view metric_name,
int days) { … }
DatabaseApiClients::DatabaseApiClients() : … { … }
std::unique_ptr<DefaultModelProvider::ModelConfig>
DatabaseApiClients::GetModelConfig() { … }
void DatabaseApiClients::ExecuteModelWithInput(
const ModelProvider::Request& inputs,
ExecutionCallback callback) { … }
}