| 311 | monkeypatch_aiplatform_init(aiplatform, kaggle_kernel_credentials) |
| 312 | |
| 313 | def init_video_intelligence(): |
| 314 | from google.cloud import videointelligence |
| 315 | if not is_user_secrets_token_set(): |
| 316 | return videointelligence |
| 317 | |
| 318 | from kaggle_gcp import get_integrations |
| 319 | if not get_integrations().has_cloudai(): |
| 320 | return videointelligence |
| 321 | |
| 322 | from kaggle_secrets import GcpTarget |
| 323 | kernel_credentials = KaggleKernelCredentials(target=GcpTarget.CLOUDAI) |
| 324 | monkeypatch_client( |
| 325 | videointelligence.VideoIntelligenceServiceClient, |
| 326 | kernel_credentials) |
| 327 | monkeypatch_client( |
| 328 | videointelligence.VideoIntelligenceServiceAsyncClient, |
| 329 | kernel_credentials) |
| 330 | return videointelligence |
| 331 | |
| 332 | def init_vision(): |
| 333 | from google.cloud import vision |