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
make reasoning_models a parameter
Magnus Müller2b0045feff67
diff --git a/browser_use/llm/openai/chat.py b/browser_use/llm/openai/chat.pyindex 78821c394..d6b233a9a 100644--- a/browser_use/llm/openai/chat.py+++ b/browser_use/llm/openai/chat.py@@ -20,18 +20,6 @@ from browser_use.llm.views import ChatInvokeCompletion, ChatInvokeUsageT = TypeVar('T', bound=BaseModel)-ReasoningModels: list[ChatModel | str] = [- 'o4-mini',- 'o3',- 'o3-mini',- 'o1',- 'o1-pro',- 'o3-pro',- 'gpt-5',- 'gpt-5-mini',- 'gpt-5-nano',-]-@dataclassclass ChatOpenAI(BaseChatModel):@@ -67,6 +55,17 @@ class ChatOpenAI(BaseChatModel):http_client: httpx.AsyncClient | None = None_strict_response_validation: bool = Falsemax_completion_tokens: int | None = 4096+ reasoning_models: list[ChatModel | str] | None = [+ 'o4-mini',+ 'o3',+ 'o3-mini',+ 'o1',+ 'o1-pro',+ 'o3-pro',+ 'gpt-5',+ 'gpt-5-mini',+ 'gpt-5-nano',+ ]# Static@property@@ -180,7 +179,7 @@ class ChatOpenAI(BaseChatModel):if self.service_tier is not None:model_params['service_tier'] = self.service_tier- if any(str(m).lower() in str(self.model).lower() for m in ReasoningModels):+ if any(str(m).lower() in str(self.model).lower() for m in self.reasoning_models):model_params['reasoning_effort'] = self.reasoning_effortdel model_params['temperature']del model_params['frequency_penalty']