Skip to content

Commit beb81ef

Browse files
garethjevanstzolov
authored andcommitted
chore: add missing toolCallbacks(vargs) to vertex chat options
Signed-off-by: Gareth Evans <[email protected]>
1 parent 9e390c1 commit beb81ef

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.ai.vertexai.gemini;
1818

19+
import java.util.Arrays;
1920
import java.util.ArrayList;
2021
import java.util.HashMap;
2122
import java.util.HashSet;
@@ -456,6 +457,12 @@ public Builder toolCallbacks(List<FunctionCallback> toolCallbacks) {
456457
return this;
457458
}
458459

460+
public Builder toolCallbacks(FunctionCallback... toolCallbacks) {
461+
Assert.notNull(toolCallbacks, "toolCallbacks cannot be null");
462+
this.options.toolCallbacks.addAll(Arrays.asList(toolCallbacks));
463+
return this;
464+
}
465+
459466
@Deprecated
460467
public Builder functions(Set<String> functionNames) {
461468
return this.toolNames(functionNames);

0 commit comments

Comments
 (0)