You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-03-30 10:57:20 -07:00
chore: Defer import of google.cloud.storage in GCSArtifactService
The `google.cloud.storage` module is now imported within the `__init__` method of `GCSArtifactService`, rather than at the top level. This avoids importing the potentially heavy `storage` module unless an instance of `GCSArtifactService` is actually created. Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 831124463
This commit is contained in:
committed by
Copybara-Service
parent
22ca7eefc0
commit
999af55880
@@ -27,7 +27,6 @@ import logging
|
||||
from typing import Any
|
||||
from typing import Optional
|
||||
|
||||
from google.cloud import storage
|
||||
from google.genai import types
|
||||
from typing_extensions import override
|
||||
|
||||
@@ -47,6 +46,8 @@ class GcsArtifactService(BaseArtifactService):
|
||||
bucket_name: The name of the bucket to use.
|
||||
**kwargs: Keyword arguments to pass to the Google Cloud Storage client.
|
||||
"""
|
||||
from google.cloud import storage
|
||||
|
||||
self.bucket_name = bucket_name
|
||||
self.storage_client = storage.Client(**kwargs)
|
||||
self.bucket = self.storage_client.bucket(self.bucket_name)
|
||||
|
||||
Reference in New Issue
Block a user