Skip to content

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

bump openai and fix new types for tool calling

mertunsallbc99294d0a02
diff --git a/browser_use/llm/openai/serializer.py b/browser_use/llm/openai/serializer.py
index 66a339071..2bcdddd1d 100644
--- a/browser_use/llm/openai/serializer.py
+++ b/browser_use/llm/openai/serializer.py
@@ -5,13 +5,13 @@ from openai.types.chat import (
ChatCompletionContentPartImageParam,
ChatCompletionContentPartRefusalParam,
ChatCompletionContentPartTextParam,
+ ChatCompletionMessageFunctionToolCallParam,
ChatCompletionMessageParam,
- ChatCompletionMessageToolCallParam,
ChatCompletionSystemMessageParam,
ChatCompletionUserMessageParam,
)
from openai.types.chat.chat_completion_content_part_image_param import ImageURL
-from openai.types.chat.chat_completion_message_tool_call_param import Function
+from openai.types.chat.chat_completion_message_function_tool_call_param import Function
from browser_use.llm.messages import (
AssistantMessage,
@@ -92,8 +92,8 @@ class OpenAIMessageSerializer:
return serialized_parts
@staticmethod
- def _serialize_tool_call(tool_call: ToolCall) -> ChatCompletionMessageToolCallParam:
- return ChatCompletionMessageToolCallParam(
+ def _serialize_tool_call(tool_call: ToolCall) -> ChatCompletionMessageFunctionToolCallParam:
+ return ChatCompletionMessageFunctionToolCallParam(
id=tool_call.id,
function=Function(name=tool_call.function.name, arguments=tool_call.function.arguments),
type='function',
diff --git a/pyproject.toml b/pyproject.toml
index c8aecbf34..b6b44e70a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -32,7 +32,7 @@ dependencies = [
"uuid7>=0.1.0",
"authlib>=1.6.0",
"google-genai>=1.26.0",
- "openai>=1.97.0",
+ "openai>=1.99.2",
"anthropic>=0.58.2",
"groq>=0.30.0",
"ollama>=0.5.1",