Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
Akjava 
posted an update about 6 hours ago
Post
234
Akjava/Smolagents-ExtraSearchTools
A tool for executing searches using multiple search tools in a prioritized order,
particularly useful for developers who have experienced rate-limiting issues with
DuckDuckGoSearchTool during smolagents development.

GoogleCustomSearchTool: This tool utilizes the Google Custom Search JSON API to perform web searches. It can be configured to search entire websites, but this requires setting up a Custom Search Engine in the Google Cloud Console. The free tier of the Google Custom Search API is limited to 100 queries per day.

BraveSearchTool: This tool uses the Brave Search API to perform web searches. While there is a free tier allowing 2000 queries per month, it requires adding payment information.

PrioritySearchTool: This tool manages multiple search tool instances, executing them in a prioritized order. It returns the result from the first search tool that completes successfully, providing a fallback mechanism if higher-priority tools fail.

save_json_path (optional): This optional parameter specifies the path to a JSON file. If provided, the PrioritySearchTool will cache search queries and their corresponding results to this file. This can improve performance and reduce API usage for repeated queries.

Example:
priority_search = PrioritySearchTool(
[DuckDuckGoSearchTool(), GoogleCustomSearchTool("xxxxxx"),BraveSearchTool()],
save_json_path="history.json",
)
In this post