Simplify and rationalize the hourly report template
This commit is contained in:
@@ -29,14 +29,15 @@ The hourly generated text JSON accepts:
|
||||
```json
|
||||
{
|
||||
"summary": "string",
|
||||
"timing": "string",
|
||||
"impacts": "string",
|
||||
"forecast_discussion": "string",
|
||||
"precipitation_timing": "string",
|
||||
"confidence": "string"
|
||||
}
|
||||
```
|
||||
|
||||
`summary`, `timing`, and `impacts` are required after trimming whitespace.
|
||||
`confidence` is optional and omitted from normalized JSON when blank.
|
||||
`summary` and `forecast_discussion` are required after trimming whitespace.
|
||||
`precipitation_timing` and `confidence` are optional and omitted from normalized
|
||||
JSON when blank.
|
||||
|
||||
## Boundaries
|
||||
|
||||
@@ -54,7 +55,7 @@ The hourly generated text JSON accepts:
|
||||
- Malformed generated-text JSON fails with decode context.
|
||||
- Unknown generated-text JSON fields fail during decoding.
|
||||
- Empty required hourly fields fail after trimming whitespace.
|
||||
- Missing required render-context stanzas fail with the stanza name.
|
||||
- Missing optional render-context stanzas become nil module pointers.
|
||||
- Invalid render metadata, including missing timezone, missing generated time,
|
||||
or invalid valid period, fails before template rendering.
|
||||
|
||||
|
||||
@@ -61,12 +61,11 @@ The hourly GeneratedText schema describes the structured prose Scriptorium is
|
||||
expected to write for the prompt. It requires:
|
||||
|
||||
- `summary`
|
||||
- `timing`
|
||||
- `impacts`
|
||||
- `forecast_discussion`
|
||||
|
||||
It allows optional `confidence` and rejects additional properties. Weather truth
|
||||
remains in module outputs; GeneratedText is limited to prose slots consumed by
|
||||
the template.
|
||||
It allows optional `precipitation_timing` and `confidence`, and rejects
|
||||
additional properties. Weather truth remains in module outputs; GeneratedText is
|
||||
limited to prose slots consumed by the template.
|
||||
|
||||
## Failure Behavior
|
||||
|
||||
|
||||
@@ -63,22 +63,18 @@ weatherreporter, and then inserted into the render context.
|
||||
| Variable | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `.GeneratedText.Summary` | string | Required short prose summary. |
|
||||
| `.GeneratedText.Timing` | string | Required prose about timing of notable weather changes or hazards. |
|
||||
| `.GeneratedText.Impacts` | string | Required prose about practical near-term impacts. |
|
||||
| `.GeneratedText.Confidence` | string | Optional confidence or uncertainty note. Empty when omitted by the LLM. |
|
||||
| `.GeneratedText.ForecastDiscussion` | string | Required prose for the Forecast Discussion section. |
|
||||
| `.GeneratedText.PrecipitationTiming` | string | Optional prose rendered after deterministic precipitation windows. |
|
||||
| `.GeneratedText.Confidence` | string | Optional confidence or uncertainty note. Empty when omitted by the LLM; not rendered by the current hourly template. |
|
||||
|
||||
Example:
|
||||
|
||||
```gotemplate
|
||||
## Summary
|
||||
|
||||
{{ .GeneratedText.Summary }}
|
||||
{{ with .GeneratedText.Confidence }}
|
||||
|
||||
## Confidence
|
||||
## Forecast Discussion
|
||||
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
{{ .GeneratedText.ForecastDiscussion }}
|
||||
```
|
||||
|
||||
## Modules
|
||||
@@ -106,10 +102,12 @@ Common fields:
|
||||
| Variable | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `.Modules.CurrentConditions.ConditionText` | string | Current condition text. |
|
||||
| `.Modules.CurrentConditions.ConditionTextLower` | string | Lower-case current condition text for inline sentences. |
|
||||
| `.Modules.CurrentConditions.TemperatureF` | *float64 | Current temperature. |
|
||||
| `.Modules.CurrentConditions.ApparentTemperatureF` | *float64 | Apparent temperature. |
|
||||
| `.Modules.CurrentConditions.RelativeHumidityPercent` | *float64 | Relative humidity. |
|
||||
| `.Modules.CurrentConditions.WindDirection` | string | 16-point compass wind direction. |
|
||||
| `.Modules.CurrentConditions.WindDirectionText` | string | Lower-case full wind direction text, such as `northwest`. |
|
||||
| `.Modules.CurrentConditions.WindSpeedMph` | *float64 | Wind speed. |
|
||||
|
||||
Example:
|
||||
@@ -129,12 +127,15 @@ Common period fields:
|
||||
| Variable | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `.Modules.HourlyForecast.Periods` | []briefing.HourlyForecastPeriod | Ordered periods for the hourly report valid period. |
|
||||
| `.Modules.HourlyForecast.Periods[].HourLabel` | string | Friendly hour label such as `4:00 PM`. |
|
||||
| `.Modules.HourlyForecast.Periods[].PeriodBegins` | string | Friendly local period start label. |
|
||||
| `.Modules.HourlyForecast.Periods[].PeriodEnds` | string | Friendly local period end label. |
|
||||
| `.Modules.HourlyForecast.Periods[].Name` | string | Source period name. |
|
||||
| `.Modules.HourlyForecast.Periods[].TextDescription` | string | Hourly forecast text. |
|
||||
| `.Modules.HourlyForecast.Periods[].TextDescriptionLower` | string | Lower-case hourly forecast text for inline sentences. |
|
||||
| `.Modules.HourlyForecast.Periods[].TemperatureF` | *float64 | Forecast temperature. |
|
||||
| `.Modules.HourlyForecast.Periods[].ProbabilityOfPrecipitationPercent` | *float64 | Forecast precipitation probability. |
|
||||
| `.Modules.HourlyForecast.Periods[].MentionPrecipitation` | bool | True when precipitation probability meets the hourly mention threshold. |
|
||||
| `.Modules.HourlyForecast.Periods[].WindDirection` | string | 16-point compass wind direction. |
|
||||
| `.Modules.HourlyForecast.Periods[].WindSpeedMph` | *float64 | Wind speed. |
|
||||
| `.Modules.HourlyForecast.Periods[].WindGustMph` | *float64 | Wind gust. |
|
||||
@@ -143,7 +144,7 @@ Example:
|
||||
|
||||
```gotemplate
|
||||
{{ with .Modules.HourlyForecast }}{{ range .Periods }}
|
||||
- {{ .PeriodBegins }}: {{ .TextDescription }}{{ with .TemperatureF }}; {{ . }} F{{ end }}{{ with .ProbabilityOfPrecipitationPercent }}; {{ . }}% precipitation{{ end }}
|
||||
- **{{ .HourLabel }}:**{{ with .TemperatureF }} {{ . }}°F{{ end }} and {{ .TextDescriptionLower }}.{{ if .MentionPrecipitation }}{{ with .ProbabilityOfPrecipitationPercent }} Probability of precipitation is {{ . }}%.{{ end }}{{ end }}
|
||||
{{ else }}
|
||||
- No hourly forecast rows available.
|
||||
{{ end }}{{ end }}
|
||||
@@ -160,9 +161,12 @@ Common fields:
|
||||
| `.Modules.PrecipTiming.ProbabilityThreshold` | float64 | Threshold used to define precipitation windows. |
|
||||
| `.Modules.PrecipTiming.PrecipitationWindows` | []briefing.PrecipitationWindowModule | One or more threshold precipitation windows. |
|
||||
| `.Modules.PrecipTiming.PrecipitationWindows[].PeriodBegins` | string | Friendly local window start. |
|
||||
| `.Modules.PrecipTiming.PrecipitationWindows[].PeriodBeginsHourLabel` | string | Friendly window start hour, such as `4:00 PM`. |
|
||||
| `.Modules.PrecipTiming.PrecipitationWindows[].PeriodEnds` | string | Friendly local window end; omitted for open windows. |
|
||||
| `.Modules.PrecipTiming.PrecipitationWindows[].PeriodEndsHourLabel` | string | Friendly window end hour; omitted for open windows. |
|
||||
| `.Modules.PrecipTiming.PrecipitationWindows[].MaxPopPercent` | *int | Highest precipitation probability inside the window. |
|
||||
| `.Modules.PrecipTiming.PrecipitationWindows[].MaxPopTime` | string | Friendly local time for the window maximum. |
|
||||
| `.Modules.PrecipTiming.PrecipitationWindows[].MaxPopHourLabel` | string | Friendly hour label for the window maximum. |
|
||||
| `.Modules.PrecipTiming.ThunderMentioned` | bool | Whether thunder is mentioned in the forecast text. |
|
||||
|
||||
### Alert Digest
|
||||
|
||||
Reference in New Issue
Block a user