Skip to content

Commit 8cd72af

Browse files
author
Milder Hernandez Cagua
committed
Fixes
1 parent bc61886 commit 8cd72af

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

aiservices/openai/src/main/java/com/microsoft/semantickernel/aiservices/openai/chatcompletion/OpenAIToolCallConfig.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import com.azure.ai.openai.models.ChatCompletionsToolDefinition;
44
import com.azure.ai.openai.models.ChatCompletionsToolSelection;
55
import com.microsoft.semantickernel.functionchoice.FunctionChoiceBehaviorOptions;
6+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
67

78
import javax.annotation.Nullable;
9+
import java.util.Collections;
810
import java.util.List;
911

1012
public class OpenAIToolCallConfig {
@@ -21,6 +23,7 @@ public class OpenAIToolCallConfig {
2123
* @param autoInvoke Indicates whether to automatically invoke the tool.
2224
* @param options Additional options for function choice behavior.
2325
*/
26+
@SuppressFBWarnings("EI_EXPOSE_REP2")
2427
public OpenAIToolCallConfig(
2528
List<ChatCompletionsToolDefinition> tools,
2629
ChatCompletionsToolSelection toolChoice,
@@ -38,7 +41,7 @@ public OpenAIToolCallConfig(
3841
* @return The list of tools.
3942
*/
4043
public List<ChatCompletionsToolDefinition> getTools() {
41-
return tools;
44+
return Collections.unmodifiableList(tools);
4245
}
4346

4447
/**

semantickernel-api/src/main/java/com/microsoft/semantickernel/functionchoice/FunctionChoiceBehavior.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public abstract class FunctionChoiceBehavior {
1919
protected final List<KernelFunction<?>> functions;
2020
protected final FunctionChoiceBehaviorOptions options;
2121

22-
protected FunctionChoiceBehavior(List<KernelFunction<?>> functions,
22+
protected FunctionChoiceBehavior(@Nullable List<KernelFunction<?>> functions,
2323
@Nullable FunctionChoiceBehaviorOptions options) {
2424
this.functions = functions != null ? Collections.unmodifiableList(functions) : null;
2525
this.fullFunctionNames = new HashSet<>();

0 commit comments

Comments
 (0)