razumelo commited on
Commit
f4f1bd1
·
verified ·
1 Parent(s): 5c26f38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -37,7 +37,7 @@ def search_wikipedia(query: str) -> str:
37
  def web_search(query: str) -> str:
38
  """Search the web for general information. Use this when Wikipedia is not sufficient."""
39
  try:
40
- from duckduckgo_search import DDGS
41
  with DDGS() as ddgs:
42
  results = list(ddgs.text(query, max_results=3))
43
  if results:
@@ -50,6 +50,7 @@ def web_search(query: str) -> str:
50
  except Exception as e:
51
  return f"Error performing web search: {str(e)}"
52
 
 
53
  @tool
54
  def calculator(expression: str) -> str:
55
  """Evaluate mathematical expressions. Example: '15 + 27' or '2 * (3 + 4)'."""
 
37
  def web_search(query: str) -> str:
38
  """Search the web for general information. Use this when Wikipedia is not sufficient."""
39
  try:
40
+ from ddgs import DDGS
41
  with DDGS() as ddgs:
42
  results = list(ddgs.text(query, max_results=3))
43
  if results:
 
50
  except Exception as e:
51
  return f"Error performing web search: {str(e)}"
52
 
53
+
54
  @tool
55
  def calculator(expression: str) -> str:
56
  """Evaluate mathematical expressions. Example: '15 + 27' or '2 * (3 + 4)'."""