fix: 移除 DuckDuckGo 回退,web_search 仅用 SearXNG
This commit is contained in:
@@ -38,7 +38,6 @@ import (
|
|||||||
pluginFile "git.yeij.top/AskaEth/Cyrene-Plugins/file"
|
pluginFile "git.yeij.top/AskaEth/Cyrene-Plugins/file"
|
||||||
pluginHTTP "git.yeij.top/AskaEth/Cyrene-Plugins/http"
|
pluginHTTP "git.yeij.top/AskaEth/Cyrene-Plugins/http"
|
||||||
pluginWF "git.yeij.top/AskaEth/Cyrene-Plugins/web_fetch"
|
pluginWF "git.yeij.top/AskaEth/Cyrene-Plugins/web_fetch"
|
||||||
pluginWS "git.yeij.top/AskaEth/Cyrene-Plugins/web_search"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var cfg Config
|
var cfg Config
|
||||||
@@ -195,12 +194,10 @@ func main() {
|
|||||||
registerPlugins(toolRegistry)
|
registerPlugins(toolRegistry)
|
||||||
for _, t := range pluginFile.NewFilePlugin(dataDir).Tools() { toolRegistry.Register(t) }
|
for _, t := range pluginFile.NewFilePlugin(dataDir).Tools() { toolRegistry.Register(t) }
|
||||||
for _, t := range pluginHTTP.NewHTTPPlugin().Tools() { toolRegistry.Register(t) }
|
for _, t := range pluginHTTP.NewHTTPPlugin().Tools() { toolRegistry.Register(t) }
|
||||||
// 优先使用本地 SearXNG,不可用时回退 DuckDuckGo
|
// 仅使用本地 SearXNG(国内 DuckDuckGo 不可用)
|
||||||
searxngURL := getEnv("SEARXNG_URL", "")
|
searxngURL := getEnv("SEARXNG_URL", "")
|
||||||
if searxngURL != "" {
|
if searxngURL != "" {
|
||||||
toolRegistry.Register(wrapTool(tools.NewWebSearchToolWithURL(searxngURL), "web_search", "Search the web via SearXNG", "search"))
|
toolRegistry.Register(wrapTool(tools.NewWebSearchToolWithURL(searxngURL), "web_search", "Search the web via SearXNG", "search"))
|
||||||
} else {
|
|
||||||
for _, t := range pluginWS.NewWebSearchPlugin().Tools() { toolRegistry.Register(t) }
|
|
||||||
}
|
}
|
||||||
for _, t := range pluginWF.NewWebFetchPlugin().Tools() { toolRegistry.Register(t) }
|
for _, t := range pluginWF.NewWebFetchPlugin().Tools() { toolRegistry.Register(t) }
|
||||||
// ai-core 专属工具 — 通过 sdk.Tool 适配器注册
|
// ai-core 专属工具 — 通过 sdk.Tool 适配器注册
|
||||||
|
|||||||
Reference in New Issue
Block a user