Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,12 +10,13 @@ from Gradio_UI import GradioUI
|
|
10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
11 |
@tool
|
12 |
def scrape_wiki_fifa_winners(arg1: int, arg2: str) -> str:
|
13 |
-
"""
|
14 |
-
|
|
|
15 |
|
16 |
Args:
|
17 |
-
arg1 : The year of the World Cup.
|
18 |
-
arg2 : The competition category, either "Men" or "Women".
|
19 |
|
20 |
Returns:
|
21 |
str: The winner of the given category and year or an error message.
|
@@ -25,6 +26,7 @@ def scrape_wiki_fifa_winners(arg1: int, arg2: str) -> str:
|
|
25 |
from bs4 import BeautifulSoup
|
26 |
|
27 |
def get_fifa_winners():
|
|
|
28 |
url = "https://en.wikipedia.org/wiki/List_of_FIFA_World_Cup_finals"
|
29 |
response = requests.get(url)
|
30 |
soup = BeautifulSoup(response.text, 'html.parser')
|
@@ -56,6 +58,7 @@ def scrape_wiki_fifa_winners(arg1: int, arg2: str) -> str:
|
|
56 |
|
57 |
return f"The winner of the {arg2} World Cup in {arg1} was {fifa_winners[arg2][year_str]}."
|
58 |
|
|
|
59 |
|
60 |
|
61 |
@tool
|
|
|
10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
11 |
@tool
|
12 |
def scrape_wiki_fifa_winners(arg1: int, arg2: str) -> str:
|
13 |
+
"""
|
14 |
+
This tool is used to obtain information regarding FIFA World Cup winners
|
15 |
+
for the male and female soccer competitions.
|
16 |
|
17 |
Args:
|
18 |
+
arg1 (int): The year of the World Cup.
|
19 |
+
arg2 (str): The competition category, either "Men" or "Women".
|
20 |
|
21 |
Returns:
|
22 |
str: The winner of the given category and year or an error message.
|
|
|
26 |
from bs4 import BeautifulSoup
|
27 |
|
28 |
def get_fifa_winners():
|
29 |
+
"""Scrapes Wikipedia for FIFA World Cup winners and returns a dictionary."""
|
30 |
url = "https://en.wikipedia.org/wiki/List_of_FIFA_World_Cup_finals"
|
31 |
response = requests.get(url)
|
32 |
soup = BeautifulSoup(response.text, 'html.parser')
|
|
|
58 |
|
59 |
return f"The winner of the {arg2} World Cup in {arg1} was {fifa_winners[arg2][year_str]}."
|
60 |
|
61 |
+
|
62 |
|
63 |
|
64 |
@tool
|