mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-06-01 01:54:00 +00:00
Organize and consolidate header files (#220)
This commit is contained in:
@@ -11,11 +11,9 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "data_generation/data_generator.h"
|
#include "data_generation/data_generator.h"
|
||||||
#include "data_model/enriched_city.h"
|
#include "data_model/generated_models.h"
|
||||||
#include "data_model/generated_brewery.h"
|
#include "services/enrichment/enrichment_service.h"
|
||||||
#include "data_model/location.h"
|
#include "services/database/export_service.h"
|
||||||
#include "services/enrichment_service.h"
|
|
||||||
#include "services/export_service.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Main data generator class for the Biergarten pipeline.
|
* @brief Main data generator class for the Biergarten pipeline.
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "data_model/brewery_result.h"
|
#include "data_model/generated_models.h"
|
||||||
#include "data_model/location.h"
|
|
||||||
#include "data_model/user_result.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Interface for data generator implementations.
|
* @brief Interface for data generator implementations.
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
#include "data_generation/data_generator.h"
|
#include "data_generation/data_generator.h"
|
||||||
#include "data_generation/prompt_formatting/prompt_formatter.h"
|
#include "data_generation/prompt_formatting/prompt_formatter.h"
|
||||||
#include "data_model/application_options.h"
|
#include "data_model/models.h"
|
||||||
#include "services/prompt_directory.h"
|
#include "../services/prompting/prompt_directory.h"
|
||||||
|
|
||||||
struct llama_model;
|
struct llama_model;
|
||||||
struct llama_context;
|
struct llama_context;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
#include "data_model/brewery_result.h"
|
#include "data_model/generated_models.h"
|
||||||
|
|
||||||
struct llama_vocab;
|
struct llama_vocab;
|
||||||
using llama_token = int32_t;
|
using llama_token = int32_t;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#pragma once
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_GENERATION_PROMPT_FORMATTING_GEMMA4_JINJA_PROMPT_FORMATTER_H_
|
||||||
|
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_GENERATION_PROMPT_FORMATTING_GEMMA4_JINJA_PROMPT_FORMATTER_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@@ -13,3 +14,5 @@ class Gemma4JinjaPromptFormatter final : public IPromptFormatter {
|
|||||||
[[nodiscard]] std::string Format(std::string_view system_prompt,
|
[[nodiscard]] std::string Format(std::string_view system_prompt,
|
||||||
std::string_view user_prompt) const override;
|
std::string_view user_prompt) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_GENERATION_PROMPT_FORMATTING_GEMMA4_JINJA_PROMPT_FORMATTER_H_
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#pragma once
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_GENERATION_PROMPT_FORMATTING_PROMPT_FORMATTER_H_
|
||||||
|
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_GENERATION_PROMPT_FORMATTING_PROMPT_FORMATTER_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@@ -15,3 +16,5 @@ class IPromptFormatter {
|
|||||||
[[nodiscard]] virtual std::string Format(
|
[[nodiscard]] virtual std::string Format(
|
||||||
std::string_view system_prompt, std::string_view user_prompt) const = 0;
|
std::string_view system_prompt, std::string_view user_prompt) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_GENERATION_PROMPT_FORMATTING_PROMPT_FORMATTER_H_
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_BREWERY_LOCATION_H_
|
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_BREWERY_LOCATION_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file data_model/brewery_location.h
|
|
||||||
* @brief Non-owning brewery location input.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <string_view>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Non-owning brewery location input.
|
|
||||||
*/
|
|
||||||
struct BreweryLocation {
|
|
||||||
/// @brief City name.
|
|
||||||
std::string_view city_name;
|
|
||||||
|
|
||||||
/// @brief Country name.
|
|
||||||
std::string_view country_name;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_BREWERY_LOCATION_H_
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_BREWERY_RESULT_H_
|
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_BREWERY_RESULT_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file data_model/brewery_result.h
|
|
||||||
* @brief Generated brewery payload.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Generated brewery payload.
|
|
||||||
*/
|
|
||||||
struct BreweryResult {
|
|
||||||
/// @brief Brewery display name in English.
|
|
||||||
std::string name_en;
|
|
||||||
|
|
||||||
/// @brief Brewery description text in English.
|
|
||||||
std::string description_en;
|
|
||||||
|
|
||||||
/// @brief Brewery display name in the local language.
|
|
||||||
std::string name_local;
|
|
||||||
|
|
||||||
/// @brief Brewery description text in the local language.
|
|
||||||
std::string description_local;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_BREWERY_RESULT_H_
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_ENRICHED_CITY_H_
|
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_ENRICHED_CITY_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file data_model/enriched_city.h
|
|
||||||
* @brief Enriched city data with Wikipedia context.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "data_model/location.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Enriched city data with Wikipedia context.
|
|
||||||
*/
|
|
||||||
struct EnrichedCity {
|
|
||||||
Location location;
|
|
||||||
std::string region_context{};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_ENRICHED_CITY_H_
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_GENERATED_BREWERY_H_
|
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_GENERATED_BREWERY_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file data_model/generated_brewery.h
|
|
||||||
* @brief Helper struct to store generated brewery data.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "data_model/brewery_result.h"
|
|
||||||
#include "data_model/location.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Helper struct to store generated brewery data.
|
|
||||||
*/
|
|
||||||
struct GeneratedBrewery {
|
|
||||||
Location location;
|
|
||||||
BreweryResult brewery;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_GENERATED_BREWERY_H_
|
|
||||||
66
tooling/pipeline/includes/data_model/generated_models.h
Normal file
66
tooling/pipeline/includes/data_model/generated_models.h
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_GENERATED_MODELS_H_
|
||||||
|
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_GENERATED_MODELS_H_
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file data_model/generated_models.h
|
||||||
|
* @brief Generated output models from the pipeline: brewery/user results, enriched data,
|
||||||
|
* and complete generation results.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "data_model/models.h"
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Generation Output Models
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Generated brewery payload.
|
||||||
|
*/
|
||||||
|
struct BreweryResult {
|
||||||
|
/// @brief Brewery display name in English.
|
||||||
|
std::string name_en;
|
||||||
|
|
||||||
|
/// @brief Brewery description text in English.
|
||||||
|
std::string description_en;
|
||||||
|
|
||||||
|
/// @brief Brewery display name in the local language.
|
||||||
|
std::string name_local;
|
||||||
|
|
||||||
|
/// @brief Brewery description text in the local language.
|
||||||
|
std::string description_local;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Generated user profile payload.
|
||||||
|
*/
|
||||||
|
struct UserResult {
|
||||||
|
/// @brief Username handle.
|
||||||
|
std::string username{};
|
||||||
|
|
||||||
|
/// @brief Short user biography.
|
||||||
|
std::string bio{};
|
||||||
|
};
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Pipeline Data Models
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enriched city data with Wikipedia context.
|
||||||
|
*/
|
||||||
|
struct EnrichedCity {
|
||||||
|
Location location;
|
||||||
|
std::string region_context{};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Helper struct to store generated brewery data.
|
||||||
|
*/
|
||||||
|
struct GeneratedBrewery {
|
||||||
|
Location location;
|
||||||
|
BreweryResult brewery;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_GENERATED_MODELS_H_
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_GENERATION_MODELS_H_
|
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_GENERATION_MODELS_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file data_model/generation_models.h
|
|
||||||
* @brief Convenience include for shared generation payload models.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "data_model/brewery_location.h"
|
|
||||||
#include "data_model/brewery_result.h"
|
|
||||||
#include "data_model/user_result.h"
|
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_GENERATION_MODELS_H_
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_LOCATION_H_
|
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_LOCATION_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file data_model/location.h
|
|
||||||
* @brief Location data model used throughout generation pipeline.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Canonical location record for city-level generation.
|
|
||||||
*/
|
|
||||||
struct Location {
|
|
||||||
/// @brief City name.
|
|
||||||
std::string city{};
|
|
||||||
|
|
||||||
/// @brief State or province name.
|
|
||||||
std::string state_province{};
|
|
||||||
|
|
||||||
/// @brief ISO 3166-2 subdivision code.
|
|
||||||
std::string iso3166_2{};
|
|
||||||
|
|
||||||
/// @brief Country name.
|
|
||||||
std::string country{};
|
|
||||||
|
|
||||||
/// @brief ISO 3166-1 country code.
|
|
||||||
std::string iso3166_1{};
|
|
||||||
|
|
||||||
/// @brief Local language codes in priority order.
|
|
||||||
std::vector<std::string> local_languages{};
|
|
||||||
|
|
||||||
/// @brief Latitude in decimal degrees.
|
|
||||||
double latitude{};
|
|
||||||
|
|
||||||
/// @brief Longitude in decimal degrees.
|
|
||||||
double longitude{};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_LOCATION_H_
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_APPLICATION_OPTIONS_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_MODELS_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_APPLICATION_OPTIONS_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_MODELS_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file data_model/application_options.h
|
* @file data_model/models.h
|
||||||
* @brief Program options for the Biergarten pipeline application.
|
* @brief Core data models: locations, application configuration, and generation inputs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
@@ -11,9 +11,59 @@
|
|||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace prog_opts = boost::program_options;
|
namespace prog_opts = boost::program_options;
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Location Models
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Canonical location record for city-level generation.
|
||||||
|
*/
|
||||||
|
struct Location {
|
||||||
|
/// @brief City name.
|
||||||
|
std::string city{};
|
||||||
|
|
||||||
|
/// @brief State or province name.
|
||||||
|
std::string state_province{};
|
||||||
|
|
||||||
|
/// @brief ISO 3166-2 subdivision code.
|
||||||
|
std::string iso3166_2{};
|
||||||
|
|
||||||
|
/// @brief Country name.
|
||||||
|
std::string country{};
|
||||||
|
|
||||||
|
/// @brief ISO 3166-1 country code.
|
||||||
|
std::string iso3166_1{};
|
||||||
|
|
||||||
|
/// @brief Local language codes in priority order.
|
||||||
|
std::vector<std::string> local_languages{};
|
||||||
|
|
||||||
|
/// @brief Latitude in decimal degrees.
|
||||||
|
double latitude{};
|
||||||
|
|
||||||
|
/// @brief Longitude in decimal degrees.
|
||||||
|
double longitude{};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Non-owning brewery location input.
|
||||||
|
*/
|
||||||
|
struct BreweryLocation {
|
||||||
|
/// @brief City name.
|
||||||
|
std::string_view city_name;
|
||||||
|
|
||||||
|
/// @brief Country name.
|
||||||
|
std::string_view country_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Configuration Models
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief LLM sampling parameters.
|
* @brief LLM sampling parameters.
|
||||||
*/
|
*/
|
||||||
@@ -72,5 +122,10 @@ struct ApplicationOptions {
|
|||||||
PipelineOptions pipeline;
|
PipelineOptions pipeline;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Function Declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
std::optional<ApplicationOptions> ParseArguments(const int argc, char** argv);
|
std::optional<ApplicationOptions> ParseArguments(const int argc, char** argv);
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_APPLICATION_OPTIONS_H_
|
|
||||||
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_MODELS_H_
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_PIPELINE_MODELS_H_
|
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_PIPELINE_MODELS_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file data_model/pipeline_models.h
|
|
||||||
* @brief Convenience include for pipeline-specific data models.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "data_model/enriched_city.h"
|
|
||||||
#include "data_model/generated_brewery.h"
|
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_PIPELINE_MODELS_H_
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_USER_RESULT_H_
|
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_USER_RESULT_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file data_model/user_result.h
|
|
||||||
* @brief Generated user profile payload.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Generated user profile payload.
|
|
||||||
*/
|
|
||||||
struct UserResult {
|
|
||||||
/// @brief Username handle.
|
|
||||||
std::string username{};
|
|
||||||
|
|
||||||
/// @brief Short user biography.
|
|
||||||
std::string bio{};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_USER_RESULT_H_
|
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "data_model/location.h"
|
#include "data_model/models.h"
|
||||||
|
|
||||||
/// @brief Loads curated world locations from a JSON file into memory.
|
/// @brief Loads curated world locations from a JSON file into memory.
|
||||||
class JsonLoader {
|
class JsonLoader {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_EXPORT_SERVICE_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_EXPORT_SERVICE_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_EXPORT_SERVICE_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_EXPORT_SERVICE_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file services/export_service.h
|
* @file services/export_service.h
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#include "data_model/generated_brewery.h"
|
#include "data_model/generated_models.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Interface for services that persist generated brewery records.
|
* @brief Interface for services that persist generated brewery records.
|
||||||
@@ -39,4 +39,4 @@ class IExportService {
|
|||||||
virtual void Finalize() = 0;
|
virtual void Finalize() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_EXPORT_SERVICE_H_
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_EXPORT_SERVICE_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_CONNECTION_HELPERS_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_CONNECTION_HELPERS_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_CONNECTION_HELPERS_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_CONNECTION_HELPERS_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file services/sqlite_connection_helpers.h
|
* @file services/sqlite_connection_helpers.h
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
#include "services/sqlite_handle_types.h"
|
#include "sqlite_handle_types.h"
|
||||||
|
|
||||||
namespace sqlite_export_service_internal {
|
namespace sqlite_export_service_internal {
|
||||||
|
|
||||||
@@ -27,4 +27,4 @@ void RollbackTransactionNoThrow(const SqliteDatabaseHandle& db_handle) noexcept;
|
|||||||
|
|
||||||
} // namespace sqlite_export_service_internal
|
} // namespace sqlite_export_service_internal
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_CONNECTION_HELPERS_H_
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_CONNECTION_HELPERS_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_EXPORT_SERVICE_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_EXPORT_SERVICE_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_EXPORT_SERVICE_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_EXPORT_SERVICE_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file services/sqlite_export_service.h
|
* @file services/sqlite_export_service.h
|
||||||
@@ -11,10 +11,10 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "data_model/application_options.h"
|
#include "data_model/models.h"
|
||||||
#include "services/date_time_provider.h"
|
#include "../datetime/date_time_provider.h"
|
||||||
#include "services/export_service.h"
|
#include "export_service.h"
|
||||||
#include "services/sqlite_export_service_helpers.h"
|
#include "sqlite_export_service_helpers.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Persists generated brewery records into a fresh SQLite database.
|
* @brief Persists generated brewery records into a fresh SQLite database.
|
||||||
@@ -57,4 +57,4 @@ class SqliteExportService final : public IExportService {
|
|||||||
std::unordered_map<std::string, sqlite3_int64> location_cache_;
|
std::unordered_map<std::string, sqlite3_int64> location_cache_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_EXPORT_SERVICE_H_
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_EXPORT_SERVICE_H_
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_EXPORT_SERVICE_HELPERS_H_
|
||||||
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_EXPORT_SERVICE_HELPERS_H_
|
||||||
|
|
||||||
|
/* Umbrella header for backward compatibility. */
|
||||||
|
|
||||||
|
#include "sqlite_connection_helpers.h"
|
||||||
|
#include "sqlite_handle_types.h"
|
||||||
|
#include "sqlite_statement_helpers.h"
|
||||||
|
|
||||||
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_EXPORT_SERVICE_HELPERS_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_HANDLE_TYPES_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_HANDLE_TYPES_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_HANDLE_TYPES_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_HANDLE_TYPES_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shared handle and parameter type declarations used by SQLite helper units.
|
* Shared handle and parameter type declarations used by SQLite helper units.
|
||||||
@@ -33,4 +33,4 @@ struct BindParam {
|
|||||||
|
|
||||||
} // namespace sqlite_export_service_internal
|
} // namespace sqlite_export_service_internal
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_HANDLE_TYPES_H_
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_HANDLE_TYPES_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_STATEMENT_HELPERS_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_STATEMENT_HELPERS_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_STATEMENT_HELPERS_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_STATEMENT_HELPERS_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file services/sqlite_statement_helpers.h
|
* @file services/sqlite_statement_helpers.h
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "services/sqlite_handle_types.h"
|
#include "sqlite_handle_types.h"
|
||||||
|
|
||||||
namespace sqlite_export_service_internal {
|
namespace sqlite_export_service_internal {
|
||||||
|
|
||||||
@@ -113,4 +113,4 @@ std::string SerializeVector(const std::vector<std::string>& str_vec);
|
|||||||
|
|
||||||
} // namespace sqlite_export_service_internal
|
} // namespace sqlite_export_service_internal
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_STATEMENT_HELPERS_H_
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATABASE_SQLITE_STATEMENT_HELPERS_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATE_TIME_PROVIDER_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATETIME_DATE_TIME_PROVIDER_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATE_TIME_PROVIDER_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATETIME_DATE_TIME_PROVIDER_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file services/date_time_provider.h
|
* @file services/date_time_provider.h
|
||||||
@@ -63,4 +63,4 @@ class SystemDateTimeProvider final : public IDateTimeProvider {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATE_TIME_PROVIDER_H_
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATETIME_DATE_TIME_PROVIDER_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_TIMER_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATETIME_TIMER_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_TIMER_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATETIME_TIMER_H_
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
@@ -32,4 +32,4 @@ class Timer {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_TIMER_H_
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_DATETIME_TIMER_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_ENRICHMENT_SERVICE_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_ENRICHMENT_ENRICHMENT_SERVICE_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_ENRICHMENT_SERVICE_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_ENRICHMENT_ENRICHMENT_SERVICE_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file services/enrichment_service.h
|
* @file services/enrichment_service.h
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "data_model/location.h"
|
#include "data_model/models.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Interface for services that can enrich a location with context.
|
* @brief Interface for services that can enrich a location with context.
|
||||||
@@ -27,4 +27,4 @@ class IEnrichmentService {
|
|||||||
virtual std::string GetLocationContext(const Location& loc) = 0;
|
virtual std::string GetLocationContext(const Location& loc) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_ENRICHMENT_SERVICE_H_
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_ENRICHMENT_ENRICHMENT_SERVICE_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_WIKIPEDIA_SERVICE_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_ENRICHMENT_WIKIPEDIA_SERVICE_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_WIKIPEDIA_SERVICE_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_ENRICHMENT_WIKIPEDIA_SERVICE_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file services/wikipedia_service.h
|
* @file services/wikipedia_service.h
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "services/enrichment_service.h"
|
#include "enrichment_service.h"
|
||||||
#include "web_client/web_client.h"
|
#include "web_client/web_client.h"
|
||||||
|
|
||||||
/// @brief Provides Wikipedia summary lookups backed by cached raw extracts.
|
/// @brief Provides Wikipedia summary lookups backed by cached raw extracts.
|
||||||
@@ -30,4 +30,4 @@ class WikipediaService final : public IEnrichmentService {
|
|||||||
std::unordered_map<std::string, std::string> extract_cache_;
|
std::unordered_map<std::string, std::string> extract_cache_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_WIKIPEDIA_SERVICE_H_
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_ENRICHMENT_WIKIPEDIA_SERVICE_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_PROMPT_DIRECTORY_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_PROMPTING_PROMPT_DIRECTORY_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_PROMPT_DIRECTORY_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_PROMPTING_PROMPT_DIRECTORY_H_
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file services/prompt_directory.h
|
* @file services/prompt_directory.h
|
||||||
@@ -73,4 +73,4 @@ class PromptDirectory final : public IPromptDirectory {
|
|||||||
std::unordered_map<std::string, std::string> cache_;
|
std::unordered_map<std::string, std::string> cache_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_PROMPT_DIRECTORY_H_
|
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_PROMPTING_PROMPT_DIRECTORY_H_
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_EXPORT_SERVICE_HELPERS_H_
|
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_EXPORT_SERVICE_HELPERS_H_
|
|
||||||
|
|
||||||
/* Umbrella header for backward compatibility. */
|
|
||||||
|
|
||||||
#include "services/sqlite_connection_helpers.h"
|
|
||||||
#include "services/sqlite_handle_types.h"
|
|
||||||
#include "services/sqlite_statement_helpers.h"
|
|
||||||
|
|
||||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_EXPORT_SERVICE_HELPERS_H_
|
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
* @brief cpp-httplib implementation of the WebClient interface.
|
* @brief cpp-httplib implementation of the WebClient interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BIERGARTEN_PIPELINE_INCLUDES_HTTP_WEB_CLIENT_CURL_WEB_CLIENT_H_
|
#ifndef BIERGARTEN_PIPELINE_INCLUDES_WEB_CLIENT_HTTP_WEB_CLIENT_H_
|
||||||
#define BIERGARTEN_PIPELINE_INCLUDES_HTTP_WEB_CLIENT_CURL_WEB_CLIENT_H_
|
#define BIERGARTEN_PIPELINE_INCLUDES_WEB_CLIENT_HTTP_WEB_CLIENT_H_
|
||||||
|
|
||||||
|
|
||||||
#include "web_client/web_client.h"
|
#include "web_client/web_client.h"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "data_model/application_options.h"
|
#include "data_model/models.h"
|
||||||
|
|
||||||
std::optional<ApplicationOptions> ParseArguments(const int argc, char** argv) {
|
std::optional<ApplicationOptions> ParseArguments(const int argc, char** argv) {
|
||||||
prog_opts::options_description desc("Pipeline Options");
|
prog_opts::options_description desc("Pipeline Options");
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "data_model/application_options.h"
|
#include "data_model/models.h"
|
||||||
#include "llama.h"
|
#include "llama.h"
|
||||||
|
|
||||||
static constexpr uint32_t kMaxContextSize = 32768U;
|
static constexpr uint32_t kMaxContextSize = 32768U;
|
||||||
|
|||||||
@@ -19,15 +19,14 @@
|
|||||||
#include "data_generation/llama_generator.h"
|
#include "data_generation/llama_generator.h"
|
||||||
#include "data_generation/mock_generator.h"
|
#include "data_generation/mock_generator.h"
|
||||||
#include "data_generation/prompt_formatting/gemma4_jinja_prompt_formatter.h"
|
#include "data_generation/prompt_formatting/gemma4_jinja_prompt_formatter.h"
|
||||||
#include "data_model/application_options.h"
|
#include "data_model/models.h"
|
||||||
#include "llama_backend_state.h"
|
#include "llama_backend_state.h"
|
||||||
#include "services/enrichment_service.h"
|
#include "services/enrichment/enrichment_service.h"
|
||||||
#include "services/export_service.h"
|
#include "services/database/export_service.h"
|
||||||
#include "services/prompt_directory.h"
|
#include "services/prompting/prompt_directory.h"
|
||||||
#include "services/sqlite_export_service.h"
|
#include "services/database/sqlite_export_service.h"
|
||||||
#include "services/timer.h"
|
#include "services/datetime/timer.h"
|
||||||
#include "services/wikipedia_service.h"
|
#include "services/enrichment/wikipedia_service.h"
|
||||||
#include "web_client/curl_web_client.h"
|
|
||||||
#include "web_client/http_web_client.h"
|
#include "web_client/http_web_client.h"
|
||||||
|
|
||||||
namespace di = boost::di;
|
namespace di = boost::di;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* construction and loads named prompt files on demand with in-process caching.
|
* construction and loads named prompt files on demand with in-process caching.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "services/prompt_directory.h"
|
#include "services/prompting/prompt_directory.h"
|
||||||
|
|
||||||
#include <spdlog/spdlog.h>
|
#include <spdlog/spdlog.h>
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "services/sqlite_export_service.h"
|
#include "services/database/sqlite_export_service.h"
|
||||||
#include "services/sqlite_export_service_helpers.h"
|
#include "services/database/sqlite_export_service_helpers.h"
|
||||||
|
|
||||||
void SqliteExportService::Finalize() {
|
void SqliteExportService::Finalize() {
|
||||||
if (db_handle_ == nullptr) {
|
if (db_handle_ == nullptr) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "services/sqlite_connection_helpers.h"
|
#include "services/database/sqlite_connection_helpers.h"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "services/sqlite_statement_helpers.h"
|
#include "services/database/sqlite_statement_helpers.h"
|
||||||
|
|
||||||
#include <boost/json.hpp>
|
#include <boost/json.hpp>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "services/sqlite_connection_helpers.h"
|
#include "services/database/sqlite_connection_helpers.h"
|
||||||
|
|
||||||
namespace sqlite_export_service_internal {
|
namespace sqlite_export_service_internal {
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "services/sqlite_export_service.h"
|
#include "services/database/sqlite_export_service.h"
|
||||||
#include "services/sqlite_export_service_helpers.h"
|
#include "services/database/sqlite_export_service_helpers.h"
|
||||||
|
|
||||||
std::filesystem::path SqliteExportService::BuildDatabasePath() const {
|
std::filesystem::path SqliteExportService::BuildDatabasePath() const {
|
||||||
std::filesystem::path base_filename("biergarten_seed_" + run_timestamp_utc_ +
|
std::filesystem::path base_filename("biergarten_seed_" + run_timestamp_utc_ +
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "services/sqlite_export_service.h"
|
#include "services/database/sqlite_export_service.h"
|
||||||
#include "services/sqlite_export_service_helpers.h"
|
#include "services/database/sqlite_export_service_helpers.h"
|
||||||
|
|
||||||
constexpr int kLocationPrecision = 17;
|
constexpr int kLocationPrecision = 17;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @brief SqliteExportService constructor and destructor implementation.
|
* @brief SqliteExportService constructor and destructor implementation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "services/sqlite_export_service.h"
|
#include "services/database/sqlite_export_service.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
#include "services/wikipedia_service.h"
|
#include "services/enrichment/wikipedia_service.h"
|
||||||
|
|
||||||
std::string WikipediaService::FetchExtract(std::string_view query) {
|
std::string WikipediaService::FetchExtract(std::string_view query) {
|
||||||
const std::string cache_key(query);
|
const std::string cache_key(query);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "services/wikipedia_service.h"
|
#include "services/enrichment/wikipedia_service.h"
|
||||||
|
|
||||||
std::string WikipediaService::GetLocationContext(const Location& loc) {
|
std::string WikipediaService::GetLocationContext(const Location& loc) {
|
||||||
if (!client_) {
|
if (!client_) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @brief WikipediaService constructor implementation.
|
* @brief WikipediaService constructor implementation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "services/wikipedia_service.h"
|
#include "services/enrichment/wikipedia_service.h"
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user