Spaces:
Sleeping
Sleeping
fix
Browse files- tools/rss_get_papers.py +3 -3
tools/rss_get_papers.py
CHANGED
@@ -11,10 +11,10 @@ class HFDaylyPapperTool(Tool):
|
|
11 |
name = "get_actual_ai_news"
|
12 |
description = "Return actual news about AI today."
|
13 |
output_type = "string"
|
|
|
14 |
|
15 |
def __init__(self, max_results=10, **kwargs):
|
16 |
super().__init__()
|
17 |
-
self.max_results = max_results
|
18 |
self.rss_processor = RSSFeedProcessor()
|
19 |
self.rss_processor.register_feed(
|
20 |
"HuggingFace Daily pappers",
|
@@ -22,7 +22,7 @@ class HFDaylyPapperTool(Tool):
|
|
22 |
DailyHFRSSParser(),
|
23 |
)
|
24 |
|
25 |
-
def forward(self) -> str:
|
26 |
try:
|
27 |
from markdownify import markdownify
|
28 |
from smolagents.utils import truncate_content
|
@@ -33,7 +33,7 @@ class HFDaylyPapperTool(Tool):
|
|
33 |
) from e
|
34 |
|
35 |
try:
|
36 |
-
response = self.rss_processor.get_latest_articles()
|
37 |
|
38 |
result = ""
|
39 |
for article in response:
|
|
|
11 |
name = "get_actual_ai_news"
|
12 |
description = "Return actual news about AI today."
|
13 |
output_type = "string"
|
14 |
+
inputs = {'number': {'type': 'int', 'description': 'How much paper you want research.'}}
|
15 |
|
16 |
def __init__(self, max_results=10, **kwargs):
|
17 |
super().__init__()
|
|
|
18 |
self.rss_processor = RSSFeedProcessor()
|
19 |
self.rss_processor.register_feed(
|
20 |
"HuggingFace Daily pappers",
|
|
|
22 |
DailyHFRSSParser(),
|
23 |
)
|
24 |
|
25 |
+
def forward(self, number: int) -> str:
|
26 |
try:
|
27 |
from markdownify import markdownify
|
28 |
from smolagents.utils import truncate_content
|
|
|
33 |
) from e
|
34 |
|
35 |
try:
|
36 |
+
response = self.rss_processor.get_latest_articles(["HuggingFace Daily pappers"], number)
|
37 |
|
38 |
result = ""
|
39 |
for article in response:
|