diff --git a/templates/python/browser-use/main.py b/templates/python/browser-use/main.py index e9ed117..7ce130b 100644 --- a/templates/python/browser-use/main.py +++ b/templates/python/browser-use/main.py @@ -1,5 +1,5 @@ from langchain_openai import ChatOpenAI -from browser_use import Agent, Browser, BrowserConfig +from browser_use import Agent, BrowserSession import kernel from kernel import Kernel from typing import TypedDict @@ -34,7 +34,7 @@ async def bu_task(ctx: kernel.KernelContext, input_data: TaskInput): #task="Compare the price of gpt-4o and DeepSeek-V3", task=input_data["task"], llm=llm, - browser=Browser(BrowserConfig(cdp_url=kernel_browser.cdp_ws_url)) + browser_session=BrowserSession(cdp_url=kernel_browser.cdp_ws_url) ) result = await agent.run() if result.final_result() is not None: diff --git a/templates/python/browser-use/pyproject.toml b/templates/python/browser-use/pyproject.toml index 2f5215e..117ab3e 100644 --- a/templates/python/browser-use/pyproject.toml +++ b/templates/python/browser-use/pyproject.toml @@ -5,7 +5,7 @@ description = "Kernel sample app for Browser Use" readme = "README.md" requires-python = ">=3.11" dependencies = [ - "browser-use>=0.1.46", + "browser-use~=0.2.4", "kernel==0.3.0", "langchain-openai>=0.3.11", "pydantic>=2.10.6", diff --git a/templates/python/browser-use/uv.lock b/templates/python/browser-use/uv.lock index 8f98822..18d3428 100644 --- a/templates/python/browser-use/uv.lock +++ b/templates/python/browser-use/uv.lock @@ -101,7 +101,7 @@ wheels = [ [[package]] name = "browser-use" -version = "0.1.48" +version = "0.2.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, @@ -118,6 +118,7 @@ dependencies = [ { name = "langchain-openai" }, { name = "markdownify" }, { name = "mem0ai" }, + { name = "patchright" }, { name = "playwright" }, { name = "posthog" }, { name = "psutil" }, @@ -128,10 +129,11 @@ dependencies = [ { name = "requests" }, { name = "screeninfo", marker = "platform_system != 'darwin'" }, { name = "typing-extensions" }, + { name = "uuid7" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/6c/a0/8b4c08da6adc8be7bee48d216fbf829bb7f5f9cd5c06147ee9d0da11593a/browser_use-0.1.48.tar.gz", hash = "sha256:7c061c8fdea735345d6d480d7c7fd2b24557826fa92c00d8efd7f98f4d6f29c1", size = 127897 } +sdist = { url = "https://files.pythonhosted.org/packages/cc/98/d25aa668afc6a03249bbb13983526b6d0a99b187d911a81888c69854cb4a/browser_use-0.2.4.tar.gz", hash = "sha256:113cb4368a7aac4dafe257afaec4a07386f3a5aba8df868cc10c68434b17669c", size = 146044 } wheels = [ - { url = "https://files.pythonhosted.org/packages/64/ea/527e3c2108b78517a5b952b20039dbe46e90ca297222462989fc9bc85a51/browser_use-0.1.48-py3-none-any.whl", hash = "sha256:7848ac2cd35d0b8b0528d4b8c44dc637ce3efce73b29ca1c41f3bd1f7845de40", size = 146023 }, + { url = "https://files.pythonhosted.org/packages/3f/3f/487fe95423c849fecf5a9a30ac45f24efa6a9b7bb8f5fa5ec57e20f6b694/browser_use-0.2.4-py3-none-any.whl", hash = "sha256:1e8ca7a4594f608cf26cff55a39e065ffc3f3968d20f89c27f8a6f259e6db5f3", size = 163984 }, ] [[package]] @@ -656,7 +658,7 @@ wheels = [ [[package]] name = "kernel" -version = "0.1.0a15" +version = "0.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, @@ -666,9 +668,9 @@ dependencies = [ { name = "sniffio" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/bd/44/dac0862d92483766b0389262bd347e84fa7003d41785e267e3db33b767ec/kernel-0.1.0a15.tar.gz", hash = "sha256:4ba5c0553c99d77f18761eec1a6a0690151a345eae8b1256258a006d93345278", size = 96196 } +sdist = { url = "https://files.pythonhosted.org/packages/f1/e2/2515aeed52d12429db04c451c6eb2bd7bea67aad7e4593f2f551dbaec166/kernel-0.3.0.tar.gz", hash = "sha256:8203ef1a046b9d04973b1a80957a40dc2a6df3e093e4c7cb67e77a453be3edeb", size = 98063 } wheels = [ - { url = "https://files.pythonhosted.org/packages/98/b4/a6fb26dd488af299e32867122c6e53f7eb269bf544da5650d7379dac7e68/kernel-0.1.0a15-py3-none-any.whl", hash = "sha256:463a338b4d4eba560a1ca1da7918801fea0572ad77aaec3bdbaa993ed0c8e581", size = 83599 }, + { url = "https://files.pythonhosted.org/packages/5d/c4/ee591dd0e0c3f280cb6763e5a9bd643fb611d6b8f7951d0b3aebb462137e/kernel-0.3.0-py3-none-any.whl", hash = "sha256:30ed748a1097dea2606d43b09ae4989ae3b6869219d18c069838ef5ff0d29f27", size = 86219 }, ] [[package]] @@ -1037,6 +1039,25 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, ] +[[package]] +name = "patchright" +version = "1.52.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "greenlet" }, + { name = "pyee" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/21/c7/4687ac7d17cf523d6e3fe8f00cb450372f8024e2bfa6a0cbfe0cd3b37a08/patchright-1.52.4-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:5b9f3156c36a896f2b4e5faa3d1a4cf1ebe3216a6b8d46fe8e0002724175bc63", size = 39592690 }, + { url = "https://files.pythonhosted.org/packages/f5/46/7f142cdcc252bc8f60560810094874fc327fd08f78b3187382595dd1fecb/patchright-1.52.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c8af8ccee89f0a0f7237ec43ab92aecd201d0616f14d0429775ce23538715197", size = 37944417 }, + { url = "https://files.pythonhosted.org/packages/3c/82/618a815238f8b44e7f308c5fc0f482b99039cc2632088b5020a57387d94b/patchright-1.52.4-py3-none-macosx_11_0_universal2.whl", hash = "sha256:8c38c40b04fd4cc3706cd27f8594947b661dc008c4aaf3d42bdb36906fa41dc3", size = 39592690 }, + { url = "https://files.pythonhosted.org/packages/12/c1/2b13231891c7cddb615eaeae7a5431498edd4f0c03fa5ce820098cbbadbc/patchright-1.52.4-py3-none-manylinux1_x86_64.whl", hash = "sha256:c730869591bed5b88d11dac6e0ec1f2e58b737e630091af0c78528a6e4403bcb", size = 45122777 }, + { url = "https://files.pythonhosted.org/packages/35/0f/6b1cf29f1ec8b80e93bfcd8e8e4d4e10264f57348cddaebc766a3d4be280/patchright-1.52.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f7b15b47440795d41fefc2cd436ebc255909cafc56f959d988ce7b88afc34ad", size = 44522068 }, + { url = "https://files.pythonhosted.org/packages/4c/0e/47e06a7249947a058024e2d3dc50866b3a52bffb9b0588fcbbf41068ecdc/patchright-1.52.4-py3-none-win32.whl", hash = "sha256:a3d05b3d54fa8aae978a392d5dccb821f8baefe08b18d1be53231a4d37f82a5c", size = 34820599 }, + { url = "https://files.pythonhosted.org/packages/35/8e/48542be773070720add55dcbdb932c8b6be856ff35503266c0c7a14b473c/patchright-1.52.4-py3-none-win_amd64.whl", hash = "sha256:a3df47f6048d9f4cd618d69a24fe01b26c6fcbad71fd5fc4b5f317e71d995fbb", size = 34820606 }, + { url = "https://files.pythonhosted.org/packages/cc/1c/2edb5442eb290bd77585ef682c4196cceedf2f21a41a344f96b123a363cf/patchright-1.52.4-py3-none-win_arm64.whl", hash = "sha256:e1cd99b6424dad129db083e676013f394a2446f5a8f48c43aaa3a32e1b3b9773", size = 30670414 }, +] + [[package]] name = "playwright" version = "1.52.0" @@ -3879,8 +3900,8 @@ dependencies = [ [package.metadata] requires-dist = [ - { name = "browser-use", specifier = ">=0.1.46" }, - { name = "kernel", specifier = "==0.1.0a15" }, + { name = "browser-use", specifier = "~=0.2.4" }, + { name = "kernel", specifier = "==0.3.0" }, { name = "langchain-openai", specifier = ">=0.3.11" }, { name = "pydantic", specifier = ">=2.10.6" }, ] @@ -4235,6 +4256,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/6b/11/cc635220681e93a0183390e26485430ca2c7b5f9d33b15c74c2861cb8091/urllib3-2.4.0-py3-none-any.whl", hash = "sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813", size = 128680 }, ] +[[package]] +name = "uuid7" +version = "0.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5c/19/7472bd526591e2192926247109dbf78692e709d3e56775792fec877a7720/uuid7-0.1.0.tar.gz", hash = "sha256:8c57aa32ee7456d3cc68c95c4530bc571646defac01895cfc73545449894a63c", size = 14052 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b5/77/8852f89a91453956582a85024d80ad96f30a41fed4c2b3dce0c9f12ecc7e/uuid7-0.1.0-py2.py3-none-any.whl", hash = "sha256:5e259bb63c8cb4aded5927ff41b444a80d0c7124e8a0ced7cf44efa1f5cccf61", size = 7477 }, +] + [[package]] name = "zstandard" version = "0.23.0"