diff --git a/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiChatOptions.java b/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiChatOptions.java index 89a18ce06c8..cf54ff90169 100644 --- a/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiChatOptions.java +++ b/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiChatOptions.java @@ -163,7 +163,7 @@ public class OpenAiChatOptions implements FunctionCallingOptions { * the model to call that function. none is the default when no functions are present. auto is the default if * functions are present. Use the {@link ToolChoiceBuilder} to create a tool choice object. */ - private @JsonProperty("tool_choice") String toolChoice; + private @JsonProperty("tool_choice") Object toolChoice; /** * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. */ @@ -418,11 +418,11 @@ public void setTools(List tools) { this.tools = tools; } - public String getToolChoice() { + public Object getToolChoice() { return this.toolChoice; } - public void setToolChoice(String toolChoice) { + public void setToolChoice(Object toolChoice) { this.toolChoice = toolChoice; } @@ -650,7 +650,7 @@ public Builder withTools(List tools) { return this; } - public Builder withToolChoice(String toolChoice) { + public Builder withToolChoice(Object toolChoice) { this.options.toolChoice = toolChoice; return this; }