Skip to content

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

Remove unrelated langchain example changes as requested by reviewer

MagellaX6bbf6235fd2c
diff --git a/examples/models/langchain/chat.py b/examples/models/langchain/chat.py
index 30c2020cb..08502c4bf 100644
--- a/examples/models/langchain/chat.py
+++ b/examples/models/langchain/chat.py
@@ -152,7 +152,7 @@ class ChatLangchain(BaseChatModel):
if hasattr(self.chat, 'model_kwargs'):
# Temporarily modify model kwargs to use json_mode instead of json_schema
original_kwargs = getattr(self.chat, 'model_kwargs', {})
- setattr(self.chat, 'model_kwargs', {**original_kwargs})
+ self.chat.model_kwargs = {**original_kwargs}
# Check if this is a ChatOpenAI model with structured output issues
if self.chat.__class__.__name__ == 'ChatOpenAI':
@@ -239,9 +239,3 @@ class ChatLangchain(BaseChatModel):
message=f'LangChain model error: {str(e)}',
model=self.name,
) from e
-
- # This should never be reached, but add fallback for type checker
- raise ModelProviderError(
- message='Unexpected code path reached in ainvoke',
- model=self.name,
- )