Web Search
This skill allows users to search web content through the /web-search API. It is suitable for information lookup, recent content discovery, webpage search, image search, and video search.
Usage
Ensure you have installed the required dependency (pip install requests). Use the bundled script to perform the search.
CODEBLOCK0
Options
- -
--query - Search keywords or a natural language question. - INLINECODE3 - Whether to include summaries in the results. Accepts
true or false. Default is true. - INLINECODE7 - Time filter. Options:
noLimit, oneDay, oneWeek, oneMonth, oneYear. - INLINECODE13 - Number of results to return. Default is
10. - INLINECODE15 - API key used in the
Authorization: Bearer header. If omitted, read from GITEEAI_API_KEY.
Workflow
- 1. Execute
perform_web_search.py with the user parameters. - Parse the script output and find the line starting with
SEARCH_RESULTS_JSON:. - Extract the JSON payload from that line.
- Summarize the most relevant results for the user, prioritizing
webPages.value.
Notes
- - The response language should be consistent with the user's question.
- Prefer
webPages.value unless the user explicitly asks for images or videos. - If the user asks for recent information, set
--freshness accordingly. - If the API returns no results, say that directly instead of fabricating answers.
- If
GITEEAI_API_KEY is missing, the user must provide --api-key. - The script prints
SEARCH_RESULTS_JSON: in the output. Always parse that line.
网页搜索
该技能允许用户通过 /web-search API 搜索网页内容。适用于信息查询、最新内容发现、网页搜索、图片搜索和视频搜索。
使用方法
确保已安装所需依赖(pip install requests)。使用捆绑脚本执行搜索。
bash
python {baseDir}/scripts/performwebsearch.py \
--query 阿里巴巴2024年的ESG报告 \
--summary true \
--freshness noLimit \
--count 10 \
--api-key YOURAPIKEY
选项说明
- - --query - 搜索关键词或自然语言问题。
- --summary - 是否在结果中包含摘要。接受 true 或 false。默认为 true。
- --freshness - 时间筛选。选项:noLimit、oneDay、oneWeek、oneMonth、oneYear。
- --count - 返回结果数量。默认为 10。
- --api-key - 用于 Authorization: Bearer 标头的 API 密钥。如果省略,则从 GITEEAIAPIKEY 读取。
工作流程
- 1. 使用用户参数执行 performwebsearch.py。
- 解析脚本输出,找到以 SEARCHRESULTSJSON: 开头的行。
- 从该行提取 JSON 数据。
- 为用户总结最相关的结果,优先使用 webPages.value。
注意事项
- - 回复语言应与用户提问语言保持一致。
- 除非用户明确要求图片或视频,否则优先使用 webPages.value。
- 如果用户询问最新信息,请相应设置 --freshness 参数。
- 如果 API 未返回结果,请直接说明,不要编造答案。
- 如果缺少 GITEEAIAPIKEY,用户必须提供 --api-key。
- 脚本输出中包含 SEARCHRESULTSJSON:,请始终解析该行。