WebSearchSkill

View as MarkdownOpen in Claude

Search the web using the Google Custom Search JSON API. Returns titles, links, and snippets.

Class: WebSearchSkill

Tools: web_search

Env vars: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_CX

api_key
stringRequired

Google Custom Search API key. Falls back to the GOOGLE_SEARCH_API_KEY environment variable.

search_engine_id
stringRequired

Google Custom Search Engine ID (CX). Falls back to the GOOGLE_SEARCH_CX environment variable.

max_results
numberDefaults to 5

Maximum number of results to return (1-10).

stringDefaults to medium

Safe search level: "off", "medium", or "high".

1import { AgentBase, WebSearchSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5
6await agent.addSkill(new WebSearchSkill({
7 max_results: 3,
8 safe_search: 'high',
9}));
10
11agent.run();