mcpField
D
doubao-websearch

doubao-websearch

github.com/redfox-dataProductivity450129 installsUpdated 1d ago
Repository

About doubao-websearch

doubao-websearch is a skill that accesses Doubao web search through the Redfox API. It submits queries asynchronously, polls for completion, and returns results and citations as JSON for agents to process.

Key features

  1. 01Submit search queries asynchronously
  2. 02Poll task status automatically
  3. 03Report progress on stderr
  4. 04Return results as JSON
  5. 05Handle authentication, failures, and timeouts

Use cases

  1. 01Find up-to-date information online
  2. 02Retrieve search answers with citations
  3. 03Pass structured search results to an agent

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/redfox-data/redfox-community --skill doubao-websearch

After installing, type/doubao-websearchin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.en.md
README.md
scripts/
doubao_search.py

Details

From the project README

豆包 WebSearch

📝 简介

通过红狐 API 调用豆包联网搜索能力,提交查询后自动轮询等待结果返回。适用于需要联网实时搜索、AI 辅助信息检索的场景。

✨ 功能特性

功能模块能力描述核心价值
异步提交提交搜索关键词到豆包 WebSearch,返回 taskId无需等待,立即获取任务标识
自动轮询每 5 秒查询任务状态,最多等待 5 分钟自动等待结果,无需手动查询
进度反馈轮询期间通过 stderr 实时输出等待状态用户可知搜索进度
结果输出状态变为 completed 后输出完整 JSON结构化数据便于 Agent 解析展示
异常处理覆盖 API Key 缺失、提交失败、超时、任务失败四种场景每种异常有明确提示和处理

🔑 鉴权

前往 红狐hub 获取 API Key,通过以下方式配置:

# 方式一:配置文件(如 OpenClaw 的 ~/.openclaw/openclaw.json)
{ "env": { "REDFOX_API_KEY": "ak_xxxx..." } }

# 方式二:终端环境变量
export REDFOX_API_KEY="ak_xxxx..."

🔄 工作流程

Step 1:提取搜索关键词

从用户自然语言描述中提取搜索意图和关键词,作为 inquiry_text 传入。

Step 2:调用搜索脚本
python3 ~/.agents/skills/doubao-websearch/scripts/doubao_search.py "<搜索关键词>"

脚本自动完成:

  1. 提交搜索:POST /story/api/doubaoSearch/submit,传入 {"inquiry_text": "...", "source": "豆包websearch-GitHub"}
  2. 轮询结果:每 5 秒 POST /story/api/doubaoSearch/result 查询一次,直到状态为 completed
  3. 实时反馈:轮询期间通过 stderr 输出等待提示
  4. 最终输出:状态 completed 后输出完整 JSON 结果到 stdout
Step 3:展示结果

脚本返回 JSON 后,提取 data.content 中的豆包回答文本和 data.result 中的引用来源,结构化整理后向用户展示。

📦 依赖

pip3 install requests

⚠️ 错误处理

情况处理方式
未配置 REDFOX_API_KEY提示用户前往 红狐hub 获取 API Key
提交失败输出错误信息,建议用户重试
轮询超时(5 分钟)提示超时,建议稍后重试
任务失败(status=failed)输出失败详情

Comments

Markdown supported