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

Implemented Selenium based web browsing. #1397

Merged
merged 4 commits into from
Apr 14, 2023

Conversation

Void-n-Null
Copy link
Contributor

@Void-n-Null Void-n-Null commented Apr 14, 2023

Replaced the default web browsing function with one that uses selenium to gather information with a visual and an overlay.

Included a small bug fix for the missing google api key that would attempt to use official google with default api keys from the template.

Background

Changes

Documentation

Test Plan

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

Replaced the default web browsing function with one that uses selenium to gather information with a visual and an overlay.

Included a small bug fix for the missing google api key that would attempt to use official google with default api keys from the template.
Noticed issues with flake8 formatting and fixed them.
@Void-n-Null Void-n-Null changed the title Implemented Selenium based web browing. Implemented Selenium based web browsing. Apr 14, 2023
@p-i- p-i- merged commit 55eef98 into Significant-Gravitas:master Apr 14, 2023
@jevonearth
Copy link

jevonearth commented Apr 14, 2023

Since this commit, autogpt fails to start up;

(venv) ➜  Auto-GPT git:(master) python -m autogpt
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/jev/auto-gpt/Auto-GPT/autogpt/__main__.py", line 3, in <module>
    from autogpt import commands as cmd
  File "/home/jev/auto-gpt/Auto-GPT/autogpt/commands.py", line 16, in <module>
    from autogpt.web import browse_website
  File "/home/jev/auto-gpt/Auto-GPT/autogpt/web.py", line 2, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'

I think you need to update requirements.txt to include selenium and webdriver_manager

def create_message(chunk, question):
return {
"role": "user",
"content": f"\"\"\"{chunk}\"\"\" Using the above text, please answer the following question: \"{question}\" -- if the question cannot be answered using the text, please summarize the text."
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need “please” in the prompt?

Choose a reason for hiding this comment

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

we must be kind to the algos

@hdkiller hdkiller mentioned this pull request Apr 14, 2023
5 tasks
@Artemonim Artemonim mentioned this pull request Apr 14, 2023
1 task
bszollosinagy pushed a commit to bszollosinagy/Auto-GPT that referenced this pull request Apr 15, 2023
…ing each others efforts in many aspects.

* added a new config parameter in .env to control which kind of browser the user wants: headless or full Selenium with Chrome
* restored browse_website() to commands.py
* PR Significant-Gravitas#1397 introduced a working Selenium adapter, but inadvertently clobbered PR Significant-Gravitas#968, and replicated most of the stuff in browse.py, but based on an old version, without any merge conflicts. This is now rectified by moving Selenium code into browse.py, and reducing duplication as much as possible.
* there was a small typo, because an object reference was also returned along with the links in the link scraper.
* listed the PROs and CONs of each browser in the source code
sindlinger pushed a commit to Orgsindlinger/Auto-GPT-WebUI that referenced this pull request Sep 25, 2024
* Implemented Selenium based web browing.

Replaced the default web browsing function with one that uses selenium to gather information with a visual and an overlay.

Included a small bug fix for the missing google api key that would attempt to use official google with default api keys from the template.

* Fixed flake8 issues.
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.

5 participants