1.7 KiB
Promptkit Integration
Weatherreporter uses Promptkit for all generated-text reports. The four logical prompts are
weather.daily_generated_text, weather.today_generated_text,
weather.tomorrow_generated_text, and weather.hourly_generated_text, each at version
1.0.1. Their prompt assets and generated-text JSON Schemas are embedded by
internal/promptassets.
Before collection, Weatherreporter inspects the exact prompt version, requires one required
data_package input with content type application/yaml, and requires the report's JSON
Schema output contract. It selects promptkit.profile when configured, otherwise the
prompt's declared default profile. Profiles that require a direct API key are unsupported; a
profile that reports APIKeyEnv requires a nonblank value in that environment variable.
Execution receives the already-persisted YAML package, prepares it once, and returns structured
JSON that Weatherreporter validates before rendering its own Markdown template. Preparation and
execution receipts are project-owned, safe provenance records. Content-rich diagnostics are
opt-in through --llm-debug-dir; see operations for retention and permissions.
The generated-text schemas require summary, forecast_discussion, and
precipitation_timing, and reject additional properties. Prompts return an empty string for
precipitation_timing when the deterministic package contains no precipitation windows.
Prompt/profile configuration is owned by the configuration reference. Adapter construction and mapping are documented in the Promptkit adapter internals. Durable metadata compatibility is described in state internals.