Skip to content

Commit 6d24af9

Browse files
committed
feat(gemini) not null checks on safetySettings
1 parent caca2be commit 6d24af9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

models/spring-ai-vertex-ai-gemini/src/main/java/org/springframework/ai/vertexai/gemini/VertexAiGeminiChatOptions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ public List<SafetySetting> getSafetySettings() {
279279
}
280280

281281
public void setSafetySettings(List<SafetySetting> safetySettings) {
282+
Assert.notNull(safetySettings, "safetySettings must not be null");
282283
this.safetySettings = safetySettings;
283284
}
284285

@@ -422,6 +423,7 @@ public Builder withGoogleSearchRetrieval(boolean googleSearch) {
422423
}
423424

424425
public Builder withSafetySettings(List<SafetySetting> safetySettings) {
426+
Assert.notNull(safetySettings, "safetySettings must not be null");
425427
this.options.safetySettings = safetySettings;
426428
return this;
427429
}

0 commit comments

Comments
 (0)