Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from bs4 import BeautifulSoup
|
|
10 |
|
11 |
# Define a function to extract image URLs from DuckDuckGo search
|
12 |
@tool
|
13 |
-
def search_images_for_presentation(query: str) ->
|
14 |
"""
|
15 |
Searches for images related to a given query.
|
16 |
|
@@ -32,7 +32,7 @@ def search_images_for_presentation(query: str) -> list:
|
|
32 |
soup = BeautifulSoup(helium.get_driver().page_source, "html.parser")
|
33 |
images = [img["src"] for img in soup.find_all("img") if "src" in img.attrs]
|
34 |
|
35 |
-
return images[
|
36 |
|
37 |
|
38 |
# Initialize agent
|
|
|
10 |
|
11 |
# Define a function to extract image URLs from DuckDuckGo search
|
12 |
@tool
|
13 |
+
def search_images_for_presentation(query: str) -> str:
|
14 |
"""
|
15 |
Searches for images related to a given query.
|
16 |
|
|
|
32 |
soup = BeautifulSoup(helium.get_driver().page_source, "html.parser")
|
33 |
images = [img["src"] for img in soup.find_all("img") if "src" in img.attrs]
|
34 |
|
35 |
+
return images[0] # Return the top 5 image URLs
|
36 |
|
37 |
|
38 |
# Initialize agent
|