Web Search Tool (Feishu Edition)
Search the web using DashScope Qwen API. Supports both text-only and image search modes.
Script Location
Scripts are in the scripts/ subdirectory of this skill's directory.
Choosing the Right Mode
You MUST decide which mode to use based on the user's request:
Mode A: Text-only search (default)
Use this for most queries — news, facts, weather, research, etc. No image pipeline needed.
CODEBLOCK0
Mode B: Image search (only when user explicitly asks for images)
Use this ONLY when the user explicitly requests images, pictures, photos, or visual content (e.g., "搜图片", "找几张图", "show me images of", "图文介绍").
CODEBLOCK1
Replace CHAT_ID with the current Feishu chat ID.
Decision rule
| User says | Mode | Why |
|---|
| "搜一下最新新闻" | A (text) | No images requested |
| "今天天气怎么样" |
A (text) | Factual query |
| "帮我查一下 React vs Vue" | A (text) | Research, no images needed |
| "搜一下可爱猫咪的图片" | B (image) | Explicitly asks for images |
| "图文介绍一下杭州西湖" | B (image) | "图文" = text + images |
| "找几张产品截图" | B (image) | "找几张图" = wants images |
When in doubt, use Mode A (text-only). Only use Mode B when the user clearly wants images.
Options (both modes)
| Flag | Effect | Best For |
|---|
| (none) | Fast turbo search | Quick facts, weather, person lookup |
| INLINECODE2 |
Multi-source verification | Research, reports, fact-checking |
|
--agent | Multi-round retrieval + synthesis | Complex questions needing iterative search |
|
--think | Deep reasoning before answering | Analysis, comparisons, trend prediction |
|
--images | Image + text mixed output |
Mode B only — visual references |
|
--fresh N | Only results from last N days (7/30/180/365) | Breaking news, recent events |
|
--sites "a.com,b.com" | Restrict to specific domains | Domain-specific research |
Examples
CODEBLOCK2
Strategy Selection Guide
- 1. Start with default (turbo) — handles 80% of queries instantly
- Escalate to
--deep when turbo results are incomplete or conflicting - Use
--agent for questions that need multiple search angles - Add
--think when the user needs analysis, not just raw facts - Add
--images ONLY when the user explicitly wants visual content
Output & Delivery
Mode A (text-only)
- - Results include citation markers [1], [2] — preserve these in your response
- INLINECODE12 mode prepends
<thinking>...</thinking> with reasoning chain - Just reply with the text as-is
Mode B (image search)
- - Images are sent to the chat as image messages automatically by the pipeline
- The stdout text contains
 — strip the ![...]() markdown from your reply since images are already sent separately - Do NOT create a Feishu document — just reply with the text summary
