refactor: cleanup dead code, fix model confusion, streamline CLI
- Remove 3 dead modules: academic/, wechat/, social/ (merged into engines/) - Remove 4 stale news scripts (tech_news.py, wallstreetcn.py, cls.py, rss.py) - scripts/core/base.py: canonical SearchResult + BaseEngine (was in engines/base.py) - scripts/engines/base.py: re-exports from core.base for compatibility - scripts/engines/news_engine.py: Bing News + RSS unified (was in scripts/news/rss.py) - scripts/engines/academic_engine.py: ArXiv + CrossRef unified (was in scripts/academic/arxiv.py) - scripts/cli.py: complete rewrite — 10 commands (search/web/news/academic/wechat/social/rss/baidu/health/sources) - scripts/unified_search.py: clean async Python API (was a stub) - ws.py: lightweight launcher - README.md + SKILL.md: updated to reflect actual 15+ engines - All EngineResult → SearchResult - All engines return list[SearchResult]
This commit is contained in:
1 parent
e20478fcbd
commit
c077a7ae40
31 files changed
+1188
-3148
No files matched your search
@@ -8,7 +8,7 @@ import logging
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
from scripts.engines.base import BaseEngine, EngineResult
|
||||
from scripts.core.base import BaseEngine, SearchResult
|
||||
from scripts.engines.bing_scraper import BingScraper
|
||||
from scripts.engines.sogou_scraper import SogouScraper
|
||||
from scripts.engines.baidu_scraper import BaiduScraper
|
||||
@@ -59,7 +59,7 @@ class ParallelSearch:
|
||||
max_results: int = 10,
|
||||
region: str = "cn",
|
||||
**kwargs,
|
||||
) -> tuple[list[EngineResult], SearchStats]:
|
||||
) -> tuple[list[SearchResult], SearchStats]:
|
||||
"""
|
||||
Search across specified engines in parallel.
|
||||
|
||||
@@ -138,7 +138,7 @@ class ParallelSearch:
|
||||
|
||||
async def _run_engine(
|
||||
self, engine: BaseEngine, query: str, max_results: int, kwargs: dict
|
||||
) -> tuple[list[EngineResult], float]:
|
||||
) -> tuple[list[SearchResult], float]:
|
||||
"""Run a single engine with timing."""
|
||||
with execution_log.track(engine.name, "search", query=query) as ctx:
|
||||
t0 = time.time()
|
||||
@@ -162,7 +162,7 @@ class ParallelSearch:
|
||||
vertical: str,
|
||||
max_results: int = 10,
|
||||
**kwargs,
|
||||
) -> tuple[list[EngineResult], SearchStats]:
|
||||
) -> tuple[list[SearchResult], SearchStats]:
|
||||
"""Search a specific vertical (news/academic/github)."""
|
||||
if vertical == "github":
|
||||
# GitHub supports sub-types
|
||||
|
||||
Reference in new issue
Block a user