fixed reasoning
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user