Spaces:
Runtime error
Runtime error
Commit
·
97fed4a
1
Parent(s):
1c6a590
🚧 wikipedia_featured_articles_title
Browse files
app.py
CHANGED
|
@@ -16,6 +16,7 @@ from tools import (
|
|
| 16 |
list_wikipedia_sections,
|
| 17 |
count_tables_in_wikipedia_section,
|
| 18 |
extract_nth_table_in_wikipedia_section,
|
|
|
|
| 19 |
)
|
| 20 |
|
| 21 |
# (Keep Constants as is)
|
|
@@ -72,6 +73,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 72 |
list_wikipedia_sections,
|
| 73 |
count_tables_in_wikipedia_section,
|
| 74 |
extract_nth_table_in_wikipedia_section,
|
|
|
|
| 75 |
],
|
| 76 |
verbosity_level=2,
|
| 77 |
additional_authorized_imports=authorized_imports,
|
|
|
|
| 16 |
list_wikipedia_sections,
|
| 17 |
count_tables_in_wikipedia_section,
|
| 18 |
extract_nth_table_in_wikipedia_section,
|
| 19 |
+
wikipedia_featured_articles_title,
|
| 20 |
)
|
| 21 |
|
| 22 |
# (Keep Constants as is)
|
|
|
|
| 73 |
list_wikipedia_sections,
|
| 74 |
count_tables_in_wikipedia_section,
|
| 75 |
extract_nth_table_in_wikipedia_section,
|
| 76 |
+
wikipedia_featured_articles_title,
|
| 77 |
],
|
| 78 |
verbosity_level=2,
|
| 79 |
additional_authorized_imports=authorized_imports,
|
tools.py
CHANGED
|
@@ -157,3 +157,23 @@ def extract_nth_table_in_wikipedia_section(
|
|
| 157 |
rows.append("\t".join(texts))
|
| 158 |
|
| 159 |
return "\n".join(rows)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
rows.append("\t".join(texts))
|
| 158 |
|
| 159 |
return "\n".join(rows)
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
@tool
|
| 163 |
+
def wikipedia_featured_articles_title(year: int) -> str:
|
| 164 |
+
"""
|
| 165 |
+
Return the Wikipedia page title listing Featured Articles that were promoted in a given year.
|
| 166 |
+
|
| 167 |
+
Args:
|
| 168 |
+
year (int): The calendar year of interest (e.g., 2021, 2025).
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
Note:
|
| 172 |
+
This tool should be used in conjunction with list_wikipedia_sections
|
| 173 |
+
|
| 174 |
+
Returns:
|
| 175 |
+
str: The Wikipedia page title.
|
| 176 |
+
Example: if year = 2021, returns
|
| 177 |
+
"Wikipedia:Featured articles promoted in 2021".
|
| 178 |
+
"""
|
| 179 |
+
return f"Wikipedia:Featured articles promoted in {year}"
|