Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,13 +37,12 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 37 |
@tool
|
| 38 |
def get_news(rss_url: str, max_items: int) -> str:
|
| 39 |
"""
|
| 40 |
-
|
| 41 |
|
| 42 |
Args:
|
| 43 |
-
rss_url:
|
| 44 |
max_items: 要顯示的最大新聞條目數量。
|
| 45 |
"""
|
| 46 |
-
DEFAULT_RSS_URL = "https://rthk.hk/rthk/news/rss/c_expressnews_clocal.xml"
|
| 47 |
|
| 48 |
# 如果 rss_url 未提供或為空,則使用預設 URL
|
| 49 |
url_to_fetch = rss_url if rss_url and rss_url.strip() else DEFAULT_RSS_URL
|
|
|
|
| 37 |
@tool
|
| 38 |
def get_news(rss_url: str, max_items: int) -> str:
|
| 39 |
"""
|
| 40 |
+
從 rss_url 獲取最新的新聞。
|
| 41 |
|
| 42 |
Args:
|
| 43 |
+
rss_url: https://rthk.hk/rthk/news/rss/c_expressnews_clocal.xml
|
| 44 |
max_items: 要顯示的最大新聞條目數量。
|
| 45 |
"""
|
|
|
|
| 46 |
|
| 47 |
# 如果 rss_url 未提供或為空,則使用預設 URL
|
| 48 |
url_to_fetch = rss_url if rss_url and rss_url.strip() else DEFAULT_RSS_URL
|