1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { gpt3 } from "https://esm.town/v/patrickjm/gpt3";
import { simpleWeather } from "https://esm.town/v/patrickjm/simpleWeather";
export let weatherTomorrowGpt3 = (params: { openAiKey: string, city: string }) =>
simpleWeather(params.city).then((weather) =>
gpt3({
openAiKey: params.openAiKey,
prompt: `
Given a JSON sequence, give a short, plain-English summary about the weather tomorrow.
The hourly forecast uses military time, where i.e. 600 = 6 A.M. and 1500 = 3 P.M.
Here is the JSON string:
${JSON.stringify(weather.forecast[1])}
`,
})
);