Double search(Tavily + Kimi)

v1.0.0

双搜索功能 (Tavily + Kimi) - 支持并行搜索和结果合并

0· 107·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for wjs028-coder/double-search.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Double search(Tavily + Kimi)" (wjs028-coder/double-search) from ClawHub.
Skill page: https://clawhub.ai/wjs028-coder/double-search
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required env vars: TAVILY_API_KEY, KIMI_API_KEY
Required binaries: python3
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install double-search

ClawHub CLI

Package manager switcher

npx clawhub@latest install double-search
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (double-search using Tavily and Kimi) match the code, which calls Tavily and Kimi APIs. One inconsistency: registry-level required env vars list both TAVILY_API_KEY and KIMI_API_KEY as required, while the SKILL.md/README and runtime code treat KIMI_API_KEY as optional (only loads Kimi if KIMI_API_KEY is set). This is likely a metadata inaccuracy rather than malicious behavior.
Instruction Scope
SKILL.md instructions are limited to installing Python deps, setting environment variables or a .env file, and using the provided Python API. The runtime code performs network requests only to the declared search endpoints (https://api.tavily.com/search and https://api.moonshot.cn/v1/chat/completions) and does not attempt to read unrelated system files or secrets.
Install Mechanism
No risky remote downloads. The included install.sh uses pip to install aiohttp and python-dotenv and writes a local .env template; this is standard. There is no download-from-arbitrary-URL or extracted archive behavior.
Credentials
Requests TAVILY_API_KEY (primary) and KIMI_API_KEY. These are proportionate to the skill's function. Minor inconsistency: registry metadata marks both env vars as required, but code & docs treat KIMI_API_KEY as optional — you don't need to provide KIMI if you only want Tavily. No other unrelated credentials are requested.
Persistence & Privilege
Skill does not request always:true nor attempt to modify other skills or system-wide configs. It writes a .env file into its own directory via install.sh (expected), and runs normal Python test code. Autonomous invocation is allowed by default but not combined with other red flags.
Assessment
This skill appears to do what it claims: run parallel searches against Tavily and optionally Kimi. Before installing, verify you trust the external endpoints (https://api.tavily.com and https://api.moonshot.cn) because the skill will send your API keys and search queries to them. Note the registry metadata erroneously marks KIMI_API_KEY as required even though Kimi is optional — you can run with only TAVILY_API_KEY. Run install.sh in an environment where pip installs are acceptable (it will install aiohttp and python-dotenv), and avoid supplying high-privilege or unrelated credentials. If you have security concerns, review the included __init__.py (network calls are explicit) or run the code in an isolated environment and use API keys with limited scope. If you want the metadata corrected, request that KIMI_API_KEY be marked optional in registry fields.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

🔍 Clawdis
Binspython3
EnvTAVILY_API_KEY, KIMI_API_KEY
Primary envTAVILY_API_KEY
latestvk974qmnr7wt3jqves3sd4z2axs83w160
107downloads
0stars
1versions
Updated 4w ago
v1.0.0
MIT-0

Double Search Skill

双重搜索功能,同时使用Tavily和Kimi搜索引擎,提供更全面、准确的搜索结果。

功能特性

  • 双引擎并行搜索:同时使用Tavily和Kimi
  • 智能结果合并:自动合并、去重和排序
  • 异步高效:基于asyncio的高性能实现
  • 错误容错:单个搜索失败不影响整体
  • 灵活配置:支持环境变量和配置文件

快速开始

1. 安装Python依赖

pip install aiohttp python-dotenv

2. 设置环境变量

.env文件中添加:

TAVILY_API_KEY=tvly-xxxxxxxxxxxx
KIMI_API_KEY=your_kimi_api_key_here

或者设置系统环境变量:

export TAVILY_API_KEY="tvly-xxxxxxxxxxxx"
export KIMI_API_KEY="your_kimi_api_key_here"

3. 基本使用

from double_search import DoubleSearcher

async def search_example():
    searcher = DoubleSearcher()

    # 执行搜索
    results = await searcher.search("人工智能发展趋势")

    # 打印结果
    print(f"搜索结果: {results}")

    # 查看各个搜索引擎的结果
    print(f"Tavily结果: {results.get('tavily', [])}")
    print(f"Kimi结果: {results.get('kimi', [])}")

    return results

API文档

DoubleSearcher类

初始化

searcher = DoubleSearcher()

search方法

async def search(
    query: str,
    merge_results: bool = True,
    limit_per_source: int = 5
) -> Dict[str, Any]

参数:

  • query (str): 搜索查询字符串
  • merge_results (bool): 是否合并结果(默认True)
  • limit_per_source (int): 每个搜索源返回的结果数量(默认5)

返回:

{
  "query": "搜索内容",
  "merged_results": [
    {
      "title": "结果标题",
      "url": "https://example.com",
      "snippet": "结果摘要",
      "source": "tavily"
    }
  ],
  "source_breakdown": {
    "tavily": [...],
    "kimi": [...]
  }
}

高级用法

1. 不合并结果

results = await searcher.search(
    query="技术趋势",
    merge_results=False
)

# 结果按搜索源分开
print(results['tavily'])
print(results['kimi'])

2. 限制每个源的结果数量

results = await searcher.search(
    query="市场分析",
    limit_per_source=3
)

3. 自定义结果处理

results = await searcher.search("投资策略")

# 只获取Tavily的结果
tavily_results = results.get('tavily', [])

# 只获取Kimi的结果
kimi_results = results.get('kimi', [])

# 获取合并的结果
all_results = results.get('merged_results', [])

配置管理

环境变量配置

# 必需
TAVILY_API_KEY=tvly-xxxxxxxxxxxx

# 可选(不设置则只使用Tavily)
KIMI_API_KEY=your_kimi_api_key_here

配置文件支持

支持.env文件:

# .env文件示例
TAVILY_API_KEY=tvly-xxxxxxxxxxxx
KIMI_API_KEY=your_kimi_api_key_here

错误处理

async def safe_search(query: str):
    searcher = DoubleSearcher()

    try:
        results = await searcher.search(query)

        if not results['merged_results']:
            return {"error": "搜索无结果", "query": query}

        return results

    except Exception as e:
        return {"error": f"搜索失败: {str(e)}", "query": query}

性能优化

并行搜索效率

  • Tavily和Kimi同时搜索,总时间接近较慢的搜索引擎
  • 适合需要全面结果的场景

结果缓存

from functools import lru_cache

class CachedSearcher(DoubleSearcher):
    @lru_cache(maxsize=100)
    async def search(self, query: str, ...):
        return await super().search(query, ...)

使用场景

1. 内容创作

async def research_topic(topic):
    searcher = DoubleSearcher()
    results = await searcher.search(topic)

    # 分析多个来源
    insights = analyze_results(results)
    return insights

2. 财经分析

async def financial_analysis(ticker):
    searcher = DoubleSearcher()
    query = f"{ticker} 财经分析"
    results = await searcher.search(query)

    # 过滤财经相关结果
    financial_news = filter_financial_content(results)
    return financial_news

3. 代码搜索

async def code_search(problem):
    searcher = DoubleSearcher()
    results = await searcher.search(problem)

    # 优先获取技术相关结果
    technical_results = filter_tech_content(results)
    return technical_results

故障排除

问题1:搜索无结果

# 检查API keys
echo $TAVILY_API_KEY
echo $KIMI_API_KEY

# 验证API keys有效性

问题2:Python模块未找到

# 确保在正确的工作目录
cd ~/.openclaw/skills/double-search

# 检查Python路径
which python3

问题3:依赖缺失

# 安装依赖
pip install aiohttp python-dotenv

版本信息

  • 版本: 1.0.0
  • Python版本: 3.8+
  • 更新日期: 2026-03-27
  • 兼容性: OpenClaw skill系统

Comments

Loading comments...