From 4616c058525616c02cf5ccc6940acd8e3dc4da56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=9A=D1=83=D1=82?= =?UTF-8?q?=D0=BB=D0=B0=D1=85=D0=BC=D0=B5=D1=82=D0=BE=D0=B2?= Date: Tue, 26 May 2026 13:46:42 +0000 Subject: [PATCH] add tools.py --- tools.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tools.py diff --git a/tools.py b/tools.py new file mode 100644 index 0000000..61fe21a --- /dev/null +++ b/tools.py @@ -0,0 +1,30 @@ +""" +Utility tools used by the agent. + +The assignment requires a single tool – ``get_weather`` – that returns a short +string describing the weather for a given city and date. In a real project this +would call an external API, but for the purposes of the homework we return a +hard‑coded string so that the repository is self‑contained. +""" +import json +from typing import Dict + +def get_weather(city: str = "Москва", date: str = "сегодня") -> str: + """Return a mock weather description. + + Parameters + ---------- + city : str, optional + Name of the city. Defaults to ``"Москва"``. + date : str, optional + Date for which the forecast is requested. Defaults to ``"сегодня"``. + + Returns + ------- + str + A short human‑readable weather report. + """ + # In a real implementation we would query an API here. + return f"В городе {city} на {date} ожидается солнечная погода с температурой 25°C." + +__all__ = ["get_weather"]