fix(web-search): polish Keenable provider integration after #1946
Expose optional API key in settings UI, map longer API snippets into Content for RAG, align maxResults fallback with other providers, sync Swagger enum, and add follow-up unit tests.
This commit is contained in:
@@ -52,6 +52,20 @@ func TestEmptyTestResultsError_DuckDuckGo(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmptyTestResultsError_Keenable(t *testing.T) {
|
||||
err := EmptyTestResultsError(string(types.WebSearchProviderTypeKeenable), nil)
|
||||
if err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
msg := err.Error()
|
||||
if !strings.Contains(msg, "keenable returned 0 results") {
|
||||
t.Fatalf("unexpected message: %q", msg)
|
||||
}
|
||||
if !strings.Contains(msg, "rate-limited") {
|
||||
t.Fatalf("keenable message should hint at the keyless rate limit: %q", msg)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmptyTestResultsError_APIKeyProviders(t *testing.T) {
|
||||
err := EmptyTestResultsError(string(types.WebSearchProviderTypeBing), nil)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user