M96820 commited on
Commit
3753dba
·
unverified ·
1 Parent(s): 141577c

fix: import user_input tool

Browse files
Files changed (1) hide show
  1. app.py +1 -18
app.py CHANGED
@@ -6,7 +6,7 @@ import requests
6
  from tools.final_answer import FinalAnswerTool
7
  from tools.web_search import DuckDuckGoSearchTool
8
  from tools.visit_webpage import VisitWebpageTool
9
- import smolagents.UserInputTool as UserInputTool
10
 
11
  from Gradio_UI import GradioUI
12
 
@@ -45,23 +45,6 @@ def search_arxiv(query: str) -> str:
45
  except Exception as e:
46
  return f"Error searching arXiv: {str(e)}"
47
 
48
-
49
- @tool
50
- def get_current_time_in_timezone(timezone: str) -> str:
51
- """A tool that fetches the current local time in a specified timezone.
52
- Args:
53
- timezone: A string representing a valid timezone (e.g., 'America/New_York').
54
- """
55
- try:
56
- # Create timezone object
57
- tz = pytz.timezone(timezone)
58
- # Get current time in that timezone
59
- local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
60
- return f"The current local time in {timezone} is: {local_time}"
61
- except Exception as e:
62
- return f"Error fetching time for timezone '{timezone}': {str(e)}"
63
-
64
-
65
  final_answer = FinalAnswerTool()
66
  user_input = UserInputTool()
67
 
 
6
  from tools.final_answer import FinalAnswerTool
7
  from tools.web_search import DuckDuckGoSearchTool
8
  from tools.visit_webpage import VisitWebpageTool
9
+ from smolagents.default_tools import UserInputTool
10
 
11
  from Gradio_UI import GradioUI
12
 
 
45
  except Exception as e:
46
  return f"Error searching arXiv: {str(e)}"
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  final_answer = FinalAnswerTool()
49
  user_input = UserInputTool()
50