Skip to content

Commit a23bc53

Browse files
authored
Switch to Browser Use's BrowserSession & update packages (#10)
* Switch the BrowserSession * update packages
1 parent 3491944 commit a23bc53

File tree

3 files changed

+41
-11
lines changed

3 files changed

+41
-11
lines changed

templates/python/browser-use/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from langchain_openai import ChatOpenAI
2-
from browser_use import Agent, Browser, BrowserConfig
2+
from browser_use import Agent, BrowserSession
33
import kernel
44
from kernel import Kernel
55
from typing import TypedDict
@@ -34,7 +34,7 @@ async def bu_task(ctx: kernel.KernelContext, input_data: TaskInput):
3434
#task="Compare the price of gpt-4o and DeepSeek-V3",
3535
task=input_data["task"],
3636
llm=llm,
37-
browser=Browser(BrowserConfig(cdp_url=kernel_browser.cdp_ws_url))
37+
browser_session=BrowserSession(cdp_url=kernel_browser.cdp_ws_url)
3838
)
3939
result = await agent.run()
4040
if result.final_result() is not None:

templates/python/browser-use/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Kernel sample app for Browser Use"
55
readme = "README.md"
66
requires-python = ">=3.11"
77
dependencies = [
8-
"browser-use>=0.1.46",
8+
"browser-use~=0.2.4",
99
"kernel==0.3.0",
1010
"langchain-openai>=0.3.11",
1111
"pydantic>=2.10.6",

templates/python/browser-use/uv.lock

Lines changed: 38 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)