-
Notifications
You must be signed in to change notification settings - Fork 285
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
BrowserbaseLoadTool needs an update with newer Browserbase python SDK #140
Comments
The following script is generated by AI Agent to help reproduce the issue: # crewAI-tools/crewai_tools/tools/browserbase_load_tool/reproduce.py
import os
import sys
from unittest.mock import MagicMock, patch
# Mock the browserbase module
mock_browserbase = MagicMock()
sys.modules['browserbase'] = mock_browserbase
mock_browserbase.Browserbase.return_value.load_url.return_value = "Mocked content"
from crewai_tools.tools.browserbase_load_tool.browserbase_load_tool import BrowserbaseLoadTool
def test_browserbase_load_tool():
# Set environment variables
os.environ['BROWSERBASE_API_KEY'] = 'test_api_key'
os.environ['BROWSERBASE_PROJECT_ID'] = 'test_project_id'
try:
tool = BrowserbaseLoadTool()
# Simulate the issue by checking if the environment variables are not passed to the browserbase object
if tool.browserbase.api_key != os.environ['BROWSERBASE_API_KEY'] or tool.browserbase.project_id != os.environ['BROWSERBASE_PROJECT_ID']:
raise AssertionError("Environment variables not passed to the browserbase object correctly.")
try:
result = tool._run("https://example.com")
print("Test passed successfully with no errors!")
except Exception as e:
raise AssertionError(e)
except Exception as e:
raise AssertionError(e)
if __name__ == "__main__":
test_browserbase_load_tool() How to run: python3 crewAI-tools/crewai_tools/tools/browserbase_load_tool/reproduce.py Expected Result:
Thank you for your valuable contribution to this project and we appreciate your feedback! Please respond with an emoji if you find this script helpful. Feel free to comment below if any improvements are needed. Best regards from an AI Agent! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the newer Browserbase python SDK seems to not pass env vars into the
browserbase
object which causes an error here:https://github.com/crewAIInc/crewAI-tools/blob/main/crewai_tools/tools/browserbase_load_tool/browserbase_load_tool.py#L42
The text was updated successfully, but these errors were encountered: