fixed reasoning

This commit is contained in:
2026-06-10 14:56:18 +03:00
parent 89158930ee
commit e9762d7921
7 changed files with 143 additions and 23 deletions
+12 -1
View File
@@ -137,6 +137,17 @@ def format_weather_snapshot(data: dict[str, Any] | None = None) -> str:
f"(ощущается {cur.get('apparent_temperature_c')}°C), "
f"{cur.get('conditions')}, ветер {cur.get('wind_speed_kmh')} км/ч."
)
lines.append(client.rain_summary(hours_ahead=6))
hourly = snapshot.get("hourly") or []
rainy_hours = []
for hour in hourly:
prob = hour.get("precipitation_probability")
precip = hour.get("precipitation_mm") or 0
if (prob is not None and prob >= 40) or precip > 0:
time_str = (hour.get("time") or "")[11:16]
rainy_hours.append(f"{time_str} ({prob}% вероятность, {precip} мм)")
if rainy_hours:
lines.append("Ожидаются осадки: " + ", ".join(rainy_hours[:6]))
else:
lines.append("Существенных осадков в ближайшие часы не ожидается.")
lines.append("Вопросы «что на улице» / «будет ли дождь» — get_weather.")
return "\n".join(lines)