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

TypeError: BrowserContext.get_state() got an unexpected keyword argument 'use_vision' #297

Open
Anik2901 opened this issue Feb 15, 2025 · 10 comments

Comments

@Anik2901
Copy link

To create a public link, set share=True in launch().
INFO [main] 🛑 Stop requested - the agent will halt at the next safe point
INFO [agent] 🚀 Starting task: go to google.com and type 'OpenAI' click search and give me the first url
WARNING [src.agent.custom_agent] No history to create GIF from
Traceback (most recent call last):
File "C:\Users\Anike\web-ui\webui.py", line 401, in run_custom_agent
history = await agent.run(max_steps=max_steps)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anike\web-ui\src\agent\custom_agent.py", line 330, in run
state = await self.browser_context.get_state(use_vision=self.use_vision)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anike\AppData\Local\Programs\Python\Python313\Lib\site-packages\browser_use\utils.py", line 19, in wrapper
result = func(*args, **kwargs)
TypeError: BrowserContext.get_state() got an unexpected keyword argument 'use_vision'
INFO [agent] 🚀 Starting task: go to google.com and type 'OpenAI' click search and give me the first url
WARNING [src.agent.custom_agent] No history to create GIF from
Traceback (most recent call last):
File "C:\Users\Anike\web-ui\webui.py", line 401, in run_custom_agent
history = await agent.run(max_steps=max_steps)

@warmshao
Copy link
Collaborator

use browser-use==0.1.29 . i havenot updated latest BU yet

@Anik2901
Copy link
Author

Still same error
result = func(*args, **kwargs)
TypeError: BrowserContext.get_state() got an unexpected keyword argument 'use_vision'

@marginal23326
Copy link
Contributor

marginal23326 commented Feb 15, 2025

Still same error result = func(*args, **kwargs) TypeError: BrowserContext.get_state() got an unexpected keyword argument 'use_vision'

Run this command and make sure it's the correct version of browser-use:

uv pip show browser-use

@Anik2901
Copy link
Author

Name: browser-use
Version: 0.1.29

@marginal23326
Copy link
Contributor

marginal23326 commented Feb 15, 2025

Name: browser-use
Version: 0.1.29

Hm... the most recent working version is 0.1.32. Perhaps try this:

uv pip install browser-use==0.1.32

@warmshao
Copy link
Collaborator

Name: browser-use Version: 0.1.29

C:\Users\Anike\AppData\Local\Programs\Python\Python313\Lib\site-packages\browser_use\utils.py This doesn't seem to be in the uv env. Did you not activate it before running?

@Anik2901
Copy link
Author

Tried still same

@marginal23326
Copy link
Contributor

marginal23326 commented Feb 15, 2025

Tried still same

Did you install the requirements after activating the virtual environment? Check if there is a new .venv folder in the web-ui directory.

Also, is the error the same as before? If you activated it, the error should be different if you are still getting it.

Try reinstalling the requirements again after you activated it:

  1. Windows (Command Prompt):
.venv\Scripts\activate
  1. To install the requirements:
uv pip install -r requirements.txt

Now try running the webui again.

If you are still getting errors, share the terminal output.

@Anik2901
Copy link
Author

INFO [agent] 🚀 Starting task: go to google.com and type 'OpenAI' click search and give me the first url
INFO [src.agent.custom_agent]
📍 Step 1
ERROR [agent] ❌ Result failed 1/5 times:
Connection error.
INFO [src.agent.custom_agent]
📍 Step 1
ERROR [agent] ❌ Result failed 2/5 times:
Connection error.
INFO [src.agent.custom_agent]
📍 Step 1
ERROR [agent] ❌ Result failed 3/5 times:
Connection error.

@vvincent1234
Copy link
Contributor

update code and try again

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

No branches or pull requests

4 participants