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

fix: switch to duckduckgo as default search engine with lynx browser #237

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

ErikBjare
Copy link
Owner

@ErikBjare ErikBjare commented Nov 1, 2024

I seem to have lost the source for how one is supposed to set the CONSENT cookie :(

Switching the default search engine to duckduckgo instead (which had a lite version I was previously unaware of).


Important

Fix setting CONSENT cookie for Google search in Lynx and update Docker build to default to Lynx instead of Playwright.

  • Behavior:
    • search() in _browser_lynx.py now attempts to set CONSENT cookie for Google search.
    • Default search engine in search() changed to DuckDuckGo.
  • Docker:
    • Makefile and Dockerfile.eval updated to use PLAYWRIGHT=no by default, installing Lynx instead.
  • Misc:
    • Commented out Google search test in test_search() in _browser_lynx.py.

This description was created by Ellipsis for ffd6785. It will automatically update as commits are pushed.

@codecov-commenter
Copy link

codecov-commenter commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.

Project coverage is 72.47%. Comparing base (8564756) to head (ffd6785).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
gptme/tools/_browser_lynx.py 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #237      +/-   ##
==========================================
- Coverage   72.50%   72.47%   -0.03%     
==========================================
  Files          60       60              
  Lines        3880     3887       +7     
==========================================
+ Hits         2813     2817       +4     
- Misses       1067     1070       +3     
Flag Coverage Δ
anthropic/claude-3-haiku-20240307 71.39% <0.00%> (-0.13%) ⬇️
openai/gpt-4o-mini 71.39% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ErikBjare ErikBjare marked this pull request as ready for review November 5, 2024 13:03
@ErikBjare ErikBjare changed the title fix: wip fix setting CONSENT cookie in lynx for google search to work fix: switch to duckduckgo as default search engine with lynx browser Nov 5, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to ffd6785 in 55 seconds

More details
  • Looked at 113 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. Makefile:30
  • Draft comment:
    The change from BROWSER to PLAYWRIGHT in the Dockerfile is not reflected in the Makefile. Ensure consistency by updating the Makefile to use PLAYWRIGHT instead of BROWSER.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. gptme/tools/_browser_lynx.py:29
  • Draft comment:
    The default search engine has been changed from google to duckduckgo. Ensure this change is intentional and update any relevant documentation or comments to reflect this.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The search function defaults to using duckduckgo, which is a change from the previous default of google. This change should be intentional and documented if it affects functionality.
3. gptme/tools/_browser_lynx.py:50
  • Draft comment:
    The test_search function has a commented-out line for testing Google search. Consider re-enabling or removing it to ensure comprehensive testing coverage.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The test_search function has a commented-out line for testing Google search. This should be addressed to ensure comprehensive testing.

Workflow ID: wflow_uYhkQboTwLUSJvT7


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

# env["LYNX_CFG"] = str(Path("~/.config/lynx/lynx.cfg").expanduser())
if cookies:
# save them to file to be read by lynx
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The read_url function has a placeholder for handling cookies, but it is not implemented. Consider implementing the logic to save cookies to a file for Lynx to read, as this is necessary for the intended functionality.

@ErikBjare ErikBjare merged commit ce7afb8 into master Nov 5, 2024
7 checks passed
@ErikBjare ErikBjare deleted the dev/lynx-cookies branch November 5, 2024 13:06
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

Successfully merging this pull request may close these issues.

2 participants