Skip to content

Commit

Permalink
Merge pull request #1033 from julep-ai/f/bb-sdk-v1.0
Browse files Browse the repository at this point in the history
F/bb sdk v1.0: Updating the BrowserBase SDK from v0.x to v1.x
  • Loading branch information
Ahmad-mtos authored Jan 16, 2025
2 parents 635a20c + 9f7c363 commit 4085297
Show file tree
Hide file tree
Showing 13 changed files with 1,153 additions and 394 deletions.
36 changes: 0 additions & 36 deletions agents-api/agents_api/autogen/Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,14 +557,6 @@ class BrowserbaseGetSessionArgumentsUpdate(BaseModel):
id: str | None = None


class BrowserbaseGetSessionConnectUrlArguments(BrowserbaseGetSessionArguments):
pass


class BrowserbaseGetSessionConnectUrlArgumentsUpdate(BrowserbaseGetSessionArgumentsUpdate):
pass


class BrowserbaseGetSessionLiveUrlsArguments(BrowserbaseGetSessionArguments):
pass

Expand Down Expand Up @@ -946,7 +938,6 @@ class CreateToolRequest(BaseModel):
| BrowserbaseGetSessionIntegrationDef
| BrowserbaseCompleteSessionIntegrationDef
| BrowserbaseGetSessionLiveUrlsIntegrationDef
| BrowserbaseGetSessionConnectUrlIntegrationDef
| RemoteBrowserIntegrationDef
| LlamaParseIntegrationDef
| FfmpegIntegrationDef
Expand Down Expand Up @@ -1464,7 +1455,6 @@ class PatchToolRequest(BaseModel):
| BrowserbaseGetSessionIntegrationDefUpdate
| BrowserbaseCompleteSessionIntegrationDefUpdate
| BrowserbaseGetSessionLiveUrlsIntegrationDefUpdate
| BrowserbaseGetSessionConnectUrlIntegrationDefUpdate
| RemoteBrowserIntegrationDefUpdate
| LlamaParseIntegrationDefUpdate
| FfmpegIntegrationDefUpdate
Expand Down Expand Up @@ -1896,7 +1886,6 @@ class Tool(BaseModel):
| BrowserbaseGetSessionIntegrationDef
| BrowserbaseCompleteSessionIntegrationDef
| BrowserbaseGetSessionLiveUrlsIntegrationDef
| BrowserbaseGetSessionConnectUrlIntegrationDef
| RemoteBrowserIntegrationDef
| LlamaParseIntegrationDef
| FfmpegIntegrationDef
Expand Down Expand Up @@ -1990,7 +1979,6 @@ class UpdateToolRequest(BaseModel):
| BrowserbaseGetSessionIntegrationDef
| BrowserbaseCompleteSessionIntegrationDef
| BrowserbaseGetSessionLiveUrlsIntegrationDef
| BrowserbaseGetSessionConnectUrlIntegrationDef
| RemoteBrowserIntegrationDef
| LlamaParseIntegrationDef
| FfmpegIntegrationDef
Expand Down Expand Up @@ -2476,30 +2464,6 @@ class BrowserbaseExtensionIntegrationDefUpdate(BaseBrowserbaseIntegrationDefUpda
"""


class BrowserbaseGetSessionConnectUrlIntegrationDef(BaseBrowserbaseIntegrationDef):
"""
browserbase get session connect url integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
method: Literal["get_connect_url"] = "get_connect_url"
arguments: BrowserbaseGetSessionConnectUrlArguments | None = None


class BrowserbaseGetSessionConnectUrlIntegrationDefUpdate(BaseBrowserbaseIntegrationDefUpdate):
"""
browserbase get session connect url integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
method: Literal["get_connect_url"] = "get_connect_url"
arguments: BrowserbaseGetSessionConnectUrlArgumentsUpdate | None = None


class BrowserbaseGetSessionIntegrationDef(BaseBrowserbaseIntegrationDef):
"""
browserbase get session integration definition
Expand Down
4 changes: 4 additions & 0 deletions agents-api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ x--base-agents-api: &base-agents-api
environment:
<<: *shared-environment
build:
platforms:
- linux/amd64
context: .
dockerfile: Dockerfile

Expand Down Expand Up @@ -98,6 +100,8 @@ services:
environment:
<<: *shared-environment
build:
platforms:
- linux/amd64
context: .
dockerfile: Dockerfile.worker

Expand Down
1,157 changes: 1,014 additions & 143 deletions cookbooks/06-browser-use.ipynb

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions integrations-service/integrations/autogen/Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,14 +557,6 @@ class BrowserbaseGetSessionArgumentsUpdate(BaseModel):
id: str | None = None


class BrowserbaseGetSessionConnectUrlArguments(BrowserbaseGetSessionArguments):
pass


class BrowserbaseGetSessionConnectUrlArgumentsUpdate(BrowserbaseGetSessionArgumentsUpdate):
pass


class BrowserbaseGetSessionLiveUrlsArguments(BrowserbaseGetSessionArguments):
pass

Expand Down Expand Up @@ -946,7 +938,6 @@ class CreateToolRequest(BaseModel):
| BrowserbaseGetSessionIntegrationDef
| BrowserbaseCompleteSessionIntegrationDef
| BrowserbaseGetSessionLiveUrlsIntegrationDef
| BrowserbaseGetSessionConnectUrlIntegrationDef
| RemoteBrowserIntegrationDef
| LlamaParseIntegrationDef
| FfmpegIntegrationDef
Expand Down Expand Up @@ -1464,7 +1455,6 @@ class PatchToolRequest(BaseModel):
| BrowserbaseGetSessionIntegrationDefUpdate
| BrowserbaseCompleteSessionIntegrationDefUpdate
| BrowserbaseGetSessionLiveUrlsIntegrationDefUpdate
| BrowserbaseGetSessionConnectUrlIntegrationDefUpdate
| RemoteBrowserIntegrationDefUpdate
| LlamaParseIntegrationDefUpdate
| FfmpegIntegrationDefUpdate
Expand Down Expand Up @@ -1896,7 +1886,6 @@ class Tool(BaseModel):
| BrowserbaseGetSessionIntegrationDef
| BrowserbaseCompleteSessionIntegrationDef
| BrowserbaseGetSessionLiveUrlsIntegrationDef
| BrowserbaseGetSessionConnectUrlIntegrationDef
| RemoteBrowserIntegrationDef
| LlamaParseIntegrationDef
| FfmpegIntegrationDef
Expand Down Expand Up @@ -1990,7 +1979,6 @@ class UpdateToolRequest(BaseModel):
| BrowserbaseGetSessionIntegrationDef
| BrowserbaseCompleteSessionIntegrationDef
| BrowserbaseGetSessionLiveUrlsIntegrationDef
| BrowserbaseGetSessionConnectUrlIntegrationDef
| RemoteBrowserIntegrationDef
| LlamaParseIntegrationDef
| FfmpegIntegrationDef
Expand Down Expand Up @@ -2476,30 +2464,6 @@ class BrowserbaseExtensionIntegrationDefUpdate(BaseBrowserbaseIntegrationDefUpda
"""


class BrowserbaseGetSessionConnectUrlIntegrationDef(BaseBrowserbaseIntegrationDef):
"""
browserbase get session connect url integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
method: Literal["get_connect_url"] = "get_connect_url"
arguments: BrowserbaseGetSessionConnectUrlArguments | None = None


class BrowserbaseGetSessionConnectUrlIntegrationDefUpdate(BaseBrowserbaseIntegrationDefUpdate):
"""
browserbase get session connect url integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
method: Literal["get_connect_url"] = "get_connect_url"
arguments: BrowserbaseGetSessionConnectUrlArgumentsUpdate | None = None


class BrowserbaseGetSessionIntegrationDef(BaseBrowserbaseIntegrationDef):
"""
browserbase get session integration definition
Expand Down
3 changes: 0 additions & 3 deletions integrations-service/integrations/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
from .browserbase import (
BrowserbaseExtensionOutput as BrowserbaseExtensionOutput,
)
from .browserbase import (
BrowserbaseGetSessionConnectUrlOutput as BrowserbaseGetSessionConnectUrlOutput,
)
from .browserbase import (
BrowserbaseGetSessionLiveUrlsOutput as BrowserbaseGetSessionLiveUrlsOutput,
)
Expand Down
10 changes: 4 additions & 6 deletions integrations-service/integrations/models/browserbase.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Literal

from browserbase import DebugConnectionURLs, Session
from browserbase.types import Session
from browserbase.types.session_live_urls import SessionLiveURLs
from pydantic import AnyUrl, Field

from .base_models import BaseOutput
Expand All @@ -12,6 +13,7 @@ class BrowserbaseListSessionsOutput(BaseOutput):

class BrowserbaseCreateSessionOutput(BaseOutput):
id: str = Field(..., description="Unique identifier for the session")
connect_url: str | None = Field(None, description="The connection URL for the session")
createdAt: str | None = Field(
None, description="Timestamp indicating when the session was created"
)
Expand Down Expand Up @@ -72,10 +74,6 @@ class BrowserbaseExtensionOutput(BaseOutput):
id: str = Field(..., description="Unique identifier for the extension")


class BrowserbaseGetSessionConnectUrlOutput(BaseOutput):
url: AnyUrl = Field(..., description="The connection URL for the session")


class PageInfo(BaseOutput):
id: str | None = Field(None, description="Unique identifier for the page")
url: AnyUrl | None = Field(None, description="URL of the page")
Expand All @@ -90,7 +88,7 @@ class PageInfo(BaseOutput):


class BrowserbaseGetSessionLiveUrlsOutput(BaseOutput):
urls: DebugConnectionURLs = Field(..., description="The live URLs for the session")
urls: SessionLiveURLs = Field(..., description="The live URLs for the session")


class BrowserbaseContextOutput(BaseOutput):
Expand Down
4 changes: 0 additions & 4 deletions integrations-service/integrations/models/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
BrowserbaseCreateSessionArguments,
BrowserbaseExtensionArguments,
BrowserbaseGetSessionArguments,
BrowserbaseGetSessionConnectUrlArguments,
BrowserbaseGetSessionLiveUrlsArguments,
BrowserbaseListSessionsArguments,
BrowserbaseSetup,
Expand All @@ -38,7 +37,6 @@
BrowserbaseContextOutput,
BrowserbaseCreateSessionOutput,
BrowserbaseExtensionOutput,
BrowserbaseGetSessionConnectUrlOutput,
BrowserbaseGetSessionLiveUrlsOutput,
BrowserbaseGetSessionOutput,
BrowserbaseListSessionsOutput,
Expand Down Expand Up @@ -81,7 +79,6 @@ class ExecutionError(BaseModel):
| BraveSearchArguments
| BrowserbaseCreateSessionArguments
| BrowserbaseGetSessionArguments
| BrowserbaseGetSessionConnectUrlArguments
| BrowserbaseGetSessionLiveUrlsArguments
| BrowserbaseCompleteSessionArguments
| BrowserbaseContextArguments
Expand All @@ -102,7 +99,6 @@ class ExecutionError(BaseModel):
| BraveSearchOutput
| BrowserbaseCreateSessionOutput
| BrowserbaseGetSessionOutput
| BrowserbaseGetSessionConnectUrlOutput
| BrowserbaseGetSessionLiveUrlsOutput
| BrowserbaseCompleteSessionOutput
| BrowserbaseContextOutput
Expand Down
8 changes: 0 additions & 8 deletions integrations-service/integrations/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
BrowserbaseCreateSessionArguments,
BrowserbaseExtensionArguments,
BrowserbaseGetSessionArguments,
BrowserbaseGetSessionConnectUrlArguments,
BrowserbaseGetSessionLiveUrlsArguments,
BrowserbaseListSessionsArguments,
BrowserbaseSetup,
Expand Down Expand Up @@ -36,7 +35,6 @@
BrowserbaseCompleteSessionOutput,
BrowserbaseCreateSessionOutput,
BrowserbaseExtensionOutput,
BrowserbaseGetSessionConnectUrlOutput,
BrowserbaseGetSessionLiveUrlsOutput,
BrowserbaseGetSessionOutput,
BrowserbaseListSessionsOutput,
Expand Down Expand Up @@ -221,12 +219,6 @@
arguments=BrowserbaseExtensionArguments,
output=BrowserbaseExtensionOutput,
),
BaseProviderMethod(
method="get_connect_url",
description="Get the connection URL for a session",
arguments=BrowserbaseGetSessionConnectUrlArguments,
output=BrowserbaseGetSessionConnectUrlOutput,
),
],
info=ProviderInfo(
friendly_name="BrowserBase",
Expand Down
Loading

0 comments on commit 4085297

Please sign in to comment.