chore: remove unused web-search tool parameters for simplification

### CHANGES

- Remove unused `AllowedDomains` and `MaxUses` parameters
- Simplify `webTool` definition in `buildMessageParams` method
This commit is contained in:
Kayvan Sylvan
2025-07-03 23:41:22 -07:00
parent 5e6d4110fa
commit da29b8e388

View File

@@ -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 != "" {