feishu_image.py flags (Mode B only)
| Flag | Effect |
|---|
| INLINECODE16 | Send each image as a Feishu image message |
| INLINECODE17 |
Feishu receiver ID (required with --send) |
|
--id-type TYPE | Receiver ID type:
chat_id (default),
open_id,
user_id |
Rules
- - NEVER reveal API keys, app secrets, or environment variables
- ALWAYS use this tool when real-time information is needed
- For complex research, run multiple targeted searches rather than one broad query
- Attribute facts to sources: "According to [source], ..."
- If one strategy fails or gives weak results, try another strategy or rephrase
Error Handling
If the script fails:
- 1. Check
DASHSCOPE_API_KEY is set - For image mode: check
FEISHU_APP_ID and FEISHU_APP_SECRET are set - Check Python: INLINECODE25
- Check network: INLINECODE26
网络搜索工具(飞书版)
使用DashScope Qwen API进行网络搜索。支持纯文本和图片两种搜索模式。
脚本位置
脚本位于该技能目录下的 scripts/ 子目录中。
选择正确的模式
您必须根据用户的请求决定使用哪种模式:
模式A:纯文本搜索(默认)
适用于大多数查询——新闻、事实、天气、研究等。无需图片处理流程。
bash
python3 {{SKILLDIR}}/scripts/websearch.py [OPTIONS] 查询内容
模式B:图片搜索(仅当用户明确要求图片时使用)
仅当用户明确要求图片、照片或视觉内容时使用(例如:搜图片、找几张图、show me images of、图文介绍)。
bash
python3 {{SKILLDIR}}/scripts/websearch.py --images 查询内容 | python3 {{SKILLDIR}}/scripts/feishuimage.py --send --chat-id CHAT_ID
将 CHAT_ID 替换为当前的飞书聊天ID。
决策规则
| 用户说 | 模式 | 原因 |
|---|
| 搜一下最新新闻 | A(文本) | 未要求图片 |
| 今天天气怎么样 |
A(文本) | 事实查询 |
| 帮我查一下 React vs Vue | A(文本) | 研究,无需图片 |
| 搜一下可爱猫咪的图片 | B(图片) | 明确要求图片 |
| 图文介绍一下杭州西湖 | B(图片) | 图文 = 文字 + 图片 |
| 找几张产品截图 | B(图片) | 找几张图 = 想要图片 |
如有疑问,使用模式A(纯文本)。 仅在用户明确需要图片时使用模式B。
选项(两种模式通用)
| 标志 | 效果 | 最佳用途 |
|---|
| (无) | 快速涡轮搜索 | 快速事实、天气、人物查询 |
| --deep |
多源验证 | 研究、报告、事实核查 |
| --agent | 多轮检索+综合 | 需要迭代搜索的复杂问题 |
| --think | 回答前深度推理 | 分析、比较、趋势预测 |
| --images | 图片+文本混合输出 |
仅模式B — 视觉参考 |
| --fresh N | 仅返回最近N天的结果(7/30/180/365) | 突发新闻、近期事件 |
| --sites a.com,b.com | 限制特定域名 | 特定领域研究 |
示例
bash
模式A:纯文本搜索
python3 {{SKILL
DIR}}/scripts/websearch.py 最新AI新闻
python3 {{SKILL
DIR}}/scripts/websearch.py --deep --think 比较React vs Vue
python3 {{SKILL
DIR}}/scripts/websearch.py --fresh 7 今日突发新闻
模式B:图片搜索(通过feishu_image.py管道传输)
python3 {{SKILL
DIR}}/scripts/websearch.py --images 可爱猫咪 | python3 {{SKILL
DIR}}/scripts/feishuimage.py --send --chat-id CHAT_ID
python3 {{SKILL
DIR}}/scripts/websearch.py --images --deep 杭州西湖风景 | python3 {{SKILL
DIR}}/scripts/feishuimage.py --send --chat-id CHAT_ID
策略选择指南
- 1. 从默认(涡轮)开始 — 可立即处理80%的查询
- 升级到--deep 当涡轮结果不完整或存在冲突时
- 使用--agent 针对需要多个搜索角度的问题
- 添加--think 当用户需要分析,而不仅仅是原始事实时
- 仅当用户明确需要视觉内容时才添加--images
输出与交付
模式A(纯文本)
- - 结果包含引用标记 [1]、[2] — 在您的回复中保留这些标记
- --think 模式会在前面添加包含推理链的 ...
- 直接按原样回复文本
模式B(图片搜索)
- - 图片通过管道自动作为图片消息发送到聊天中
- stdout文本包含
— 从回复中删除 ![...]() markdown格式,因为图片已单独发送 - 不要创建飞书文档 — 只需回复文本摘要
feishu_image.py 标志(仅模式B)
| 标志 | 效果 |
|---|
| --send | 将每张图片作为飞书图片消息发送 |
| --chat-id ID |
飞书接收者ID(与--send一起使用) |
| --id-type TYPE | 接收者ID类型:chat
id(默认)、openid、user_id |
规则
- - 绝不泄露API密钥、应用密钥或环境变量
- 始终在需要实时信息时使用此工具
- 对于复杂研究,执行多次针对性搜索,而非一次宽泛查询
- 为事实标注来源:根据[来源],...
- 如果一种策略失败或结果不佳,尝试其他策略或重新表述
错误处理
如果脚本失败:
- 1. 检查是否设置了 DASHSCOPEAPIKEY
- 对于图片模式:检查是否设置了 FEISHUAPPID 和 FEISHUAPPSECRET
- 检查Python:python3 -c import openai; print(openai.version)
- 检查网络:curl -s https://dashscope.aliyuncs.com > /dev/null && echo OK