We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38f5beb commit be2d9c6Copy full SHA for be2d9c6
google/genai/_api_client.py
@@ -332,6 +332,10 @@ def __init__(
332
# Initialize the lock. This lock will be used to protect access to the
333
# credentials. This is crucial for thread safety when multiple coroutines
334
# might be accessing the credentials at the same time.
335
+ try:
336
+ asyncio.get_event_loop()
337
+ except RuntimeError:
338
+ asyncio.set_event_loop(asyncio.new_event_loop())
339
self._auth_lock = asyncio.Lock()
340
341
# Handle when to use Vertex AI in express mode (api key).
0 commit comments