Spaces:
Runtime error
Runtime error
Update app.py
Browse filesRestrict input to C or F for the conversion
app.py
CHANGED
|
@@ -18,8 +18,10 @@ def celcius_tool(convertTo:str, temperature:int)-> str: #it's important to speci
|
|
| 18 |
"""
|
| 19 |
if convertTo == "F":
|
| 20 |
return f"Temperature {temperature} degrees in Fahrenheit is {(temperature * 1.8) + 32}"
|
| 21 |
-
|
| 22 |
return f"Temperature {temperature} degrees in Celsius is {(temperature - 32) * 5/9}"
|
|
|
|
|
|
|
| 23 |
|
| 24 |
@tool
|
| 25 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 18 |
"""
|
| 19 |
if convertTo == "F":
|
| 20 |
return f"Temperature {temperature} degrees in Fahrenheit is {(temperature * 1.8) + 32}"
|
| 21 |
+
elif convertTo == "C":
|
| 22 |
return f"Temperature {temperature} degrees in Celsius is {(temperature - 32) * 5/9}"
|
| 23 |
+
else:
|
| 24 |
+
return f"ERROR convertTo must be either C or F"
|
| 25 |
|
| 26 |
@tool
|
| 27 |
def get_current_time_in_timezone(timezone: str) -> str:
|