Skip to content
Merged
Prev Previous commit
Next Next commit
Fixes
  • Loading branch information
Milder Hernandez Cagua
Milder Hernandez Cagua committed Apr 29, 2025
commit 8cd72afadf25ca5ec31458707c0f42f78c0fdb4f
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import com.azure.ai.openai.models.ChatCompletionsToolDefinition;
import com.azure.ai.openai.models.ChatCompletionsToolSelection;
import com.microsoft.semantickernel.functionchoice.FunctionChoiceBehaviorOptions;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;

public class OpenAIToolCallConfig {
Expand All @@ -21,6 +23,7 @@ public class OpenAIToolCallConfig {
* @param autoInvoke Indicates whether to automatically invoke the tool.
* @param options Additional options for function choice behavior.
*/
@SuppressFBWarnings("EI_EXPOSE_REP2")
public OpenAIToolCallConfig(
List<ChatCompletionsToolDefinition> tools,
ChatCompletionsToolSelection toolChoice,
Expand All @@ -38,7 +41,7 @@ public OpenAIToolCallConfig(
* @return The list of tools.
*/
public List<ChatCompletionsToolDefinition> getTools() {
return tools;
return Collections.unmodifiableList(tools);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public abstract class FunctionChoiceBehavior {
protected final List<KernelFunction<?>> functions;
protected final FunctionChoiceBehaviorOptions options;

protected FunctionChoiceBehavior(List<KernelFunction<?>> functions,
protected FunctionChoiceBehavior(@Nullable List<KernelFunction<?>> functions,
@Nullable FunctionChoiceBehaviorOptions options) {
this.functions = functions != null ? Collections.unmodifiableList(functions) : null;
this.fullFunctionNames = new HashSet<>();
Expand Down