Spaces:
Sleeping
Sleeping
Update tool.py
Browse files
tool.py
CHANGED
|
@@ -44,5 +44,11 @@ class SimpleTool(Tool):
|
|
| 44 |
if from_unit not in conversion_rates or to_unit not in conversion_rates[from_unit]:
|
| 45 |
raise ValueError(f"Conversion from {from_unit} to {to_unit} is not supported")
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
# Perform the conversion
|
| 48 |
return value * conversion_rates[from_unit][to_unit]
|
|
|
|
| 44 |
if from_unit not in conversion_rates or to_unit not in conversion_rates[from_unit]:
|
| 45 |
raise ValueError(f"Conversion from {from_unit} to {to_unit} is not supported")
|
| 46 |
|
| 47 |
+
# Debug error
|
| 48 |
+
print(f"Value: {value}, Type: {type(value)}")
|
| 49 |
+
print(f"From unit: {from_unit}, To unit: {to_unit}")
|
| 50 |
+
print(f"Conversion rate: {conversion_rates[from_unit][to_unit]}, Type: {type(conversion_rates[from_unit][to_unit])}")
|
| 51 |
+
|
| 52 |
+
|
| 53 |
# Perform the conversion
|
| 54 |
return value * conversion_rates[from_unit][to_unit]
|