fix: enable web_search tool config YAML support and enable DuckDuckGo by default. Fixes #2616

This commit is contained in:
王宇轩0668001533 2026-04-24 09:40:12 +08:00
parent f440047263
commit 430ce4de70
2 changed files with 7 additions and 7 deletions

View file

@ -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"`

View file

@ -325,7 +325,7 @@ func DefaultConfig() *Config {
MaxResults: 5,
},
DuckDuckGo: DuckDuckGoConfig{
Enabled: false,
Enabled: true,
MaxResults: 5,
},
Perplexity: PerplexityConfig{