Sathwik1212 commited on
Commit
5cdde98
Β·
verified Β·
1 Parent(s): 838ad90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -27,15 +27,18 @@ load_dotenv()
27
  # TOOLS
28
  #############################
29
 
 
30
  @tool
31
  def evaluate_math_expression(expr: str) -> str:
32
  """Evaluate a math expression using symbolic math."""
33
  try:
 
34
  result = sympify(expr)
35
  return str(result.evalf())
36
  except Exception as e:
37
  return f"Math evaluation error: {e}"
38
 
 
39
  @tool
40
  def search_arxiv(query: str) -> str:
41
  """Search Arxiv for scientific papers related to a query."""
 
27
  # TOOLS
28
  #############################
29
 
30
+ @tool
31
  @tool
32
  def evaluate_math_expression(expr: str) -> str:
33
  """Evaluate a math expression using symbolic math."""
34
  try:
35
+ expr = expr.replace("^", "**") # Convert caret to exponentiation
36
  result = sympify(expr)
37
  return str(result.evalf())
38
  except Exception as e:
39
  return f"Math evaluation error: {e}"
40
 
41
+
42
  @tool
43
  def search_arxiv(query: str) -> str:
44
  """Search Arxiv for scientific papers related to a query."""