Skip to content

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

Fix DeepSeek model name matching in message conversion

codenoid65f82588aa70
diff --git a/browser_use/agent/message_manager/utils.py b/browser_use/agent/message_manager/utils.py
index 46bcd41b7..fc616175c 100644
--- a/browser_use/agent/message_manager/utils.py
+++ b/browser_use/agent/message_manager/utils.py
@@ -38,7 +38,7 @@ def convert_input_messages(input_messages: list[BaseMessage], model_name: Option
"""Convert input messages to a format that is compatible with the planner model"""
if model_name is None:
return input_messages
- if model_name == 'deepseek-reasoner' or "deepseek-r1" in model_name:
+ if model_name == 'deepseek-reasoner' or 'deepseek-r1' in model_name:
converted_input_messages = _convert_messages_for_non_function_calling_models(input_messages)
merged_input_messages = _merge_successive_messages(converted_input_messages, HumanMessage)
merged_input_messages = _merge_successive_messages(merged_input_messages, AIMessage)