MCPcopy Create free account
hub / github.com/diillson/chatcli / SelectSearchChain

Function SelectSearchChain

cli/plugins/builtin_websearch.go:256–261  ·  view source on GitHub ↗

SelectSearchChain returns the ordered list of providers to try. An unset override → auto mode (DDG first → SearxNG if configured). An explicit override moves the named provider to the front and keeps the rest as fallbacks — so even a forced choice degrades gracefully.

()

Source from the content-addressed store, hash-verified

254// An explicit override moves the named provider to the front and keeps the
255// rest as fallbacks — so even a forced choice degrades gracefully.
256func SelectSearchChain() []providerEntry {
257 return selectSearchChainFromEnv(
258 strings.ToLower(strings.TrimSpace(os.Getenv("CHATCLI_WEBSEARCH_PROVIDER"))),
259 strings.TrimSpace(os.Getenv("SEARXNG_URL")),
260 )
261}
262
263// SelectSearchChainNames returns just the provider names in chain order.
264// Exposed for display layers (e.g. /websearch status) that shouldn't touch

Callers 2

runSearchChainFunction · 0.85
SelectSearchChainNamesFunction · 0.85

Calls 1

selectSearchChainFromEnvFunction · 0.85

Tested by

no test coverage detected