Files
liqiang b119135836
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
2026-08-20 13:12:50 +00:00

35 lines
1.1 KiB
Python

"""
WebSearch tool - Search the web
"""
from typing import Dict, Any
from .base import BaseTool
class WebSearchTool(BaseTool):
"""Allows Claude to search the web and use the results"""
@property
def name(self) -> str:
return "WebSearch"
def _execute_impl(self, params: Dict[str, Any]) -> Dict[str, Any]:
"""
Search the web
- Allows Claude to search the web and use the results to inform responses
- Provides up-to-date information for current events and recent data
- NOTE: This is a stub implementation. Full implementation would require
API integration with search services like Google, Bing, or DuckDuckGo
"""
query = params["query"]
allowed_domains = params.get("allowed_domains", [])
blocked_domains = params.get("blocked_domains", [])
return {
"query": query,
"error": "WebSearch tool requires API integration with a search service",
"note": "This tool would search the web with the given query and filters"
}