Files
the-biergarten-app/pipeline/includes/generator.h
2026-04-01 19:33:50 -04:00

60 lines
2.5 KiB
C++

#pragma once
#include <string>
#include <vector>
/**
* @class LlamaBreweryGenerator
* @brief Generates brewery names and descriptions for cities
*
* Currently provides a deterministic mock implementation that generates
* brewery names and descriptions based on city name hashing.
*
* Design Pattern: Strategy pattern ready for swapping real llama.cpp
* implementation later. The LoadModel() and GenerateBrewery() interface
* will remain the same once actual LM inference is integrated.
*
* Mock Implementation: Uses std::hash to deterministically map city names
* to brewery templates, ensuring reproducible results for testing.
*/
class LlamaBreweryGenerator {
private:
/// Adjectives for brewery names (e.g., "Craft", "Heritage", etc.)
const std::vector<std::string> breweryAdjectives = {
"Craft", "Heritage", "Local", "Artisan",
"Pioneer", "Golden", "Modern", "Classic"};
/// Nouns for brewery names (e.g., "Brewing Co.", "Brewery", etc.)
const std::vector<std::string> breweryNouns = {
"Brewing Co.", "Brewery", "Bier Haus", "Taproom",
"Works", "House", "Fermentery", "Ale Co."};
/// Pre-written brewery descriptions (currently hand-crafted)
const std::vector<std::string> descriptions = {
"Handcrafted pale ales and seasonal IPAs with local ingredients.",
"Traditional lagers and experimental sours in small batches.",
"Award-winning stouts and wildly hoppy blonde ales.",
"Craft brewery specializing in Belgian-style triples and dark porters.",
"Modern brewery blending tradition with bold experimental flavors."};
public:
/// @struct Brewery
/// @brief Output structure for generated brewery data
struct Brewery {
std::string name; ///< Generated brewery name (e.g., "Craft Brewing Co.")
std::string description; ///< Short description of brewery style/offerings
};
/// @brief Loads a language model (currently mocked)
/// @param modelPath Path to GGUF model file (not used in mock)
/// @note In real implementation, loads llama.cpp model into memory
void LoadModel(const std::string &modelPath);
/// @brief Generates a brewery name and description for a city
/// @param cityName City name to generate brewery for
/// @param seed Integer seed (used for deterministic output in mock)
/// @return Brewery struct with name and description
/// @note Deterministic: same cityName+seed always produces same brewery
Brewery GenerateBrewery(const std::string &cityName, int seed);
};