mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
Merge pull request #28 from mishushakov/main
Updated Browserbase load tool
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
import os
|
||||
from crewai_tools import BaseTool
|
||||
from typing import Union, Optional
|
||||
from typing import Optional, Any
|
||||
from pydantic.v1 import BaseModel, Field
|
||||
|
||||
class BrowserbaseLoadToolSchema(BaseModel):
|
||||
url: str = Field(description="Website URL")
|
||||
|
||||
class BrowserbaseLoadTool(BaseTool):
|
||||
name: str = "Browserbase web load tool"
|
||||
description: str = "Load webpages in a headless browser using Browserbase and return the contents"
|
||||
args_schema: Type[BaseModel] = BrowserbaseLoadToolSchema
|
||||
api_key: Optional[str] = None
|
||||
text_content: Optional[bool] = False
|
||||
browserbase: Optional[Any] = None
|
||||
|
||||
def __init__(self, api_key: Optional[str] = None, text_content: bool = False):
|
||||
def __init__(self, api_key: Optional[str] = None, text_content: Optional[bool] = False, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
try:
|
||||
from browserbase import Browserbase
|
||||
except ImportError:
|
||||
|
||||
Reference in New Issue
Block a user