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.
()
| 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. |
| 256 | func 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 |
no test coverage detected