Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Fix: Replace ChatOpenAI with ChatDeepSeek

zhangzheng7bae8509e3f7
diff --git a/examples/models/deepseek-r1.py b/examples/models/deepseek-r1.py
index 1a8808a38..25a1cf0d0 100644
--- a/examples/models/deepseek-r1.py
+++ b/examples/models/deepseek-r1.py
@@ -2,7 +2,7 @@ import asyncio
import os
from dotenv import load_dotenv
-from langchain_openai import ChatOpenAI
+from langchain_deepseek import ChatDeepSeek
from pydantic import SecretStr
from browser_use import Agent
@@ -18,7 +18,7 @@ if not api_key:
async def run_search():
agent = Agent(
task=('go to amazon.com, search for laptop, sort by best rating, and give me the price of the first result'),
- llm=ChatOpenAI(
+ llm=ChatDeepSeek(
base_url='https://api.deepseek.com/v1',
model='deepseek-reasoner',
api_key=SecretStr(api_key),
diff --git a/examples/models/deepseek.py b/examples/models/deepseek.py
index 8763228b0..072c0a192 100644
--- a/examples/models/deepseek.py
+++ b/examples/models/deepseek.py
@@ -2,7 +2,7 @@ import asyncio
import os
from dotenv import load_dotenv
-from langchain_openai import ChatOpenAI
+from langchain_deepseek import ChatDeepSeek
from pydantic import SecretStr
from browser_use import Agent
@@ -23,7 +23,7 @@ async def run_search():
'3. Click on first result'
'4. Return the first comment'
),
- llm=ChatOpenAI(
+ llm=ChatDeepSeek(
base_url='https://api.deepseek.com/v1',
model='deepseek-chat',
api_key=SecretStr(api_key),
@@ -35,4 +35,4 @@ async def run_search():
if __name__ == '__main__':
- asyncio.run(run_search())
+ asyncio.run(run_search())
\ No newline at end of file