ASR
Implement speech-to-text (ASR/automatic speech recognition) capabilities using the z-ai-web-dev-sdk. Use this skill when the user…
Implement web search capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to search for real-time information from the web, retrieve up-to-date content beyond the knowledge cutoff, or find the latest news and data. Returns structured search results with
Claude Code
$ npx -y skills add jjyaoao/helloagents --skill web-search --agent claude-code
Codex
$ npx skills add jjyaoao/helloagents --skill web-search -a codex -y
Cursor
$ npx skills add jjyaoao/helloagents --skill web-search -a cursor -y
Gemini CLI
$ npx skills add jjyaoao/helloagents --skill web-search -a gemini-cli -y
GitHub Copilot
$ npx skills add jjyaoao/helloagents --skill web-search -a github-copilot -y
OpenCode
$ npx skills add jjyaoao/helloagents --skill web-search -a opencode -y
Windsurf
$ npx skills add jjyaoao/helloagents --skill web-search -a windsurf -y
name: web-search description: Implement web search capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to search for real-time information from the web, retrieve up-to-date content beyond the knowledge cutoff, or find the latest news and data. Returns structured search results with URLs, snippets, and metadata. license: MIT
This skill guides the implementation of web search functionality using the z-ai-web-dev-sdk package, enabling applications to search the web and retrieve current information.
**Recommended Location**: `{project_path}/skills/web-search`
Extract this skill package to the above path in your project.
**Reference Scripts**: Example test scripts are available in the `{project_path}/skills/web-search/scripts/` directory for quick testing and reference. See `{project_path}/skills/web-search/scripts/web_search.ts` for a working example.
The Web Search skill allows you to build applications that can search the internet, retrieve current information, and access real-time data from web sources.
**IMPORTANT**: z-ai-web-dev-sdk MUST be used in backend code only. Never use it in client-side code.
The z-ai-web-dev-sdk package is already installed. Import it as shown in the examples below.
For simple web search queries, you can use the z-ai CLI instead of writing code. This is ideal for quick information retrieval, testing search functionality, or command-line automation.
# Simple search query
z-ai function --name "web_search" --args '{"query": "artificial intelligence"}'
# Using short options
z-ai function -n web_search -a '{"query": "latest tech news"}'# Limit number of results
z-ai function \
-n web_search \
-a '{"query": "machine learning", "num": 5}'
# Search with recency filter (results from last N days)
z-ai function \
-n web_search \
-a '{"query": "cryptocurrency news", "num": 10, "recency_days": 7}'# Save results to JSON file
z-ai function \
-n web_search \
-a '{"query": "climate change research", "num": 5}' \
-o search_results.json
# Recent news with file output
z-ai function \
-n web_search \
-a '{"query": "AI breakthroughs", "num": 3, "recency_days": 1}' \
-o ai_news.json# Search for specific topics
z-ai function \
-n web_search \
-a '{"query": "quantum computing applications", "num": 8}' \
-o quantum.json
# Find recent scientific papers
z-ai function \
-n web_search \
-a '{"query": "genomics research", "num": 5, "recency_days": 30}' \
-o genomics.json
# Technology news from last 24 hours
z-ai function \
-n web_search \
-a '{"query": "tech industry updates", "recency_days": 1}' \
-o today_tech.jsonEach result contains:
**Use CLI for:**
**Use SDK for:**
Each search result is a `SearchFunctionResultItem` with the following structure:
interface SearchFunctionResultItem {
url: string; // Full URL of the result
name: string; // Title of the page
snippet: string; // Preview text/description
host_name: string; // Domain name
rank: number; // Result ranking
date: string; // Publication/update date
favicon: string; // Favicon URL
}import ZAI from 'z-ai-web-dev-sdk';
async function searchWeb(query) {
const zai = await ZAI.create();
const results = await zai.functions.invoke('web_search', {
query: query,
num: 10
});
return results;
}
// Usage
const searchResults = await searchWeb('What is the capital of France?');
console.log('Search Results:', searchResults);import ZAI from 'z-ai-web-dev-sdk';
async function searchWithLimit(query, numberOfResults) {
const zai = await ZAI.create();
const results = await zai.functions.invoke('web_search', {
query: query,
num: numberOfResults
});
return results;
}
// Usage - Get top 5 results
const topResults = await searchWithLimit('artificial intelligence news', 5);
// Usage - Get top 20 results
const moreResults = await searchWithLimit('JavaScript frameworks', 20);import ZAI from 'z-ai-web-dev-sdk';
async function getFormattedResults(query) {
const zai = await ZAI.create();
const results = await zai.functions.invoke('web_search', {
query: query,
num: 10
});
// Format results for display
const formatted = results.map((item, index) => ({
position: index + 1,
title: item.name,
url: item.url,
description: item.snippet,
domain: item.host_name,
publishDate: item.date
}));
return formatted;
}
// Usage
const results = await getFormattedResults('climate change solutions');
results.forEach(result => {
console.log(`${result.position}. ${result.title}`);🤖 组件化多智能体框架 - Agent Loop、工具执行、上下文工程、知识检索与持久记忆 HelloAgents 是一个围绕原生 Function Calling 构建的组件化多智能体框架,从简单的工具调用循环,到具备上下文管理、知识检索、持久记忆与多智能体协作的应用,为智能体开发提供可组合的工程组件。 框架集成工具响应协议、上下文工程、会话持久化、子代理、Skills、流式输出与运行追踪,并提供 MCP 工具接入、RAG 与 GraphRAG、结构化用户画像、语义记忆检索和后台任务。通过
Implement speech-to-text (ASR/automatic speech recognition) capabilities using the z-ai-web-dev-sdk. Use this skill when the user…
Implement large language model (LLM) chat completions using the z-ai-web-dev-sdk. Use this skill when the user needs to build…
Implement text-to-speech (TTS) capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to convert text into…
Implement vision-based AI chat capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze images,…
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and…
Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…
Create a new Architecture Decision Record with sequential numbering and AgentDB registration