mirror of
https://github.com/HugeFrog24/go-telegram-bot.git
synced 2026-08-28 22:11:38 +00:00
README
This commit is contained in:
@@ -16,11 +16,12 @@ type MCPServer struct {
|
||||
}
|
||||
|
||||
type WebSearchConfig struct {
|
||||
AllowedDomains []string `json:"allowed_domains,omitempty"`
|
||||
BlockedDomains []string `json:"blocked_domains,omitempty"`
|
||||
MaxUses int `json:"max_uses,omitempty"`
|
||||
Fetch bool `json:"fetch,omitempty"`
|
||||
MaxContentTokens int `json:"max_content_tokens,omitempty"`
|
||||
AllowedDomains []string `json:"allowed_domains,omitempty"`
|
||||
BlockedDomains []string `json:"blocked_domains,omitempty"`
|
||||
FetchAllowedDomains []string `json:"fetch_allowed_domains,omitempty"`
|
||||
MaxUses int `json:"max_uses,omitempty"`
|
||||
Fetch bool `json:"fetch,omitempty"`
|
||||
MaxContentTokens int `json:"max_content_tokens,omitempty"`
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -126,6 +127,19 @@ func loadAllConfigs(dir string) ([]BotConfig, error) {
|
||||
config.ID)
|
||||
}
|
||||
|
||||
if ws := config.WebSearch; ws != nil && len(ws.FetchAllowedDomains) > 0 {
|
||||
if !ws.Fetch {
|
||||
InfoLogger.Printf("[%s] web_search.fetch_allowed_domains is set but fetch is disabled: it has no effect",
|
||||
config.ID)
|
||||
}
|
||||
for _, d := range ws.FetchAllowedDomains {
|
||||
if strings.Contains(d, "/") {
|
||||
InfoLogger.Printf("[%s] web_search.fetch_allowed_domains entry %q includes a path: web_fetch matches host-only, so the whole host is fetchable",
|
||||
config.ID, d)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
config.ConfigFilePath = validPath
|
||||
configs = append(configs, config)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user