It would be really cool to feed the daily[0]
response to OpenAI’s GPT API (Chat GPT API) and have it generate a summary:
Can you put together a single sentence forecast with the most relevant information from the following Open Weather API JSON response for tomorrow's weather? The units are imperial. Please keep the response concise and only include information if it is relevant.
Before generating a response, take a moment to internally (silently) think about the steps you would take to determine what information is relevant to include in the forecast. Ignore the provided "summary" if one is included as I want you to generate your own.
~~~
{
"dt": 1690308000,
"sunrise": 1690284742,
"sunset": 1690334902,
"moonrise": 1690310280,
"moonset": 1690262340,
"moon_phase": 0.25,
"summary": "Expect a day of partly cloudy with clear spells",
"temp": {
"day": 93.81,
"min": 73.45,
"max": 102.87,
"night": 84.83,
"eve": 100.17,
"morn": 77.09
},
"feels_like": {
"day": 101.23,
"night": 84.51,
"eve": 102.6,
"morn": 77.97
},
"pressure": 1019,
"humidity": 48,
"dew_point": 71.15,
"wind_speed": 10.49,
"wind_deg": 206,
"wind_gust": 26.42,
"weather": [
{
"id": 800,
"main": "Clear",
"description": "clear sky",
"icon": "01d"
}
],
"clouds": 0,
"pop": 0,
"uvi": 10.78
}
~~~
And the output:
I also found that using GPT-4 for this kind of logical thinking and composition results in a ‘better’ result, but that’s subjective:
I’m sure with a bit of prompt engineering, you could probably get it to summarize things just the way you want.