refactor: web search provider registry pattern
This commit is contained in:
@@ -279,26 +279,5 @@ func loadPromptTemplates(configDir string) (*PromptTemplatesConfig, error) {
|
||||
|
||||
// WebSearchConfig represents the web search configuration
|
||||
type WebSearchConfig struct {
|
||||
Providers []WebSearchProviderConfig `yaml:"providers" json:"providers"`
|
||||
Default WebSearchDefaultConfig `yaml:"default" json:"default"`
|
||||
Timeout int `yaml:"timeout" json:"timeout"` // 超时时间(秒)
|
||||
}
|
||||
|
||||
// WebSearchProviderConfig represents configuration for a web search provider
|
||||
type WebSearchProviderConfig struct {
|
||||
ID string `yaml:"id" json:"id"`
|
||||
Name string `yaml:"name" json:"name"`
|
||||
Free bool `yaml:"free" json:"free"`
|
||||
RequiresAPIKey bool `yaml:"requires_api_key" json:"requires_api_key"`
|
||||
Description string `yaml:"description,omitempty" json:"description,omitempty"`
|
||||
APIURL string `yaml:"api_url,omitempty" json:"api_url,omitempty"`
|
||||
}
|
||||
|
||||
// WebSearchDefaultConfig represents the default web search configuration
|
||||
type WebSearchDefaultConfig struct {
|
||||
Provider string `yaml:"provider" json:"provider"`
|
||||
MaxResults int `yaml:"max_results" json:"max_results"`
|
||||
IncludeDate bool `yaml:"include_date" json:"include_date"`
|
||||
CompressionMethod string `yaml:"compression_method" json:"compression_method"`
|
||||
Blacklist []string `yaml:"blacklist" json:"blacklist"`
|
||||
Timeout int `yaml:"timeout" json:"timeout"` // 超时时间(秒)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user