mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
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:
@@ -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";
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user