xenchai commited on
Commit
b1f6aa0
·
verified ·
1 Parent(s): ad4346c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -10
app.py CHANGED
@@ -21,15 +21,8 @@ def get_current_time_in_timezone(timezone: str) -> str:
21
  return f"The current local time in {timezone} is: {local_time}"
22
  except Exception as e:
23
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
24
- @tool
25
- def get_search_result(quer:str)->str:
26
- """A tool that fetches the search result upon giving the query.
27
- Args:
28
- quer:A String representing a valid set of characters to search .(e.g.,'what is a swat team?')
29
- """
30
- duckduckgotool=DuckDuckGoSearchTool(quer)
31
- return duckduckgotool
32
-
33
 
34
  # Initialize the final answer tool
35
  final_answer = FinalAnswerTool()
@@ -56,7 +49,7 @@ with open("prompts.yaml", 'r') as stream:
56
  # It is important to keep final_answer as part of the tools.
57
  agent = CodeAgent(
58
  model=model,
59
- tools=[final_answer, get_current_time_in_timezone, image_generation_tool,get_search_result],
60
  max_steps=6,
61
  verbosity_level=1,
62
  grammar=None,
 
21
  return f"The current local time in {timezone} is: {local_time}"
22
  except Exception as e:
23
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
24
+
25
+ duckduckgo_search_tool = DuckDuckGoSearchTool(quer)
 
 
 
 
 
 
 
26
 
27
  # Initialize the final answer tool
28
  final_answer = FinalAnswerTool()
 
49
  # It is important to keep final_answer as part of the tools.
50
  agent = CodeAgent(
51
  model=model,
52
+ tools=[final_answer, get_current_time_in_timezone, image_generation_tool],
53
  max_steps=6,
54
  verbosity_level=1,
55
  grammar=None,