mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
fix(tools): improve web search provider fallback (#2629)
- centralize web search provider readiness and resolution logic - fall back when the configured provider is unavailable or invalid - allow native-search-capable models to use built-in search without the client tool - simplify the tools page and add direct access to web search settings - add backend, agent, and integration tests for the new selection behavior
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||
|
||||
"github.com/sipeed/picoclaw/pkg/audio/tts"
|
||||
"github.com/sipeed/picoclaw/pkg/config"
|
||||
"github.com/sipeed/picoclaw/pkg/media"
|
||||
"github.com/sipeed/picoclaw/pkg/skills"
|
||||
integrationtools "github.com/sipeed/picoclaw/pkg/tools/integration"
|
||||
@@ -72,6 +73,18 @@ func GetPreferredWebSearchLanguage() string {
|
||||
return integrationtools.GetPreferredWebSearchLanguage()
|
||||
}
|
||||
|
||||
func WebSearchToolOptionsFromConfig(cfg *config.Config) WebSearchToolOptions {
|
||||
return integrationtools.WebSearchToolOptionsFromConfig(cfg)
|
||||
}
|
||||
|
||||
func WebSearchProviderReady(opts WebSearchToolOptions, name string) bool {
|
||||
return integrationtools.WebSearchProviderReady(opts, name)
|
||||
}
|
||||
|
||||
func ResolveWebSearchProviderName(opts WebSearchToolOptions, query string) (string, error) {
|
||||
return integrationtools.ResolveWebSearchProviderName(opts, query)
|
||||
}
|
||||
|
||||
func NewWebSearchTool(opts WebSearchToolOptions) (*WebSearchTool, error) {
|
||||
return integrationtools.NewWebSearchTool(opts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user