Bocha Web Search
This skill performs web searches using the Bocha Web Search API.
It is designed to:
- - Retrieve up-to-date information
- Verify factual claims
- Provide source-backed answers
- Support citation-based responses
This version avoids shell-specific instructions and system-level file operations to ensure compatibility with secure environments such as ClawHub.
When to Use This Skill
Use this skill whenever the user request:
- - Requires information not present in the conversation
- Involves time-sensitive or changing data (news, policies, financial data, releases)
- Requires fact-checking or verification
- Requests links, sources, or citations
- Mentions a specific organization, event, person, or product and asks for factual details
If uncertain whether online lookup is required, perform a search.
API Specification
Endpoint:
POST https://api.bocha.cn/v1/web-search
Headers:
Authorization: Bearer APIKEY>
Content-Type: application/json
Request body (recommended defaults):
{
"query": "",
"freshness": "noLimit",
"summary": true,
"count": 10
}
Field meanings:
- - query: search query string (required)
- freshness: time filter (e.g., noLimit, oneWeek, oneMonth)
- summary: whether to include summarized content
- count: number of returned results (1–50)
Response Structure
Search results are located at:
data.webPages.value[]
Each result typically contains:
- - name (title)
- url
- snippet
- summary (original content)
- siteName
- datePublished
Citation Rules (Mandatory)
When generating the final answer:
- 1. Support factual statements using returned sources.
- Assign citation numbers in order of appearance: [1], [2], [3]
- End with a References section.
- Each reference must include:
- Title
- URL
- Site name (if available)
Example output format:
Answer:
References
[1] <title>
<url>
Source: INLINECODE2
[2] <title>
<url>
Source: INLINECODE5
If no reliable sources are found, respond with:
"No reliable sources found."
Error Handling
Common API error codes:
- - 400: Bad request
- 401: Invalid API key
- 403: Insufficient balance
- 429: Rate limit exceeded
- 500: Server error
Use log_id from API responses for debugging if needed.
Bocha 网页搜索
该技能使用 Bocha 网页搜索 API 执行网络搜索。
其设计目标为:
- - 获取最新信息
- 验证事实性主张
- 提供有来源支撑的答案
- 支持基于引用的回复
本版本避免使用特定于 shell 的指令和系统级文件操作,以确保与 ClawHub 等安全环境的兼容性。
何时使用该技能
当用户请求出现以下情况时,请使用该技能:
- - 需要对话中未包含的信息
- 涉及时效性或变化的数据(新闻、政策、财务数据、发布信息)
- 需要进行事实核查或验证
- 请求提供链接、来源或引用
- 提及特定组织、事件、人物或产品,并要求提供事实细节
如果不确定是否需要在线查询,请执行搜索。
API 规范
端点:
POST https://api.bocha.cn/v1/web-search
请求头:
Authorization: Bearer APIKEY>
Content-Type: application/json
请求体(推荐默认值):
{
query: <用户查询>,
freshness: noLimit,
summary: true,
count: 10
}
字段含义:
- - query:搜索查询字符串(必填)
- freshness:时间筛选(例如 noLimit、oneWeek、oneMonth)
- summary:是否包含摘要内容
- count:返回结果数量(1–50)
响应结构
搜索结果位于:
data.webPages.value[]
每个结果通常包含:
- - name(标题)
- url
- snippet(片段)
- summary(原始内容)
- siteName(站点名称)
- datePublished(发布日期)
引用规则(强制要求)
在生成最终答案时:
- 1. 使用返回的来源支持事实性陈述。
- 按出现顺序分配引用编号:[1]、[2]、[3]
- 以参考文献部分结尾。
- 每条参考文献必须包含:
- 标题
- URL
- 站点名称(如有)
输出格式示例:
答案:
<您的答案,包含内联引用如 [1]、[2]。>
参考文献
[1] <标题>
来源:<站点名称>
[2] <标题>
来源:<站点名称>
如果未找到可靠来源,请回复:
未找到可靠来源。
错误处理
常见 API 错误码:
- - 400:错误请求
- 401:API 密钥无效
- 403:余额不足
- 429:超出速率限制
- 500:服务器错误
如有需要,可使用 API 响应中的 log_id 进行调试。