Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools baidusearch ? #1635

Open
wwwrookie opened this issue Dec 25, 2024 · 1 comment
Open

tools baidusearch ? #1635

wwwrookie opened this issue Dec 25, 2024 · 1 comment

Comments

@wwwrookie
Copy link

This Baidu search tool, after every search, Baidu returns too many pages, causing the program to keep crawling to the next page. In fact, Baidu search results only need to find the results in the previous pages. Too many query pages cause the search The result is very slow. It is recommended to add a query page parameter.
image
image

@ysolanky
Copy link
Contributor

Hello @wwwrookie ! The BaiduSearch phidata toolkit uses a max_results param to limit the number of search results.

results = search(keyword=query, num_results=max_results). This max_results param is then passed on to the num_results param of the search function of baidusearch python package. The value of max_results is determined by the Agent. This enables the tool to by dynamic as the Agent can request as many results as required. You can restrict the number of results by adding explicit instructions to the Agent.

For example, this cookbook example searches only for 5 results: https://github.com/phidatahq/phidata/blob/main/cookbook/tools/baidusearch_tools.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants