add tools.py

This commit is contained in:
2026-05-26 13:46:42 +00:00
parent 69efcf5781
commit 4616c05852
+30
View File
@@ -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
hardcoded string so that the repository is selfcontained.
"""
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 humanreadable weather report.
"""
# In a real implementation we would query an API here.
return f"В городе {city} на {date} ожидается солнечная погода с температурой 25°C."
__all__ = ["get_weather"]