Spaces:
Sleeping
Sleeping
Update app.py
Browse filesuse the load_tool instead duckduck
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 =
|
| 33 |
# Search for top 5 sightseeing locations in city2
|
| 34 |
-
results_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"
|