mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +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:
@@ -3,9 +3,9 @@
|
||||
|
||||
/**
|
||||
* @file data_generation/generation_json_validation.h
|
||||
* @brief Generator-agnostic helpers for preparing prompt context and
|
||||
* validating structured JSON output. Shared across all DataGenerator
|
||||
* implementations (Llama, OpenAI, ...).
|
||||
* @brief Generator-agnostic helpers, shared across all DataGenerator
|
||||
* implementations (Llama, OpenAI, ...), for preparing prompt context and
|
||||
* validating structured JSON output.
|
||||
*/
|
||||
|
||||
#include <cstddef>
|
||||
@@ -36,11 +36,9 @@ std::optional<std::string> ValidateBreweryJson(const std::string& raw,
|
||||
BreweryResult& brewery_out);
|
||||
|
||||
/**
|
||||
* @brief Validates and parses user JSON output.
|
||||
*
|
||||
* Only populates `username`, `bio`, and `activity_weight` -- `first_name`
|
||||
* and `last_name` are not LLM-authored and are set separately from the
|
||||
* sampled Name.
|
||||
* @brief Validates and parses user JSON output, populating only
|
||||
* `username`, `bio`, and `activity_weight` (`first_name` and `last_name`
|
||||
* come from the sampled Name).
|
||||
*
|
||||
* @param raw Raw model output.
|
||||
* @param user_out Parsed user payload.
|
||||
|
||||
@@ -18,13 +18,9 @@
|
||||
|
||||
/**
|
||||
* @brief Data generator implementation backed by the OpenAI Chat
|
||||
* Completions API.
|
||||
*
|
||||
* Unlike LlamaGenerator, this generator has no local model state and no
|
||||
* chat-template formatting step -- Chat Completions takes system/user
|
||||
* messages directly, and Structured Outputs (response_format: json_schema,
|
||||
* strict: true) guarantee schema-valid JSON, replacing llama.cpp's GBNF
|
||||
* grammar constraint.
|
||||
* Completions API, sending system/user messages directly and using
|
||||
* Structured Outputs (response_format: json_schema, strict: true) to
|
||||
* guarantee schema-valid JSON.
|
||||
*/
|
||||
class OpenAIGenerator final : public DataGenerator {
|
||||
public:
|
||||
|
||||
@@ -4,14 +4,9 @@
|
||||
/**
|
||||
* @file data_generation/openai_json_schemas.h
|
||||
* @brief JSON Schemas constraining structured output from OpenAIGenerator
|
||||
* Chat Completions requests, via response_format.json_schema (Structured
|
||||
* Outputs, strict mode). This is OpenAI's equivalent of the GBNF grammars
|
||||
* in json_grammars.h -- the API guarantees the response message content is
|
||||
* a single JSON string that validates against the schema, so there's no
|
||||
* grammar-level "thought-block" prefix to account for.
|
||||
*
|
||||
* OpenAI's strict mode requires "additionalProperties": false on every
|
||||
* object in the schema, which these already have.
|
||||
* Chat Completions requests via response_format.json_schema (Structured
|
||||
* Outputs, strict mode), each setting "additionalProperties": false as
|
||||
* strict mode requires.
|
||||
*/
|
||||
|
||||
#include <string_view>
|
||||
|
||||
Reference in New Issue
Block a user