fix: remove $ prefix from f-strings in BrightDataSearchTool.get_search_url#5273
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
fix: remove $ prefix from f-strings in BrightDataSearchTool.get_search_url#5273devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
…h_url
The get_search_url method used JavaScript template literal syntax (${query})
instead of Python f-string syntax ({query}), causing a literal '$' character
to be prepended to all search queries for Google, Bing, and Yandex.
Fixes #5269
Co-Authored-By: João <joao@crewai.com>
Contributor
Author
|
Prompt hidden (unlisted session) |
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5269
The
get_search_urlmethod inBrightDataSearchToolused JavaScript template literal syntax (${query}) instead of Python f-string syntax ({query}) when building search URLs. This caused every search query to be prepended with a literal$character (e.g.?q=$AI%20newsinstead of?q=AI%20news). All three search engines (Google, Bing, Yandex) were affected.The fix removes the erroneous
$from all three f-strings.Added 4 tests to cover the fix:
get_search_urlon each engine verifying correct URL format_runverifying the URL sent to the API has no$prefixReview & Testing Checklist for Human
brightdata_serp.pylines 133-137 look correct (removed$only, nothing else changed)BrightDataSearchToolwith a real API key to confirm queries work end-to-end without the$prefixLink to Devin session: https://app.devin.ai/sessions/0f820d69f9f74596a25ecab76c3fed67
Note
Low Risk
Low risk: fixes a small URL formatting bug and adds focused tests; behavioral change is limited to removing an unintended
$character in outgoing search queries.Overview
Fixes
BrightDataSearchTool.get_search_urlto use proper Python f-string interpolation ({query}) for Google/Bing/Yandex, removing the accidental literal$prefix that was being sent in search queries.Adds unit tests for each engine’s URL formatting and an
_runflow test to assert the request payload URL is encoded correctly and contains no$in the query.Reviewed by Cursor Bugbot for commit 1386a43. Bugbot is set up for automated code reviews on this repo. Configure here.