Spaces:
Sleeping
Sleeping
Update app.py
Browse filesImproved the docstring to guide the agent better.
app.py
CHANGED
|
@@ -21,12 +21,19 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 21 |
|
| 22 |
@tool
|
| 23 |
def get_temperature(location: str, temp_scale: str = "celsius") -> tuple[float, str]:
|
| 24 |
-
"""A tool that fetches the current temperature
|
| 25 |
Args:
|
| 26 |
location: The name of the city/location
|
| 27 |
temp_scale: Temperature scale to use ('celsius' or 'fahrenheit')
|
| 28 |
-
|
| 29 |
-
tuple:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
"""
|
| 31 |
def get_description(temp_c: float) -> str:
|
| 32 |
"""Get qualitative description based on Celsius temperature"""
|
|
|
|
| 21 |
|
| 22 |
@tool
|
| 23 |
def get_temperature(location: str, temp_scale: str = "celsius") -> tuple[float, str]:
|
| 24 |
+
"""A tool that fetches the current temperature and provides a qualitative description.
|
| 25 |
Args:
|
| 26 |
location: The name of the city/location
|
| 27 |
temp_scale: Temperature scale to use ('celsius' or 'fahrenheit')
|
| 28 |
+
Returns:
|
| 29 |
+
tuple: A tuple containing:
|
| 30 |
+
- temperature (float): The numerical temperature value
|
| 31 |
+
- unit (str): The temperature unit ('C' or 'F')
|
| 32 |
+
- description (str): How the temperature feels (freezing/cold/mild/warm/hot)
|
| 33 |
+
Usage:
|
| 34 |
+
temp, unit, feel = get_temperature("Warsaw", "celsius")
|
| 35 |
+
Example output: (-2.4, 'C', 'freezing')
|
| 36 |
+
Formatted: "The current temperature in Warsaw is -2.4°C - it feels freezing"
|
| 37 |
"""
|
| 38 |
def get_description(temp_c: float) -> str:
|
| 39 |
"""Get qualitative description based on Celsius temperature"""
|