From da29b8e388d28be466bcd9920c1f9bce9d973a73 Mon Sep 17 00:00:00 2001 From: Kayvan Sylvan Date: Thu, 3 Jul 2025 23:41:22 -0700 Subject: [PATCH] chore: remove unused web-search tool parameters for simplification ### CHANGES - Remove unused `AllowedDomains` and `MaxUses` parameters - Simplify `webTool` definition in `buildMessageParams` method --- plugins/ai/anthropic/anthropic.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/ai/anthropic/anthropic.go b/plugins/ai/anthropic/anthropic.go index 2eb36d0e..1e29a33e 100644 --- a/plugins/ai/anthropic/anthropic.go +++ b/plugins/ai/anthropic/anthropic.go @@ -126,12 +126,9 @@ func (an *Client) buildMessageParams(msgs []anthropic.MessageParam, opts *common if opts.Search { // Build the web-search tool definition: webTool := anthropic.WebSearchTool20250305Param{ - Name: webSearchToolName, // string literal instead of constant - Type: webSearchToolType, // string literal instead of constant + Name: webSearchToolName, + Type: webSearchToolType, CacheControl: anthropic.NewCacheControlEphemeralParam(), - // Optional: restrict domains or max uses - // AllowedDomains: []string{"wikipedia.org", "openai.com"}, - // MaxUses: anthropic.Opt[int64](5), } if opts.SearchLocation != "" {