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

Add missing tool descriptions #643

Merged
merged 1 commit into from
Feb 12, 2025
Merged

Conversation

mbaynton
Copy link

@mbaynton mbaynton commented Feb 9, 2025

Full credit due to @jhachirag7 on this, I've set them as the commit author. They also opened #602 but it looks like it has some indentation issue (fixed here) and a few spurious commits and removed files; I only mean to make it as easy as possible for maintainers to get this merged.

I ([email protected]) have tested that with this fix it is possible to run against AWS Bedrock + Sonnet 3.5 v2.

Fixes #580

Full credit due to @jhachirag7 on this, I've set them as the commit
author. They also opened browser-use#602 but it looks like it has some indentation
issue (fixed here) and a few spurious commits and removed files; I only
mean to make it as easy as possible for maintainers to get this merged.

I ([email protected]) have tested that with this fix it is possible to
run against AWS Bedrock + Sonnet 3.5 v2.

Fixes browser-use#580
Copy link
Contributor

codebeaver-ai bot commented Feb 9, 2025

I tried to generate new tests but there might be some issues in your codebase that I couldn't fix.

🔄 Could not generate any new tests.
🐛 Found 1 bug
🛠️ 0/7 tests passed

🐛 Bug Detection

Potential issues found in the following files:

  • browser_use/agent/service.py

The error is caused by a bug in the code that is being tested—in particular, in the logic in the registry’s execute_action method. When calling the action’s function (i.e. test_action_with_browser), the code attempts to forward parameters by doing something like:
  await action.function(**validated_params.model_dump(), **extra_args)
Even though extra_args is supposed to include the browser (i.e. browser=mock_browser), the function’s signature (with a required “browser” parameter) is not being satisfied. As a result, the test ends up raising a TypeError indicating that the “browser” argument is missing.
This suggests that the registry code is mis-handling the merging or passing of keyword arguments when invoking the action function, causing it not to actually forward the browser argument to the function that expects it.

🛠️ Test Results

0/7 tests passed ⚠️

tests/test_dropdown.py

View error
tests/test_dropdown.py:20: in <module>
    llm = ChatOpenAI(model='gpt-4o')
/usr/local/lib/python3.11/site-packages/langchain_core/load/serializable.py:125: in __init__
    super().__init__(*args, **kwargs)
/usr/local/lib/python3.11/site-packages/langchain_openai/chat_models/base.py:622: in validate_environment
    self.root_client = openai.OpenAI(**client_params, **sync_specific)  # type: ignore[arg-type]
/usr/local/lib/python3.11/site-packages/openai/_client.py:110: in __init__
    raise OpenAIError(
E   openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

tests/test_dropdown.py

tests/test_dropdown_complex.py

View error
tests/test_dropdown_complex.py:20: in <module>
    llm = ChatOpenAI(model='gpt-4o')
/usr/local/lib/python3.11/site-packages/langchain_core/load/serializable.py:125: in __init__
    super().__init__(*args, **kwargs)
/usr/local/lib/python3.11/site-packages/langchain_openai/chat_models/base.py:622: in validate_environment
    self.root_client = openai.OpenAI(**client_params, **sync_specific)  # type: ignore[arg-type]
/usr/local/lib/python3.11/site-packages/openai/_client.py:110: in __init__
    raise OpenAIError(
E   openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

tests/test_dropdown_complex.py

tests/test_dropdown_error.py

View error
tests/test_dropdown_error.py:20: in <module>
    llm = ChatOpenAI(model='gpt-4o')
/usr/local/lib/python3.11/site-packages/langchain_core/load/serializable.py:125: in __init__
    super().__init__(*args, **kwargs)
/usr/local/lib/python3.11/site-packages/langchain_openai/chat_models/base.py:622: in validate_environment
    self.root_client = openai.OpenAI(**client_params, **sync_specific)  # type: ignore[arg-type]
/usr/local/lib/python3.11/site-packages/openai/_client.py:110: in __init__
    raise OpenAIError(
E   openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

tests/test_dropdown_error.py

tests/test_gif_path.py

View error
tests/test_gif_path.py:19: in <module>
    llm = ChatOpenAI(model='gpt-4o')
/usr/local/lib/python3.11/site-packages/langchain_core/load/serializable.py:125: in __init__
    super().__init__(*args, **kwargs)
/usr/local/lib/python3.11/site-packages/langchain_openai/chat_models/base.py:622: in validate_environment
    self.root_client = openai.OpenAI(**client_params, **sync_specific)  # type: ignore[arg-type]
/usr/local/lib/python3.11/site-packages/openai/_client.py:110: in __init__
    raise OpenAIError(
E   openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

tests/test_gif_path.py

tests/test_models.py

View error
tests/test_models.py:54: in <module>
    ChatOpenAI(
/usr/local/lib/python3.11/site-packages/langchain_core/load/serializable.py:125: in __init__
    super().__init__(*args, **kwargs)
/usr/local/lib/python3.11/site-packages/langchain_openai/chat_models/base.py:622: in validate_environment
    self.root_client = openai.OpenAI(**client_params, **sync_specific)  # type: ignore[arg-type]
/usr/local/lib/python3.11/site-packages/openai/_client.py:110: in __init__
    raise OpenAIError(
E   openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

tests/test_models.py

tests/test_react_dropdown.py

View error
tests/test_react_dropdown.py:20: in <module>
    llm = ChatOpenAI(model='gpt-4o')
/usr/local/lib/python3.11/site-packages/langchain_core/load/serializable.py:125: in __init__
    super().__init__(*args, **kwargs)
/usr/local/lib/python3.11/site-packages/langchain_openai/chat_models/base.py:622: in validate_environment
    self.root_client = openai.OpenAI(**client_params, **sync_specific)  # type: ignore[arg-type]
/usr/local/lib/python3.11/site-packages/openai/_client.py:110: in __init__
    raise OpenAIError(
E   openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

tests/test_react_dropdown.py

tests/test_vision.py

View error
tests/test_vision.py:25: in <module>
    llm = ChatOpenAI(model='gpt-4o')
/usr/local/lib/python3.11/site-packages/langchain_core/load/serializable.py:125: in __init__
    super().__init__(*args, **kwargs)
/usr/local/lib/python3.11/site-packages/langchain_openai/chat_models/base.py:622: in validate_environment
    self.root_client = openai.OpenAI(**client_params, **sync_specific)  # type: ignore[arg-type]
/usr/local/lib/python3.11/site-packages/openai/_client.py:110: in __init__
    raise OpenAIError(
E   openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

tests/test_vision.py


Settings | Logs | CodeBeaver

@MagMueller MagMueller merged commit a1c7f83 into browser-use:main Feb 12, 2025
2 checks passed
AryamanParida pushed a commit to AryamanParida/browser-use that referenced this pull request Mar 7, 2025
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.

tool description for bedrock models mandatory
3 participants