petkar commited on
Commit
7ea1b9a
·
verified ·
1 Parent(s): f4003a5

Update app.py

Browse files

use the load_tool instead duckduck

Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -18,6 +18,9 @@ from Gradio_UI import GradioUI
18
  # """
19
  # return "What magic will you build ?"
20
 
 
 
 
21
  @tool
22
  def my_custom_tool(city1: str, city2: str) -> str:
23
  """
@@ -29,9 +32,9 @@ def my_custom_tool(city1: str, city2: str) -> str:
29
  A string listing the top 5 sightseeing locations in each city.
30
  """
31
  # Search for top 5 sightseeing locations in city1
32
- results_city1 = DuckDuckGoSearchTool(f"top 5 sightseeing locations in {city1}")
33
  # Search for top 5 sightseeing locations in city2
34
- results_city2 = DuckDuckGoSearchTool(f"top 5 sightseeing locations in {city2}")
35
 
36
  # Format the results as a string
37
  output = f"Top 5 sightseeing locations in {city1}:\n"
 
18
  # """
19
  # return "What magic will you build ?"
20
 
21
+ # Load the DuckDuckGo search tool
22
+ ddg = load_tool("duckduckgo")
23
+
24
  @tool
25
  def my_custom_tool(city1: str, city2: str) -> str:
26
  """
 
32
  A string listing the top 5 sightseeing locations in each city.
33
  """
34
  # Search for top 5 sightseeing locations in city1
35
+ results_city1 = ddg(f"top 5 sightseeing locations in {city1}")
36
  # Search for top 5 sightseeing locations in city2
37
+ results_city2 = ddg(f"top 5 sightseeing locations in {city2}")
38
 
39
  # Format the results as a string
40
  output = f"Top 5 sightseeing locations in {city1}:\n"