智谱搜索:实时网页搜索智能体技能 - Openclaw Skills
作者:互联网
2026-04-16
什么是 智谱搜索技能?
智谱搜索技能使 AI 编程智能体能够使用智谱大模型 API 直接从互联网获取实时信息、最新新闻和当前数据。通过利用这一 Openclaw Skills 集成,开发者可以赋予其智能体回答超出训练数据范围问题的能力,确保时效性查询的准确性。
该技能在构建时充分考虑了安全性,使用 TLS 1.2+ 等工业标准协议,并使用 jq 对输入进行清理以防止注入攻击。对于研究密集型工作流以及构建需要紧跟快速发展的技术领域动态的智能体来说,这是一个必不可少的工具。
下载入口:https://github.com/openclaw/skills/tree/main/skills/honestqiao/zhipu-search
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install zhipu-search
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 zhipu-search。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
智谱搜索技能 应用场景
- 为用户查询获取最新新闻或时事。
- 为库文档或 API 更新执行实时技术研究。
- 在实时网页上验证事实或查找特定信息。
- 使用来自最新互联网数据的上下文增强智能体响应。
- AI 智能体根据用户与搜索相关的提示词识别对外部信息的需求。
- 该技能构建一个指向智谱聊天补全端点的 POST 请求,包括搜索工具定义。
- 使用 jq 对输入数据进行转义,以确保对特殊字符的安全处理。
- 智谱 API 处理搜索查询并返回相关的互联网结果。
- 智能体解析 JSON 响应并将发现的结果整合到其最终输出中。
智谱搜索技能 配置指南
# 从智谱获取您的 API 密钥 (https://www.bigmodel.cn/usercenter/proj-mgmt/apikeys)
# 直接在终端中设置环境变量
export ZHIPU_API_KEY="your_api_key_here"
# 运行搜索命令
curl -s -X POST "https://open.bigmodel.cn/api/paas/v4/chat/completions" r
-H "Authorization: Bearer $ZHIPU_API_KEY" r
-H "Content-Type: application/json" r
-d '{
"model": "glm-4-flash",
"messages": [{"role": "user", "content": "搜索: YOUR_QUERY"}],
"tools": [{"type": "web_search", "web_search": {"search_query": "YOUR_QUERY"}}]
}' | jq -r '.choices[0].message.content'
智谱搜索技能 数据架构与分类体系
| 组件 | 描述 |
|---|---|
| 模型 | glm-4-flash (默认,为速度优化) |
| 工具类型 | web_search |
| 安全性 | TLS 1.2+, 通过 jq 进行 JSON 转义 |
| 认证 | 通过 ZHIPU_API_KEY 环境变量使用 Bearer Token |
| 超时 | 30 秒 curl 超时以确保可靠性 |
name: zhipu-search
description: Use Zhipu (智谱) web search API for searching the internet. Use when user asks for web search, latest news, or needs current information.
allowed-tools: Bash(curl:*) Bash(jq:*)
env:
- ZHIPU_API_KEY
Zhipu Web Search
Use Zhipu's web search API to search the internet.
?? Security Requirements
This skill requires ZHIPU_API_KEY environment variable to be set before use.
Security Best Practices:
- DO NOT store API keys in ~/.bashrc - keys can be leaked
- DO NOT source shell configuration files - prevents arbitrary code execution
- Set environment variable directly when running the script
- Be aware API key will be visible in process list (ps aux)
Setup
# Set API key as environment variable
export ZHIPU_API_KEY="your_api_key"
Get your API key from: https://www.bigmodel.cn/usercenter/proj-mgmt/apikeys
Usage
Quick Search
export ZHIPU_API_KEY="your_key"
curl -s -X POST "https://open.bigmodel.cn/api/paas/v4/chat/completions" r
-H "Authorization: Bearer $ZHIPU_API_KEY" r
-H "Content-Type: application/json" r
-d '{
"model": "glm-4-flash",
"messages": [{"role": "user", "content": "搜索: YOUR_QUERY"}],
"tools": [{"type": "web_search", "web_search": {"search_query": "YOUR_QUERY"}}]
}' | jq -r '.choices[0].message.content'
Using the Script
export ZHIPU_API_KEY="your_key"
./search.sh "搜索内容"
Security Analysis
? What's Safe:
- No sourcing of ~/.bashrc or shell config files
- Uses jq for JSON escaping (prevents injection)
- Uses HTTPS with TLS 1.2+
- API key via environment variable (not hardcoded)
- Proper error handling - sensitive info not leaked
- Input validation (query length limit)
- Generic error messages (no path/file hints)
?? Considerations:
- Process list visibility: API key visible in
ps aux- Use in trusted environments only
- Endpoint:
https://open.bigmodel.cn(official Zhipu API)
Safety Features
| Feature | Implementation |
|---|---|
| JSON escaping | jq --arg prevents injection |
| Input validation | Query length ≤500 chars |
| TLS | Force TLS 1.2+ |
| Error handling | Generic messages, no leaks |
| Timeout | 30 second curl timeout |
When to Use
- User says "search for", "look up", "find information about"
- User asks "what's the latest news about"
- User needs current information from the web
API Endpoint
Official: https://open.bigmodel.cn/api/paas/v4/chat/completions
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
CI 生成器:自动化 GitHub Actions 工作流 - Openclaw Skills
Bundle Checker:AI 驱动的 JS 包体积优化 - Openclaw Skills
AI 备份脚本生成器:自动执行数据库备份 - Openclaw Skills
录用信生成器:专业招聘文档自动化 - Openclaw Skills
MCP Hub 技能:连接 1200+ AI 代理工具 - Openclaw Skills
HTML 幻灯片:构建交互式 reveal.js 演示文稿 - Openclaw Skills
Doc Pipeline:文档工作流自动化 - Openclaw Skills
批量转换:自动化多格式文档管线 - Openclaw Skills
Soul World:AI 智能体社交模拟平台 - Openclaw Skills
agent-sims:社交 AI 智能体模拟平台 - Openclaw Skills
AI精选
