优化UI模块和资源推荐功能

Made-with: Cursor
This commit is contained in:
刘国栋
2026-04-30 23:35:06 +08:00
parent fb309299bf
commit 86abeeb5cc
14 changed files with 737 additions and 513 deletions
+178 -141
View File
@@ -10,31 +10,47 @@ class ResourceRecommender:
"""GEO 资源推荐器"""
def __init__(self):
# GEO 代理列表
# GEO 代理/服务列表
self.agents = [
{
"name": "KrillinAI",
"description": "专业的 GEO 代理服务,提供高质量的内容生成和优化",
"url": "https://krillin.ai",
"category": "代理服务",
"name": "Perplexity AI",
"description": "AI 搜索引擎,可用于验证 GEO 效果",
"url": "https://www.perplexity.ai",
"category": "AI 搜索",
"rating": "⭐⭐⭐⭐⭐",
"features": ["内容生成", "SEO 优化", "平台支持"]
"features": ["实时搜索", "引用来源", "模型支持"]
},
{
"name": "AutoGPT",
"description": "自动化 AI 代理,支持 GEO 内容创作",
"url": "https://autogpt.net",
"category": "代理服务",
"rating": "⭐⭐⭐⭐",
"features": ["自动化", "多任务", "API 集成"]
"name": "ChatGPT Search",
"description": "OpenAI 的搜索功能,验证品牌在 AI 搜索中的表现",
"url": "https://chat.openai.com",
"category": "AI 搜索",
"rating": "⭐⭐⭐⭐",
"features": ["GPT-4", "实时联网", "引用分析"]
},
{
"name": "AgentGPT",
"description": "基于 GPT 的智能代理,支持 GEO 策略执行",
"url": "https://agentgpt.reworkd.ai",
"category": "代理服务",
"name": "Google SGE",
"description": "Google 搜索生成体验,了解 AI 搜索趋势",
"url": "https://search.google",
"category": "AI 搜索",
"rating": "⭐⭐⭐⭐",
"features": ["策略规划", "任务执行", "结果分析"]
"features": ["AI 摘要", "来源引用", "搜索结果"]
},
{
"name": "Jasper AI",
"description": "AI 内容创作平台,支持 SEO 优化内容生成",
"url": "https://www.jasper.ai",
"category": "内容生成",
"rating": "⭐⭐⭐⭐",
"features": ["模板丰富", "品牌声音", "SEO 优化"]
},
{
"name": "Surfer SEO",
"description": "SEO 内容优化工具,支持 SERP 分析",
"url": "https://surferseo.com",
"category": "SEO 工具",
"rating": "⭐⭐⭐⭐",
"features": ["内容评分", "关键词分析", "SERP 分析"]
}
]
@@ -42,9 +58,9 @@ class ResourceRecommender:
self.tools = [
{
"name": "Google Search Console",
"description": "监控网站搜索表现,优化 GEO 效果",
"description": "监控网站在 Google 搜索中的表现",
"url": "https://search.google.com/search-console",
"category": "SEO 工具",
"category": "搜索引擎工具",
"rating": "⭐⭐⭐⭐⭐",
"features": ["搜索分析", "索引监控", "性能报告"]
},
@@ -52,44 +68,84 @@ class ResourceRecommender:
"name": "Bing Webmaster Tools",
"description": "Bing 搜索引擎的网站管理工具",
"url": "https://www.bing.com/webmasters",
"category": "SEO 工具",
"category": "搜索引擎工具",
"rating": "⭐⭐⭐⭐",
"features": ["索引提交", "搜索分析", "URL 检查"]
},
{
"name": "Schema.org Validator",
"description": "验证 JSON-LD Schema 标记",
"description": "验证 JSON-LD Schema 标记是否正确",
"url": "https://validator.schema.org",
"category": "技术工具",
"category": "结构化数据",
"rating": "⭐⭐⭐⭐⭐",
"features": ["Schema 验证", "结构化数据测试", "错误检测"]
},
{
"name": "Rich Results Test",
"description": "Google 富媒体结果测试工具",
"name": "Google Rich Results Test",
"description": "测试网页是否支持 Google 富媒体搜索结果",
"url": "https://search.google.com/test/rich-results",
"category": "技术工具",
"category": "结构化数据",
"rating": "⭐⭐⭐⭐⭐",
"features": ["富媒体测试", "预览效果", "错误诊断"]
},
{
"name": "PageSpeed Insights",
"description": "网站性能分析工具,影响 GEO 排名",
"description": "分析网页性能,Core Web Vitals 指标",
"url": "https://pagespeed.web.dev",
"category": "性能工具",
"rating": "⭐⭐⭐⭐⭐",
"features": ["性能分析", "优化建议", "移动端测试"]
},
{
"name": "Ahrefs",
"description": "SEO 工具套件,关键词研究和竞品分析",
"url": "https://ahrefs.com",
"category": "SEO 工具",
"rating": "⭐⭐⭐⭐⭐",
"features": ["关键词研究", "反向链接分析", "竞品分析"]
},
{
"name": "SEMrush",
"description": "数字营销工具,SEO 和内容营销分析",
"url": "https://www.semrush.com",
"category": "SEO 工具",
"rating": "⭐⭐⭐⭐⭐",
"features": ["关键词研究", "站点审计", "内容优化"]
},
{
"name": "Clearscope",
"description": "AI 内容优化工具,提升内容相关性",
"url": "https://www.clearscope.io",
"category": "内容优化",
"rating": "⭐⭐⭐⭐",
"features": ["内容评分", "关键词建议", "竞品分析"]
}
]
# 论文/指南链接
self.papers = [
{
"title": "GEO: Generative Engine Optimization (arXiv)",
"description": "GEO 原始研究论文,定义了生成式引擎优化的概念和方法",
"url": "https://arxiv.org/abs/2311.09735",
"category": "学术论文",
"date": "2023",
"importance": ""
},
{
"title": "Google E-E-A-T Guidelines",
"description": "Google 官方 E-E-A-T 指南,GEO 核心原则",
"url": "https://developers.google.com/search/docs/fundamentals/creating-helpful-content",
"category": "官方指南",
"date": "2023",
"date": "2024",
"importance": ""
},
{
"title": "Google Search Quality Rater Guidelines",
"description": "Google 搜索质量评估指南,详细的 E-E-A-T 标准",
"url": "static.googleusercontent.com/media/guidelines.raterhub.com/en//searchqualityevaluatorguidelines.pdf",
"category": "官方指南",
"date": "2024",
"importance": ""
},
{
@@ -101,88 +157,92 @@ class ResourceRecommender:
"importance": ""
},
{
"title": "GEO Strategy Guide",
"description": "GEOGenerative Engine Optimization)策略指南",
"url": "https://github.com/mprimi/portable-seed",
"category": "策略指南",
"title": "Google Structured Data Guidelines",
"description": "Google 结构化数据指南和最佳实践",
"url": "https://developers.google.com/search/docs/appearance/structured-data",
"category": "技术文档",
"date": "2024",
"importance": ""
},
{
"title": "AI Search Optimization",
"description": "AI 搜索引擎优化最佳实践",
"title": "AI Search Optimization Guide",
"description": "AI 搜索引擎优化最佳实践指南",
"url": "https://www.searchenginejournal.com/ai-search-optimization",
"category": "最佳实践",
"date": "2024",
"importance": ""
},
{
"title": "LLM Prompt Engineering",
"description": "大语言模型提示工程指南",
"title": "LLM Prompt Engineering Guide",
"description": "大语言模型提示工程完整指南",
"url": "https://www.promptingguide.ai",
"category": "技术指南",
"date": "持续更新",
"importance": ""
},
{
"title": "Content Quality Guidelines",
"description": "高质量内容创作指南",
"url": "https://developers.google.com/search/docs/fundamentals/creating-helpful-content",
"category": "内容指南",
"date": "2024",
"importance": ""
}
]
# 社区资源
self.communities = [
{
"name": "GEO Reddit Community",
"description": "GEO 相关讨论和经验分享",
"name": "r/SEO (Reddit)",
"description": "Reddit SEO 社区,讨论 SEO 和 GEO 策略",
"url": "https://www.reddit.com/r/SEO",
"category": "社区论坛",
"category": "论坛社区",
"rating": "⭐⭐⭐⭐⭐"
},
{
"name": "r/ChatGPT (Reddit)",
"description": "ChatGPT 社区,讨论 AI 搜索和 GEO 应用",
"url": "https://www.reddit.com/r/ChatGPT",
"category": "论坛社区",
"rating": "⭐⭐⭐⭐"
},
{
"name": "AI SEO Discord",
"description": "AI SEO 和 GEO 技术交流社区",
"url": "https://discord.gg/ai-seo",
"category": "区论坛",
"name": "SEO Twitter/X Community",
"description": "SEO 和 GEO 从业者 Twitter 社区",
"url": "https://twitter.com/search?q=SEO%20GEO",
"category": "交媒体",
"rating": "⭐⭐⭐⭐"
},
{
"name": "Google Search Central Community",
"description": "Google 官方搜索社区",
"url": "https://support.google.com/webmasters/community",
"category": "官方社区",
"rating": "⭐⭐⭐⭐⭐"
},
{
"name": "Moz Community",
"description": "Moz SEO 社区,丰富的 SEO 资源",
"url": "https://moz.com/community",
"category": "论坛社区",
"rating": "⭐⭐⭐⭐"
}
]
def get_agents(self, category: Optional[str] = None) -> List[Dict]:
"""
获取 GEO 代理列表
Args:
category: 分类筛选(可选)
Returns:
代理列表
"""
"""获取 GEO 代理列表"""
if category:
return [agent for agent in self.agents if agent.get("category") == category]
return self.agents
def get_tools(self, category: Optional[str] = None) -> List[Dict]:
"""
获取工具推荐列表
Args:
category: 分类筛选(可选)
Returns:
工具列表
"""
"""获取工具推荐列表"""
if category:
return [tool for tool in self.tools if tool.get("category") == category]
return self.tools
def get_papers(self, category: Optional[str] = None, importance: Optional[str] = None) -> List[Dict]:
"""
获取论文/指南列表
Args:
category: 分类筛选(可选)
importance: 重要性筛选(可选:高、中、低)
Returns:
论文/指南列表
"""
"""获取论文/指南列表"""
result = self.papers
if category:
result = [p for p in result if p.get("category") == category]
@@ -191,81 +251,58 @@ class ResourceRecommender:
return result
def get_communities(self) -> List[Dict]:
"""
获取社区资源列表
Returns:
社区列表
"""
"""获取社区资源列表"""
return self.communities
def search_resources(self, query: str, resource_type: Optional[str] = None) -> List[Dict]:
"""
搜索资源(简单文本匹配)
Args:
query: 搜索关键词
resource_type: 资源类型(agents, tools, papers, communities
Returns:
匹配的资源列表
"""
query_lower = query.lower()
results = []
if resource_type is None or resource_type == "agents":
for agent in self.agents:
if (query_lower in agent["name"].lower() or
query_lower in agent["description"].lower() or
any(query_lower in f.lower() for f in agent.get("features", []))):
results.append({**agent, "type": "agent"})
if resource_type is None or resource_type == "tools":
for tool in self.tools:
if (query_lower in tool["name"].lower() or
query_lower in tool["description"].lower() or
any(query_lower in f.lower() for f in tool.get("features", []))):
results.append({**tool, "type": "tool"})
if resource_type is None or resource_type == "papers":
for paper in self.papers:
if (query_lower in paper["title"].lower() or
query_lower in paper["description"].lower()):
results.append({**paper, "type": "paper"})
if resource_type is None or resource_type == "communities":
for community in self.communities:
if (query_lower in community["name"].lower() or
query_lower in community["description"].lower()):
results.append({**community, "type": "community"})
return results
def get_categories(self) -> Dict[str, List[str]]:
"""
获取所有分类
Returns:
分类字典
"""
return {
"agents": list(set(agent["category"] for agent in self.agents)),
"tools": list(set(tool["category"] for tool in self.tools)),
"papers": list(set(paper["category"] for paper in self.papers)),
"communities": list(set(community["category"] for community in self.communities))
}
def get_resource_summary(self) -> Dict[str, int]:
"""
获取资源统计摘要
Returns:
统计字典
"""
def get_resource_summary(self) -> Dict:
"""获取资源统计摘要"""
return {
"total": len(self.agents) + len(self.tools) + len(self.papers) + len(self.communities),
"agents": len(self.agents),
"tools": len(self.tools),
"papers": len(self.papers),
"communities": len(self.communities),
"total": len(self.agents) + len(self.tools) + len(self.papers) + len(self.communities)
"communities": len(self.communities)
}
def search_resources(self, query: str, resource_type: Optional[str] = None) -> List[Dict]:
"""搜索资源"""
query_lower = query.lower()
results = []
# 搜索所有资源
all_resources = []
if resource_type is None or resource_type == "agents":
for agent in self.agents:
agent["type"] = "agent"
all_resources.append(agent)
if resource_type is None or resource_type == "tools":
for tool in self.tools:
tool["type"] = "tool"
all_resources.append(tool)
if resource_type is None or resource_type == "papers":
for paper in self.papers:
paper["type"] = "paper"
all_resources.append(paper)
if resource_type is None or resource_type == "communities":
for community in self.communities:
community["type"] = "community"
all_resources.append(community)
# 搜索匹配
for resource in all_resources:
name = resource.get("name", resource.get("title", "")).lower()
description = resource.get("description", "").lower()
category = resource.get("category", "").lower()
features = " ".join(resource.get("features", [])).lower()
if (query_lower in name or
query_lower in description or
query_lower in category or
query_lower in features):
results.append(resource)
return results