Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,6 +21,8 @@ def convert_currency(curr1:str, curr2:str, amount:int) -> str:
|
|
| 21 |
cr = Currencyrates()
|
| 22 |
converted_amount = cr.convert(curr1, curr2, amount)
|
| 23 |
return f"{amount} {curr1} is {converted_amount} {curr2}"
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 26 |
@tool
|
|
|
|
| 21 |
cr = Currencyrates()
|
| 22 |
converted_amount = cr.convert(curr1, curr2, amount)
|
| 23 |
return f"{amount} {curr1} is {converted_amount} {curr2}"
|
| 24 |
+
except Exception as e:
|
| 25 |
+
return f"Error fetching the exchange rate for {curr1} to {curr2}: {str(e)}"
|
| 26 |
|
| 27 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 28 |
@tool
|