MCPcopy
hub / github.com/openai/openai-assistants-quickstart / getWeather

Function getWeather

app/utils/weather.ts:1–13  ·  view source on GitHub ↗
(location)

Source from the content-addressed store, hash-verified

1const getWeather = (location) => {
2 // chose a random temperature and condition
3 const randomTemperature = Math.floor(Math.random() * (80 - 50 + 1)) + 50;
4 const randomConditionIndex = Math.floor(Math.random() * 5);
5 const conditions = ["Cloudy", "Sunny", "Rainy", "Snowy", "Windy"];
6
7 return {
8 location: location,
9 temperature: randomTemperature,
10 unit: "F",
11 conditions: conditions[randomConditionIndex],
12 };
13};
14
15export { getWeather };

Callers 2

functionCallHandlerFunction · 0.90
functionCallHandlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected