So I discovered that ChatGPT is not looking at tomorrows weather data in the JSON response and instead is looking at todays data. Any idea how I can explain to ChatGPT that it needs to look at the data with tomorrows timestamp? Or maybe how I can exclude the current day in the open weather api call? I’m already excluding current, hourly and minutely in my call.
Here is the weather json, it is the second section under daily that is tomorrow:
"daily": [
{
"dt": 1703005200,
"sunrise": 1702992290,
"sunset": 1703024180,
"moonrise": 1703009220,
"moonset": 0,
"moon_phase": 0.25,
"summary": "There will be clear sky until morning, then partly cloudy",
"temp": {
"day": 21.88,
"min": 21.76,
"max": 31.93,
"night": 31.84,
"eve": 31.23,
"morn": 22.3
},
"feels_like": {
"day": 9.28,
"night": 23.29,
"eve": 21,
"morn": 14.32
},
"pressure": 1022,
"humidity": 73,
"dew_point": 15.39,
"wind_speed": 14.52,
"wind_deg": 221,
"wind_gust": 31.36,
"weather": [
{
"id": 803,
"main": "Clouds",
"description": "broken clouds",
"icon": "04d"
}
],
"clouds": 75,
"pop": 0,
"uvi": 0.71
},
{
"dt": 1703091600,
"sunrise": 1703078724,
"sunset": 1703110604,
"moonrise": 1703096820,
"moonset": 1703053080,
"moon_phase": 0.28,
"summary": "Expect a day of partly cloudy with clear spells",
"temp": {
"day": 35.31,
"min": 30,
"max": 37.31,
"night": 31.53,
"eve": 32.07,
"morn": 30.22
},
"feels_like": {
"day": 35.31,
"night": 25.66,
"eve": 25.39,
"morn": 24.57
},
"pressure": 1025,
"humidity": 51,
"dew_point": 19.18,
"wind_speed": 9.6,
"wind_deg": 215,
"wind_gust": 23.11,
"weather": [
{
"id": 802,
"main": "Clouds",
"description": "scattered clouds",
"icon": "03d"
}
],
"clouds": 34,
"pop": 0,
"uvi": 1
},
Here is my chatgpt text:
message = "Can you put together a two 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. Any numerical values should be rounded to the nearest whole number.\\n\\nBefore 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.\\n\\nMake sure you find the correct value for dt where the UTC is tomorrow.\\n~~~\\n __WEATHER_JSON__ \\n~~~"
stringJson = stringify(stringify($context.response.data.daily[0]))
stringJson = substring(stringJson, 1, size(stringJson)-1)
replace(message, "__WEATHER_JSON__", stringJson)
Thanks for your insights