Anthropic::WebSearchTool
Inherits JSON::Serializable < Anthropic::ServerTool < JSON::Serializable < Struct < Value < Object
Web search tool - allows Claude to search the internet
Note: This tool requires the beta header "anthropic-beta: web-search-2025-03-05"
message = client.messages.create(
model: Anthropic::Model::CLAUDE_SONNET_4_6,
max_tokens: 1024,
server_tools: [Anthropic::WebSearchTool.new],
messages: [{role: "user", content: "What's the latest news about Crystal programming language?"}]
)
Constructors
new(pull : JSON::PullParser)
Web search tool - allows Claude to search the internet
Note: This tool requires the beta header "anthropic-beta: web-search-2025-03-05"
message = client.messages.create(
model: Anthropic::Model::CLAUDE_SONNET_4_6,
max_tokens: 1024,
server_tools: [Anthropic::WebSearchTool.new],
messages: [{role: "user", content: "What's the latest news about Crystal programming language?"}]
)
new(allowed_callers : Array(String) | Nil = nil, cache_control : CacheControl | Nil = nil, defer_loading : Bool | Nil = nil, strict : Bool | Nil = nil, allowed_domains : Array(String) | Nil = nil, blocked_domains : Array(String) | Nil = nil, max_uses : Int32 | Nil = nil, user_location : UserLocation | Nil = nil)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
SourceClass methods
Instance methods
allowed_callers
Sourcecache_control
Sourcedefer_loading
Sourcename
Sourcestrict
Sourcetype
Source