chore: add missing toolCallbacks(vargs) to vertex chat options

Signed-off-by: Gareth Evans <gareth@bryncynfelin.co.uk>
This commit is contained in:
Gareth Evans
2025-03-03 16:42:53 +00:00
committed by Christian Tzolov
parent 9e390c11a8
commit beb81ef409

View File

@@ -16,6 +16,7 @@
package org.springframework.ai.vertexai.gemini;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -456,6 +457,12 @@ public class VertexAiGeminiChatOptions implements ToolCallingChatOptions {
return this;
}
public Builder toolCallbacks(FunctionCallback... toolCallbacks) {
Assert.notNull(toolCallbacks, "toolCallbacks cannot be null");
this.options.toolCallbacks.addAll(Arrays.asList(toolCallbacks));
return this;
}
@Deprecated
public Builder functions(Set<String> functionNames) {
return this.toolNames(functionNames);