Skip to content

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

Add stop_reason to ChatInvokeCompletion in ChatVercel model

kalil0321d517efa50aa9
diff --git a/browser_use/llm/vercel/chat.py b/browser_use/llm/vercel/chat.py
index 6952abf27..57d6ebe80 100644
--- a/browser_use/llm/vercel/chat.py
+++ b/browser_use/llm/vercel/chat.py
@@ -305,6 +305,7 @@ class ChatVercel(BaseChatModel):
return ChatInvokeCompletion(
completion=response.choices[0].message.content or '',
usage=usage,
+ stop_reason=response.choices[0].finish_reason if response.choices else None,
)
else:
@@ -341,6 +342,7 @@ class ChatVercel(BaseChatModel):
return ChatInvokeCompletion(
completion=parsed,
usage=usage,
+ stop_reason=response.choices[0].finish_reason if response.choices else None,
)
except RateLimitError as e: