WebSearchTool error

Hi I tried to use WebSearchTool from smolagents and got this kind of error, I’m using ollama with model qwen2.5 7b, can anyone help me

Code execution failed at line ‘music_recommendations = web_search(query=“best party music”)’ due to: SSLError:
HTTPSConnectionPool(host=‘lite.duckduckgo.com’, port=443): Max retries exceeded with url: /lite/?q=best+party+music
(Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:
self-signed certificate (_ssl.c:1028)’)))

1 Like

I think this might be an SSL error caused by a proxy, VPN, cloud, or internal network firewall, but it’s in the library code…

It might be difficult to work around.

https://stackoverflow.com/questions/51925384/unable-to-get-local-issuer-certificate-when-using-requests

I’m having a similar error with DuckDuckGo
Code execution failed at line ‘results_retry = web_search(query=simpler_query)’
due to: DuckDuckGoSearchException: DuckDuckGo
RuntimeError: error sending request for url (DuckDuckGo):
operation timed out

Caused by:
operation timed out

1 Like

Hmm… Perhaps DDG problem…?

Or perhaps:

pip install -U duckduckgo-search