Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,6 +33,19 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
final_answer = FinalAnswerTool()
|
| 38 |
|
|
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
+
@tool
|
| 37 |
+
def get_currency_value(money_1:str):
|
| 38 |
+
"""A tool that fetches the specific currency value.
|
| 39 |
+
Args:
|
| 40 |
+
money_1: A string representing a valid currency (e.g. 'Turkish Liras/TRY').
|
| 41 |
+
"""
|
| 42 |
+
try:
|
| 43 |
+
rsp = requests.get('rates').get(money_1)
|
| 44 |
+
return f"The {money_1} currency value: {rsp}"
|
| 45 |
+
except as e:
|
| 46 |
+
return f"Error fetching rate for currency"
|
| 47 |
+
|
| 48 |
+
|
| 49 |
|
| 50 |
final_answer = FinalAnswerTool()
|
| 51 |
|