Skip to content

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

fix(gemini): Correct invalid schema by removing 'title' from required list

Alessandro524bb30ce6d6
diff --git a/browser_use/llm/google/chat.py b/browser_use/llm/google/chat.py
index 66ba74b90..b1c64c827 100644
--- a/browser_use/llm/google/chat.py
+++ b/browser_use/llm/google/chat.py
@@ -389,6 +389,10 @@ class ChatGoogle(BaseChatModel):
):
cleaned['properties'] = {'_placeholder': {'type': 'string'}}
+ # Also remove 'title' from the required list if it exists
+ if 'required' in cleaned and isinstance(cleaned.get('required'), list):
+ cleaned['required'] = [p for p in cleaned['required'] if p != 'title']
+
return cleaned
elif isinstance(obj, list):
return [clean_schema(item) for item in obj]