Skip to content

Commit 7076ab1

Browse files
committed
allignment
1 parent fb87d01 commit 7076ab1

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies = [
3636
"langchain-fireworks>=0.1.3",
3737
"langchain-community>=0.2.9",
3838
"langchain-huggingface>=0.0.3",
39+
"browserbase==0.3.0"
3940
]
4041

4142
license = "MIT"

requirements-dev.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ boto3==1.34.146
5454
botocore==1.34.146
5555
# via boto3
5656
# via s3transfer
57+
browserbase==0.3.0
58+
# via scrapegraphai
5759
burr==0.22.1
5860
# via scrapegraphai
5961
cachetools==5.4.0
@@ -208,6 +210,7 @@ httptools==0.6.1
208210
# via uvicorn
209211
httpx==0.27.0
210212
# via anthropic
213+
# via browserbase
211214
# via fastapi
212215
# via fireworks-ai
213216
# via groq
@@ -383,6 +386,7 @@ pillow==10.4.0
383386
platformdirs==4.2.2
384387
# via pylint
385388
playwright==1.45.0
389+
# via browserbase
386390
# via scrapegraphai
387391
# via undetected-playwright
388392
pluggy==1.5.0
@@ -412,6 +416,7 @@ pyasn1-modules==0.4.0
412416
# via google-auth
413417
pydantic==2.8.2
414418
# via anthropic
419+
# via browserbase
415420
# via burr
416421
# via fastapi
417422
# via fastapi-pagination

requirements.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ boto3==1.34.146
3737
botocore==1.34.146
3838
# via boto3
3939
# via s3transfer
40+
browserbase==0.3.0
41+
# via scrapegraphai
4042
cachetools==5.4.0
4143
# via google-auth
4244
certifi==2024.7.4
@@ -153,6 +155,7 @@ httplib2==0.22.0
153155
# via google-auth-httplib2
154156
httpx==0.27.0
155157
# via anthropic
158+
# via browserbase
156159
# via fireworks-ai
157160
# via groq
158161
# via openai
@@ -275,6 +278,7 @@ pillow==10.4.0
275278
# via langchain-nvidia-ai-endpoints
276279
# via sentence-transformers
277280
playwright==1.45.0
281+
# via browserbase
278282
# via scrapegraphai
279283
# via undetected-playwright
280284
proto-plus==1.24.0
@@ -299,6 +303,7 @@ pyasn1-modules==0.4.0
299303
# via google-auth
300304
pydantic==2.8.2
301305
# via anthropic
306+
# via browserbase
302307
# via fireworks-ai
303308
# via google-cloud-aiplatform
304309
# via google-generativeai

scrapegraphai/docloaders/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"""__init__.py file for docloaders folder"""
22

33
from .chromium import ChromiumLoader
4+
from .broswer_base import browser_base_fetch
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"""
2+
browserbase integration module
3+
"""
4+
from browserbase import Browserbase
5+
6+
def browser_base_fetch(api_key: str, project_id: str, link: str) -> object:
7+
"""
8+
BrowserBase Fetch
9+
This module provides an interface to the BrowserBase API.
10+
The `browser_base_fetch` function takes three arguments:
11+
- `api_key`: The API key provided by BrowserBase.
12+
- `project_id`: The ID of the project on BrowserBase where you want to fetch data from.
13+
- `link`: The URL or link that you want to fetch data from.
14+
It initializes a Browserbase object with the given API key and project ID,
15+
then uses this object to load the specified link.
16+
It returns the result of the loading operation.
17+
Example usage:
18+
```
19+
from browser_base_fetch import browser_base_fetch
20+
result = browser_base_fetch(api_key="your_api_key",
21+
project_id="your_project_id", link="https://example.com")
22+
print(result)
23+
```
24+
Please note that you need to replace "your_api_key" and "your_project_id"
25+
with your actual BrowserBase API key and project ID.
26+
Args:
27+
api_key (str): The API key provided by BrowserBase.
28+
project_id (str): The ID of the project on BrowserBase where you want to fetch data from.
29+
link (str): The URL or link that you want to fetch data from.
30+
Returns:
31+
object: The result of the loading operation.
32+
"""
33+
34+
browserbase = Browserbase(api_key=api_key, project_id=project_id)
35+
36+
result = browserbase.load(link)
37+
38+
return result

0 commit comments

Comments
 (0)