Is there any agent that can search google

Yes, you can use the GoogleSearchTool, which is one of the default tools of smolagents.

import os
from smolagents import GoogleSearchTool, HfApiModel
os.environ["SERPAPI_API_KEY"] = userdata.get('SERPAPI_API_KEY')

model = HfApiModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct", provider="together")

agent = CodeAgent(
    model=model,
    tools=[GoogleSearchTool()]
)

The link to get your Serp API key.

And if you want to go beyond, you can use the DuckDuckGoSearchTool. It also has limits but maybe a combination of both can help?

3 Likes