Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
fix(llm): gate DeepSeek thinking and preserve positional constructor
DipsyHou0452558036f0
diff --git a/browser_use/llm/deepseek/chat.py b/browser_use/llm/deepseek/chat.pyindex c9db7cc06..ba583b115 100644--- a/browser_use/llm/deepseek/chat.py+++ b/browser_use/llm/deepseek/chat.py@@ -36,13 +36,14 @@ class ChatDeepSeek(BaseChatModel):temperature: float | None = Nonetop_p: float | None = Noneseed: int | None = None- thinking: bool = False# Connection parametersapi_key: str | None = Nonebase_url: str | httpx.URL | None = 'https://api.deepseek.com/v1'timeout: float | httpx.Timeout | None = Noneclient_params: dict[str, Any] | None = None++ thinking: bool = False@propertydef provider(self) -> str:@@ -60,6 +61,10 @@ class ChatDeepSeek(BaseChatModel):def name(self) -> str:return self.model+ def _supports_thinking(self) -> bool:++ return 'deepseek-v4' in self.model.lower()+def _request_kwargs(self) -> dict[str, Any]:common: dict[str, Any] = {}@@ -72,9 +77,10 @@ class ChatDeepSeek(BaseChatModel):if self.seed is not None:common['seed'] = self.seed- common['extra_body'] = {- 'thinking': {'type': 'enabled' if self.thinking else 'disabled'},- }+ if self._supports_thinking():+ common['extra_body'] = {+ 'thinking': {'type': 'enabled' if self.thinking else 'disabled'},+ }return common@overload