File tree Expand file tree Collapse file tree
python/semantic_kernel/connectors/ai/google/google_ai/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ def __init__(
119119 if not client :
120120 if google_ai_settings .use_vertexai and not google_ai_settings .cloud_project_id :
121121 raise ServiceInitializationError ("Project ID must be provided when use_vertexai is True." )
122- if not google_ai_settings .api_key :
122+ if not google_ai_settings .use_vertexai and not google_ai_settings . api_key :
123123 raise ServiceInitializationError ("The API key is required when use_vertexai is False." )
124124
125125 super ().__init__ (
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ def __init__(
9090 if not client :
9191 if google_ai_settings .use_vertexai and not google_ai_settings .cloud_project_id :
9292 raise ServiceInitializationError ("Project ID must be provided when use_vertexai is True." )
93- if not google_ai_settings .api_key :
93+ if not google_ai_settings .use_vertexai and not google_ai_settings . api_key :
9494 raise ServiceInitializationError ("The API key is required when use_vertexai is False." )
9595
9696 super ().__init__ (
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ def __init__(
8181 if not client :
8282 if google_ai_settings .use_vertexai and not google_ai_settings .cloud_project_id :
8383 raise ServiceInitializationError ("Project ID must be provided when use_vertexai is True." )
84- if not google_ai_settings .api_key :
84+ if not google_ai_settings .use_vertexai and not google_ai_settings . api_key :
8585 raise ServiceInitializationError ("The API key is required when use_vertexai is False." )
8686
8787 super ().__init__ (
You can’t perform that action at this time.
0 commit comments