Spaces:
Running
Running
Update newsletter_api.py
Browse files- newsletter_api.py +0 -4
newsletter_api.py
CHANGED
@@ -82,10 +82,6 @@ def extract_news_from_rss(feed_urls: list[str], topic: str, threshold: float = 0
|
|
82 |
# Sort articles by similarity score
|
83 |
topic_articles.sort(key=lambda x: x["similarity"], reverse=True)
|
84 |
|
85 |
-
# Select top 1 article based on similarity score - due to LLM rate limits
|
86 |
-
if len(topic_articles) > 1:
|
87 |
-
topic_articles = topic_articles[:1]
|
88 |
-
|
89 |
return topic_articles
|
90 |
except Exception as e:
|
91 |
return {"Error": str(e)}
|
|
|
82 |
# Sort articles by similarity score
|
83 |
topic_articles.sort(key=lambda x: x["similarity"], reverse=True)
|
84 |
|
|
|
|
|
|
|
|
|
85 |
return topic_articles
|
86 |
except Exception as e:
|
87 |
return {"Error": str(e)}
|