karenwky commited on
Commit
a8ad89a
·
verified ·
1 Parent(s): e18459f

Update tool.py

Browse files
Files changed (1) hide show
  1. tool.py +5 -5
tool.py CHANGED
@@ -41,11 +41,11 @@ class SimpleTool(Tool):
41
  }
42
 
43
  # Convert `value` to float if it's a string
44
- if isinstance(value, str):
45
- try:
46
- value = float(value)
47
- except ValueError:
48
- raise ValueError("Value must be a number")
49
 
50
  # Check if the units are valid
51
  if from_unit not in conversion_rates or to_unit not in conversion_rates[from_unit]:
 
41
  }
42
 
43
  # Convert `value` to float if it's a string
44
+ if isinstance(value, str):
45
+ try:
46
+ value = float(value)
47
+ except ValueError:
48
+ raise ValueError("Value must be a number")
49
 
50
  # Check if the units are valid
51
  if from_unit not in conversion_rates or to_unit not in conversion_rates[from_unit]: