@@ -1,6 +1,5 @@
11 /* personal-assistant-thing/src/lib/ollama/weather.ts */
22
3-import { debug } from "../debug";
43 import { getCache, setCache } from "../cache";
54 import { createRateLimiter } from "../ratelimit";
65
@@ -37,14 +36,9 @@ export async function queryWeather(
3736 const cacheKey = `weather:${query.toLowerCase().trim()}:${timezone}:${days}`;
3837 const cached = await getCache<string>(cacheKey);
3938 if (cached !== null) {
40- debug(`[Weather] Cache hit for: "${query}"`);
4139 return cached;
4240 }
4341
44- debug(
45- `[Weather] Querying weather for: "${query}" (${days > 0 ? `${days} days` : "current only"}, ${timezone})`
46- );
47-
4842 // Check rate limit before making the request
4943 const rateLimitCheck = await weatherRateLimiter.check();
5044 if (!rateLimitCheck.allowed) {
@@ -68,7 +62,6 @@ export async function queryWeather(
6862
6963 const geocodeResponse = await fetch(`${geocodeUrl}?${geocodeParams.toString()}`);
7064 if (!geocodeResponse.ok) {
71- debug(`[Weather] Geocoding error: HTTP ${geocodeResponse.status}`);
7265 throw new Error(`Failed to geocode location "${query}" (${geocodeResponse.status})`);
7366 }
7467
@@ -83,8 +76,6 @@ export async function queryWeather(
8376 const { latitude, longitude, name, country, admin1 } = geocodeData.results[0];
8477 const locationName = `${name}${admin1 ? `, ${admin1}` : ""}${country ? `, ${country}` : ""}`;
8578
86- debug(`[Weather] Found location: ${locationName} (${latitude}, ${longitude})`);
87-
8879 // Now fetch weather data - focus on temperature and precipitation
8980 const weatherUrl = "https://api.open-meteo.com/v1/forecast";
9081 const weatherParams = new URLSearchParams({
@@ -102,7 +93,6 @@ export async function queryWeather(
10293
10394 const weatherResponse = await fetch(`${weatherUrl}?${weatherParams.toString()}`);
10495 if (!weatherResponse.ok) {
105- debug(`[Weather] Weather API error: HTTP ${weatherResponse.status}`);
10696 throw new Error(
10797 `Failed to fetch weather data for "${locationName}" (${weatherResponse.status})`
10898 );