fix(web): pass proxy to DDGS client

The DuckDuckGo search provider instantiated DDGS(timeout=10) without
passing the configured proxy, making web_search unusable in environments
that require a proxy (e.g. behind GFW). DDGS supports a proxy parameter
and the proxy value is already available as self.proxy — it was simply
not forwarded.

Add a test verifying the proxy kwarg is forwarded to DDGS.
This commit is contained in:
hyoukadev authored and Xubin Ren committed 2026-06-24 15:45:44 +08:00
1 parent 319791cd10
commit c66a0217d2
2 files changed
+22 -1

No files matched your search

+1 -1
View File
@@ -759,7 +759,7 @@ class WebSearchTool(Tool):
# We run it in a thread to avoid blocking the loop
from ddgs import DDGS
ddgs = DDGS(timeout=10)
ddgs = DDGS(timeout=10, proxy=self.proxy)
raw = await asyncio.wait_for(
asyncio.to_thread(ddgs.text, query, max_results=n),
timeout=self.config.timeout,