From aa2a52d50ceb5a1b3ffcc1a4bd3b46e5a12a018b Mon Sep 17 00:00:00 2001 From: trungtt6 <74585678+trungtt6@users.noreply.github.com> Date: Thu, 19 Feb 2026 22:52:25 +0800 Subject: [PATCH] Fall back to duckduckgo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pkg/tools/web.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/tools/web.go b/pkg/tools/web.go index 8cb58063c..36ed792ce 100644 --- a/pkg/tools/web.go +++ b/pkg/tools/web.go @@ -311,6 +311,15 @@ type WebSearchToolOptions struct { } func NewWebSearchTool(opts ...WebSearchToolOptions) *WebSearchTool { + // If no options are provided, default to DuckDuckGo with 5 results. + if len(opts) == 0 { + opts = []WebSearchToolOptions{ + { + Provider: "duckduckgo", + MaxResults: 5, + }, + } + } // Priority order: Brave > Ollama > DuckDuckGo priorityOrder := []string{"brave", "ollama", "duckduckgo"} optMap := make(map[string]WebSearchToolOptions)