mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-06-01 01:54:00 +00:00
Add localized name/description to data models
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "data_model/brewery_result.h"
|
||||
|
||||
struct llama_vocab;
|
||||
using llama_token = int32_t;
|
||||
|
||||
@@ -39,13 +41,10 @@ void AppendTokenPiece(const llama_vocab* vocab, llama_token token,
|
||||
* @brief Validates and parses brewery JSON output.
|
||||
*
|
||||
* @param raw Raw model output.
|
||||
* @param name_out Parsed brewery name.
|
||||
* @param description_out Parsed brewery description.
|
||||
* @param brewery_out Parsed brewery payload.
|
||||
* @return Validation error message if invalid, or std::nullopt on success.
|
||||
*/
|
||||
std::optional<std::string> ValidateBreweryJson(const std::string& raw,
|
||||
std::string& name_out,
|
||||
std::string& description_out,
|
||||
std::string& reasoning_out);
|
||||
BreweryResult& brewery_out);
|
||||
|
||||
#endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_GENERATION_LLAMA_GENERATOR_HELPERS_H_
|
||||
|
||||
@@ -12,11 +12,17 @@
|
||||
* @brief Generated brewery payload.
|
||||
*/
|
||||
struct BreweryResult {
|
||||
/// @brief Brewery display name.
|
||||
std::string name{};
|
||||
/// @brief Brewery display name in English.
|
||||
std::string name_en;
|
||||
|
||||
/// @brief Brewery description text.
|
||||
std::string description{};
|
||||
/// @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_
|
||||
|
||||
Reference in New Issue
Block a user