I want to build a smolagent that can search the results of google search ?
there is the google API search but i don’t want to use it’s limit is very bad to me.
1 Like
Setting up your own search engine for this task is more rewarding, and costs less.
This is what I use for web search:
1 Like
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?
1 Like