|
@@ -9,7 +9,6 @@ from pqai_agent.toolkit.tool_registry import register_toolkit
|
|
|
|
|
|
@register_toolkit
|
|
|
class HotTopicToolkit(BaseToolkit):
|
|
|
- @staticmethod
|
|
|
def get_hot_topics(self) -> List[Dict[str, Any]]:
|
|
|
"""
|
|
|
获取热点内容列表
|
|
@@ -24,10 +23,11 @@ class HotTopicToolkit(BaseToolkit):
|
|
|
if data.get("code") == 0 and data.get("success"):
|
|
|
result = []
|
|
|
for item in data.get("data", []):
|
|
|
- result.append({
|
|
|
- "title": item.get("标题"),
|
|
|
- "url": item.get("链接")
|
|
|
- })
|
|
|
+ if item.get("title") and item.get("url"):
|
|
|
+ result.append({
|
|
|
+ "title": item.get("title"),
|
|
|
+ "url": item.get("url")
|
|
|
+ })
|
|
|
return result
|
|
|
else:
|
|
|
logger.error(f"Failed to fetch hot topics: {data.get('msg', 'Unknown error')}")
|