Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,16 +12,21 @@ from Gradio_UI import GradioUI
|
|
| 12 |
@tool
|
| 13 |
def search_articles(text2search: str, start: int, end: int, output_md: str = "arxiv_articles.md") -> str:
|
| 14 |
"""
|
| 15 |
-
A tool that searches articles on arxiv.org using a search term and saves the results
|
|
|
|
| 16 |
|
| 17 |
Args:
|
| 18 |
-
text2search (str):
|
| 19 |
-
start (int):
|
| 20 |
-
end (int):
|
| 21 |
-
output_md (str):
|
| 22 |
|
| 23 |
Returns:
|
| 24 |
-
str:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
"""
|
| 26 |
try:
|
| 27 |
# Construct the ArXiv API query
|
|
|
|
| 12 |
@tool
|
| 13 |
def search_articles(text2search: str, start: int, end: int, output_md: str = "arxiv_articles.md") -> str:
|
| 14 |
"""
|
| 15 |
+
A tool that searches for academic articles on arxiv.org using a search term and saves the results
|
| 16 |
+
as a Markdown file.
|
| 17 |
|
| 18 |
Args:
|
| 19 |
+
text2search (str): The keyword or phrase to search for in ArXiv articles.
|
| 20 |
+
start (int): The starting index of the search results (used for pagination).
|
| 21 |
+
end (int): The maximum number of articles to retrieve.
|
| 22 |
+
output_md (str, optional): The name of the output Markdown file. Defaults to "arxiv_articles.md".
|
| 23 |
|
| 24 |
Returns:
|
| 25 |
+
str: The absolute path of the generated Markdown file, or an error message if the request fails.
|
| 26 |
+
|
| 27 |
+
Example:
|
| 28 |
+
>>> search_articles("deep learning", 0, 10)
|
| 29 |
+
"Markdown file created: /absolute/path/to/arxiv_articles.md"
|
| 30 |
"""
|
| 31 |
try:
|
| 32 |
# Construct the ArXiv API query
|