-
Notifications
You must be signed in to change notification settings - Fork 44.6k
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
Migrate google search to use DDGS.text function #4383
Migrate google search to use DDGS.text function #4383
Conversation
…uckgo search - backward compatiable
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4383 +/- ##
=======================================
Coverage 64.90% 64.91%
=======================================
Files 75 75
Lines 3542 3543 +1
Branches 520 520
=======================================
+ Hits 2299 2300 +1
Misses 1071 1071
Partials 172 172
☔ View full report in Codecov by Sentry. |
…earch-deprecated-max-results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just encountered this warning and was about to submit an issue :)
* master: Migrate google search to use DDGS.text function (Significant-Gravitas#4383) empty commit to see cassette status (Significant-Gravitas#4382) Fix the version of duckduckgo-search to avoid empty result issue (Significant-Gravitas#4368) Update get_hyperlinks description (Significant-Gravitas#4122) CI: set base repo before `gh pr checkout` (Significant-Gravitas#4363) Cassettes should be added in the same pull request, without extra pull request (Significant-Gravitas#4355) Improve Azure setup wording in docs (Significant-Gravitas#4325) Pass command line args as list (Significant-Gravitas#1486)
Background
The new duckduckgo_search version deprecated the ddg function and max_result parameters. Users are seeing the following warning messages when auto-gpt executes google command.
*\AppData\Local\Programs\Python\Python310\lib\site-packages\duckduckgo_search\compat.py:20: UserWarning: ddg is deprecated. Use DDGS().text() generator warnings.warn("ddg is deprecated. Use DDGS().text() generator")
UserWarning: parameter max_results is deprecated, use DDGS().text() warnings.warn("parameter max_results is deprecated, use DDGS().text()")
This fixes #4376
Changes
Migrate the search func to use the new function and use islice to limit the iterators up to max_results. Itertools.islice handles the iterators in an efficient way. Itertools is a module in python.
Documentation
Test Plan
Updated the google search's integration test
PR Quality Checklist
black .
andisort .
against my code to ensure it passes our linter.