Update generate pipeline to add OpenAI api as an additional backend (for comparison testing), add brewery coordinates (#244)

* add brewery coordinates

* Add openai mode

* Add coordinates to schema

* Fix C++ review findings in pipeline: k-prefixed enum values, include ordering, populated validation error messages, conventional const notation, and endl replaced with newline
This commit is contained in:
2026-08-23 15:49:28 -04:00
committed by Aaron Po
parent 31da1d557c
commit e738fe484a
35 changed files with 1327 additions and 343 deletions

View File

@@ -94,6 +94,8 @@ struct EnrichedCity {
struct BreweryAddress {
City city;
std::string postal_code{};
double longitude{};
double latitude{};
};
/**

View File

@@ -66,6 +66,9 @@ struct City {
*/
std::string iso3166_1{};
double longitude{};
double latitude{};
/**
* @brief Local language codes in priority order.
*/
@@ -184,25 +187,47 @@ struct SamplingOptions {
int n_gpu_layers = 0;
};
/**
* @brief Selects which DataGenerator backend the pipeline uses.
*/
enum class GeneratorMode {
kMock,
kLlama,
kOpenAI,
};
/**
* @brief Configuration for the LLM generator component.
*/
struct GeneratorOptions {
/**
* @brief Path to the LLM model file (gguf format).
* @brief Path to the LLM model file (gguf format). Only meaningful for
* GeneratorMode::kLlama.
*/
std::filesystem::path model_path;
/**
* @brief Use mocked generator instead of actual LLM inference.
* @brief Which generator backend to use.
*/
bool use_mocked = false;
GeneratorMode mode = GeneratorMode::kMock;
/**
* @brief Specific sampling parameters for this generator.
* If nullopt, the application should use global defaults.
* @brief Specific sampling parameters for this generator. Only
* meaningful for GeneratorMode::kLlama; if nullopt, LlamaGenerator uses
* its own defaults.
*/
std::optional<SamplingOptions> sampling;
/**
* @brief OpenAI API key, read from the OPENAI_API_KEY environment
* variable. Only populated for GeneratorMode::kOpenAI.
*/
std::string openai_api_key;
/**
* @brief OpenAI model ID used by OpenAIGenerator.
*/
std::string openai_model = "gpt-4o-mini";
};
/**