Fall back to duckduckgo

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
trungtt6 2026-02-19 22:52:25 +08:00 committed by GitHub
parent 61760336d5
commit aa2a52d50c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)