mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 10:04:44 +00:00
Add reverse geocoding for brewery street addresses (#245)
* Add geocoding to seed application, remove postal codes from generator Update comments
This commit is contained in:
@@ -58,9 +58,7 @@ std::string CondenseWhitespace(std::string_view text) {
|
||||
return out;
|
||||
}
|
||||
|
||||
// Guard against truncating in the first half of the string.
|
||||
// This preserves the critical opening content and avoids cutting critical
|
||||
// context words early in the region description.
|
||||
// Keeps truncation past the string's midpoint, preserving the critical opening content.
|
||||
constexpr size_t kTruncationGuardDivisor = 2;
|
||||
|
||||
bool ReadRequiredTrimmedStringField(const boost::json::object& obj,
|
||||
|
||||
@@ -36,10 +36,7 @@ std::string FormatLocalLanguageCodes(
|
||||
|
||||
constexpr int kBreweryMaxTokens = 2800;
|
||||
|
||||
// Structured outputs already guarantee schema-valid JSON, so retries here
|
||||
// are only for transient failures or the model returning placeholder text
|
||||
// -- not for malformed JSON shape, unlike LlamaGenerator's grammar-assisted
|
||||
// retry loop.
|
||||
// Structured outputs already guarantee schema-valid JSON, so retries here only cover transient failures or the model returning placeholder text.
|
||||
constexpr int kMaxAttempts = 2;
|
||||
|
||||
} // namespace
|
||||
@@ -54,9 +51,7 @@ BreweryResult OpenAIGenerator::GenerateBrewery(
|
||||
FormatLocalLanguageCodes(location.local_languages);
|
||||
|
||||
/**
|
||||
* Load brewery system prompt via the injected prompt directory. The
|
||||
* same file LlamaGenerator uses -- the prompt content is backend
|
||||
* agnostic.
|
||||
* Loads the backend-agnostic brewery system prompt via the injected prompt directory.
|
||||
*/
|
||||
const std::string system_prompt =
|
||||
prompt_directory_->Load("BREWERY_GENERATION");
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
namespace {
|
||||
constexpr int kUserMaxTokens = 1200;
|
||||
|
||||
// Structured outputs already guarantee schema-valid JSON, so retries here
|
||||
// are only for transient failures or placeholder text -- not JSON shape.
|
||||
// Structured outputs already guarantee schema-valid JSON, so retries here only cover transient failures or placeholder text.
|
||||
constexpr int kMaxAttempts = 2;
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user