From 430ce4de70962969f12fc2ea82d7addf7335fe81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E8=BD=A90668001533?= Date: Fri, 24 Apr 2026 09:40:12 +0800 Subject: [PATCH] fix: enable web_search tool config YAML support and enable DuckDuckGo by default. Fixes #2616 --- pkg/config/config.go | 12 ++++++------ pkg/config/defaults.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 161108638..f1a73ba5b 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -662,13 +662,13 @@ func (c *TavilyConfig) SetAPIKeys(keys []string) { } type DuckDuckGoConfig struct { - Enabled bool `json:"enabled" env:"PICOCLAW_TOOLS_WEB_DUCKDUCKGO_ENABLED"` - MaxResults int `json:"max_results" env:"PICOCLAW_TOOLS_WEB_DUCKDUCKGO_MAX_RESULTS"` + Enabled bool `json:"enabled" yaml:"enabled" env:"PICOCLAW_TOOLS_WEB_DUCKDUCKGO_ENABLED"` + MaxResults int `json:"max_results" yaml:"max_results" env:"PICOCLAW_TOOLS_WEB_DUCKDUCKGO_MAX_RESULTS"` } type SogouConfig struct { - Enabled bool `json:"enabled" env:"PICOCLAW_TOOLS_WEB_SOGOU_ENABLED"` - MaxResults int `json:"max_results" env:"PICOCLAW_TOOLS_WEB_SOGOU_MAX_RESULTS"` + Enabled bool `json:"enabled" yaml:"enabled" env:"PICOCLAW_TOOLS_WEB_SOGOU_ENABLED"` + MaxResults int `json:"max_results" yaml:"max_results" env:"PICOCLAW_TOOLS_WEB_SOGOU_MAX_RESULTS"` } type PerplexityConfig struct { @@ -717,8 +717,8 @@ type WebToolsConfig struct { ToolConfig ` yaml:"-" envPrefix:"PICOCLAW_TOOLS_WEB_"` Brave BraveConfig `yaml:"brave,omitempty" json:"brave"` Tavily TavilyConfig `yaml:"tavily,omitempty" json:"tavily"` - Sogou SogouConfig `yaml:"-" json:"sogou"` - DuckDuckGo DuckDuckGoConfig `yaml:"-" json:"duckduckgo"` + Sogou SogouConfig `yaml:"sogou,omitempty" json:"sogou"` + DuckDuckGo DuckDuckGoConfig `yaml:"duckduckgo,omitempty" json:"duckduckgo"` Perplexity PerplexityConfig `yaml:"perplexity,omitempty" json:"perplexity"` SearXNG SearXNGConfig `yaml:"-" json:"searxng"` GLMSearch GLMSearchConfig `yaml:"glm_search,omitempty" json:"glm_search"` diff --git a/pkg/config/defaults.go b/pkg/config/defaults.go index 35ef7cdd8..a70f93ca2 100644 --- a/pkg/config/defaults.go +++ b/pkg/config/defaults.go @@ -325,7 +325,7 @@ func DefaultConfig() *Config { MaxResults: 5, }, DuckDuckGo: DuckDuckGoConfig{ - Enabled: false, + Enabled: true, MaxResults: 5, }, Perplexity: PerplexityConfig{