chore(web): drop redundant comments from Keenable provider

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilya Gusev
2026-06-18 00:08:52 +08:00
committed by Xubin Ren
co-authored by Claude Opus 4.8
parent a630a78941
commit 6fcf65a8e3
2 changed files with 2 additions and 4 deletions
-1
View File
@@ -489,7 +489,6 @@ class WebSearchTool(Tool):
return f"Error: {e}"
async def _search_keenable(self, query: str, n: int) -> str:
# Keenable has a no-login free tier, so an API key is optional.
api_key = self.config.api_key or os.environ.get("KEENABLE_API_KEY", "")
headers = {"Content-Type": "application/json", "User-Agent": self.user_agent}
if api_key:
+2 -3
View File
@@ -132,7 +132,6 @@ async def test_tavily_search(monkeypatch):
def test_keenable_without_api_key_stays_on_provider(monkeypatch):
# Free tier needs no key, so Keenable must not fall back to DuckDuckGo.
monkeypatch.delenv("KEENABLE_API_KEY", raising=False)
tool = _tool(provider="keenable", api_key="")
assert tool.exclusive is False
@@ -159,7 +158,7 @@ async def test_keenable_search(monkeypatch):
result = await tool.execute(query="keenable", count=1)
assert "Keen" in result
assert "https://keenable.ai" in result
assert "longer excerpt" in result # snippet preferred over description
assert "longer excerpt" in result
@pytest.mark.asyncio
@@ -176,7 +175,7 @@ async def test_keenable_search_without_key_omits_header(monkeypatch):
monkeypatch.setattr(httpx.AsyncClient, "post", mock_post)
tool = _tool(provider="keenable", api_key="")
result = await tool.execute(query="keenable", count=1)
assert "Anon" in result # description used when snippet absent
assert "Anon" in result
@pytest.mark.asyncio