feat: add Keenable as a configurable web search provider
Add Keenable Search alongside the existing DuckDuckGo / Bing / Google / Tavily / Ollama / Baidu / SearXNG providers. - internal/infrastructure/web_search/keenable.go: KeenableProvider implementing the WebSearchProvider interface, following the Tavily provider pattern. Keyless by default: with no API key it calls the public endpoint (/v1/search/public, rate-limited); a key switches to /v1/search and lifts the cap. Base URL is hardcoded (SSRF-safe), proxy is honored. - Registered "keenable" in the container registry. - Added the keenable provider type + type metadata (RequiresAPIKey=false) and service validation (no required key, like DuckDuckGo). - Provider-specific empty-results diagnostic (keyless rate-limit hint). - Frontend: extend the provider union type with 'keenable'. - Unit tests: keyless vs keyed endpoint, attribution header, maxResults trim, result mapping, error status, name. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,10 @@ func EmptyTestResultsError(providerType string, provider any) error {
|
||||
)
|
||||
case types.WebSearchProviderTypeDuckDuckGo:
|
||||
return fmt.Errorf("duckduckgo returned 0 results; verify network connectivity and proxy settings")
|
||||
case types.WebSearchProviderTypeKeenable:
|
||||
return fmt.Errorf(
|
||||
"keenable returned 0 results; keyless requests are rate-limited, so verify network connectivity or set an API key to lift the cap",
|
||||
)
|
||||
default:
|
||||
return fmt.Errorf("search returned 0 results, please verify your API key and configuration")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user