You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/google/genai/Client.java
+6-10Lines changed: 6 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -227,7 +227,8 @@ private Client(
227
227
228
228
if (enterprise.isPresent() && vertexAI.isPresent() && !enterprise.get().equals(vertexAI.get())) {
229
229
thrownewIllegalArgumentException(
230
-
"enterprise and vertexAI flags have conflicting values, please set enterprise value only.");
230
+
"enterprise and vertexAI flags have conflicting values, please set enterprise value"
231
+
+ " only.");
231
232
}
232
233
233
234
booleanuseVertexAI;
@@ -245,7 +246,8 @@ private Client(
245
246
246
247
if (enterpriseEnvPresent && vertexEnvPresent && !enterpriseEnv.equalsIgnoreCase(vertexEnv)) {
247
248
logger.warning(
248
-
"Warning: Both GOOGLE_GENAI_USE_ENTERPRISE and GOOGLE_GENAI_USE_VERTEXAI are set with conflicting values. The value of GOOGLE_GENAI_USE_ENTERPRISE will be used.");
249
+
"Warning: Both GOOGLE_GENAI_USE_ENTERPRISE and GOOGLE_GENAI_USE_VERTEXAI are set with"
250
+
+ " conflicting values. The value of GOOGLE_GENAI_USE_ENTERPRISE will be used.");
249
251
}
250
252
251
253
if (enterpriseEnvPresent) {
@@ -257,14 +259,8 @@ private Client(
257
259
}
258
260
}
259
261
260
-
if (project.isPresent() || location.isPresent()) {
261
-
if (apiKey.isPresent()) {
262
-
thrownewIllegalArgumentException(
263
-
"Project/location and API key are mutually exclusive in the client initializer.");
264
-
}
265
-
if (!useVertexAI) {
266
-
thrownewIllegalArgumentException("Gemini API do not support project/location.");
267
-
}
262
+
if ((project.isPresent() || location.isPresent()) && !useVertexAI) {
263
+
thrownewIllegalArgumentException("Gemini API does not support project/location.");
0 commit comments