mirror of
https://github.com/browser-use/browser-use
synced 2026-05-13 17:56:35 +02:00
Creating a reusable client
Gemini suggestion - creating a reusable client Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -77,8 +77,10 @@ class ChatOpenRouter(BaseChatModel):
|
||||
Returns:
|
||||
AsyncOpenAI: An instance of the AsyncOpenAI client with OpenRouter base URL.
|
||||
"""
|
||||
client_params = self._get_client_params()
|
||||
return AsyncOpenAI(**client_params)
|
||||
if not hasattr(self, '_client'):
|
||||
client_params = self._get_client_params()
|
||||
self._client = AsyncOpenAI(**client_params)
|
||||
return self._client
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
|
||||
Reference in New Issue
Block a user