-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Add Serper.dev search support to SearchToolkit #3539
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
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fengju0213
left a comment
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.
LGTM thanks @gaivrt !
waleedalzarooni
left a comment
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.
LGTM
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.
thanks @gaivrt 's contribution and @waleedalzarooni @fengju0213 @LIHUA919 's review, left some comments below and one enhance PR: #3617
| def search_serper( | ||
| self, | ||
| query: str, | ||
| page: int = 1, |
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.
better align with other search engine's default value into 10
| except requests.exceptions.RequestException as e: | ||
| raise RuntimeError(f"Error making request to Serper: {e}") |
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.
instead of raise error msg, return error information would be more agent-friendly
| } | ||
|
|
||
| try: | ||
| response = requests.post(url, headers=headers, data=payload) |
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.
timeout setting was not used in request
Description
This PR adds support for Serper.dev as a search engine option within the SearchToolkit.
Key changes include:
<toolkit_prefix>_<action>_<resource>).:obj:for defaults).loggerinstead ofprint(where applicable in library code), and avoided abbreviations in variable names.Checklist
Go over all the following points, and put an
xin all the boxes that apply.Fixes #issue-numberin the PR description (required)uv lock(No new dependencies, usesrequests)