Fall back to duckduckgo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
61760336d5
commit
aa2a52d50c
1 changed files with 9 additions and 0 deletions
|
|
@ -311,6 +311,15 @@ type WebSearchToolOptions struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWebSearchTool(opts ...WebSearchToolOptions) *WebSearchTool {
|
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
|
// Priority order: Brave > Ollama > DuckDuckGo
|
||||||
priorityOrder := []string{"brave", "ollama", "duckduckgo"}
|
priorityOrder := []string{"brave", "ollama", "duckduckgo"}
|
||||||
optMap := make(map[string]WebSearchToolOptions)
|
optMap := make(map[string]WebSearchToolOptions)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue