Google Serper Search
This skill enables you to search the web and find images using the Serper API.
When to Use This Skill
Use this skill when the user:
- - Asks to search for information online
- Needs current/recent information not in your knowledge base
- Requests to find images or pictures
- Wants to verify facts or get latest updates
- Asks questions that require web search
How to Use
Advanced Search
You can now use advanced parameters to filter results.
CODEBLOCK0
Parameters:
- - Type (
--type): search, images, videos, places, maps, reviews, news, shopping, lens, scholar, patents, autocomplete. - Country (
--gl): 2-letter country code (e.g., us, cn, jp, gb). - Language (
--hl): Google language code (e.g., en, zh-cn, zh-tw, ja). - Date range (
--tbs): past hour, past 24 hours, past week, past month, past year.
The script returns JSON with:
- -
knowledgeGraph: Key facts about the topic - INLINECODE18 : Search results with title, link, and snippet
- INLINECODE19 : Related questions
- INLINECODE20 : Related search terms
Image Search
When the user needs images, run:
CODEBLOCK1
Returns JSON with image URLs, thumbnails, dimensions, and sources.
Response Format
After getting search results:
- 1. Parse the JSON response
- Present results in a clear, organized format
- Include relevant links and sources
- For images, describe what was found and provide image URLs
Example Usage
User: "Search for the latest news about AI"
You: Use Bash tool to run the search script, then format and present the results.
User: "Find pictures of mountains"
You: Use Bash tool to run image search, then present the image URLs and descriptions.
Google Serper 搜索
此技能使您能够使用 Serper API 搜索网络和查找图片。
何时使用此技能
当用户出现以下情况时使用此技能:
- - 要求在线搜索信息
- 需要知识库中未包含的最新/近期信息
- 请求查找图片或照片
- 想要核实事实或获取最新更新
- 提出需要网络搜索的问题
使用方法
高级搜索
您现在可以使用高级参数来筛选结果。
bash
python3 scripts/serper_search.py 查询内容 --type news --gl us --hl en --tbs past week
参数说明:
- - 类型(--type):搜索、图片、视频、地点、地图、评论、新闻、购物、镜头、学术、专利、自动补全。
- 国家/地区(--gl):2字母国家代码(例如 us、cn、jp、gb)。
- 语言(--hl):Google 语言代码(例如 en、zh-cn、zh-tw、ja)。
- 时间范围(--tbs):过去一小时、过去24小时、过去一周、过去一个月、过去一年。
脚本返回 JSON 格式数据,包含:
- - knowledgeGraph:关于主题的关键事实
- organic:包含标题、链接和摘要的搜索结果
- peopleAlsoAsk:相关问题
- relatedSearches:相关搜索词
图片搜索
当用户需要图片时,运行:
bash
python3 scripts/serper_search.py 搜索查询 --type images
返回包含图片 URL、缩略图、尺寸和来源的 JSON 数据。
响应格式
获取搜索结果后:
- 1. 解析 JSON 响应
- 以清晰有序的格式呈现结果
- 包含相关链接和来源
- 对于图片,描述找到的内容并提供图片 URL
使用示例
用户:搜索关于 AI 的最新新闻
您:使用 Bash 工具运行搜索脚本,然后格式化并呈现结果。
用户:找一些山的图片
您:使用 Bash 工具运行图片搜索,然后呈现图片 URL 和描述。