diff --git a/models/spring-ai-azure-openai/src/main/java/org/springframework/ai/azure/openai/AzureOpenAiChatOptions.java b/models/spring-ai-azure-openai/src/main/java/org/springframework/ai/azure/openai/AzureOpenAiChatOptions.java index f890f1266ab..fd909231410 100644 --- a/models/spring-ai-azure-openai/src/main/java/org/springframework/ai/azure/openai/AzureOpenAiChatOptions.java +++ b/models/spring-ai-azure-openai/src/main/java/org/springframework/ai/azure/openai/AzureOpenAiChatOptions.java @@ -22,18 +22,17 @@ import java.util.Map; import java.util.Set; +import org.springframework.ai.chat.prompt.ChatOptions; +import org.springframework.ai.model.function.FunctionCallback; +import org.springframework.ai.model.function.FunctionCallingOptions; +import org.springframework.util.Assert; + import com.azure.ai.openai.models.AzureChatEnhancementConfiguration; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import org.springframework.ai.chat.prompt.ChatOptions; -import org.springframework.ai.model.function.FunctionCallback; -import org.springframework.ai.model.function.FunctionCallingOptions; -import org.springframework.boot.context.properties.NestedConfigurationProperty; -import org.springframework.util.Assert; - /** * The configuration information for a chat completions request. Completions support a * wide variety of tasks and generate text that continues from or "completes" provided @@ -145,7 +144,6 @@ public class AzureOpenAiChatOptions implements FunctionCallingOptions, ChatOptio * default. Use the enableFunctions to set the functions from the registry to be used * by the ChatModel chat completion requests. */ - @NestedConfigurationProperty @JsonIgnore private List functionCallbacks = new ArrayList<>(); @@ -160,7 +158,6 @@ public class AzureOpenAiChatOptions implements FunctionCallingOptions, ChatOptio * functions is set in a prompt options, then the enabled functions are only active * for the duration of this prompt execution. */ - @NestedConfigurationProperty @JsonIgnore private Set functions = new HashSet<>(); @@ -194,11 +191,9 @@ public class AzureOpenAiChatOptions implements FunctionCallingOptions, ChatOptio * If provided, the configuration options for available Azure OpenAI chat * enhancements. */ - @NestedConfigurationProperty @JsonIgnore private AzureChatEnhancementConfiguration enhancements; - @NestedConfigurationProperty @JsonIgnore private Map toolContext; diff --git a/models/spring-ai-minimax/src/main/java/org/springframework/ai/minimax/MiniMaxChatOptions.java b/models/spring-ai-minimax/src/main/java/org/springframework/ai/minimax/MiniMaxChatOptions.java index 0e10ca20e7f..9ea03bae576 100644 --- a/models/spring-ai-minimax/src/main/java/org/springframework/ai/minimax/MiniMaxChatOptions.java +++ b/models/spring-ai-minimax/src/main/java/org/springframework/ai/minimax/MiniMaxChatOptions.java @@ -31,7 +31,6 @@ import org.springframework.ai.minimax.api.MiniMaxApi; import org.springframework.ai.model.function.FunctionCallback; import org.springframework.ai.model.function.FunctionCallingOptions; -import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.util.Assert; /** @@ -88,7 +87,6 @@ public class MiniMaxChatOptions implements FunctionCallingOptions, ChatOptions { /** * Up to 4 sequences where the API will stop generating further tokens. */ - @NestedConfigurationProperty private @JsonProperty("stop") List stop; /** * What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output @@ -112,7 +110,6 @@ public class MiniMaxChatOptions implements FunctionCallingOptions, ChatOptions { * A list of tools the model may call. Currently, only functions are supported as a tool. Use this to * provide a list of functions the model may generate JSON inputs for. */ - @NestedConfigurationProperty private @JsonProperty("tools") List tools; /** * Controls which (if any) function is called by the model. none means the model will not call a @@ -129,7 +126,6 @@ public class MiniMaxChatOptions implements FunctionCallingOptions, ChatOptions { * For Default Options the functionCallbacks are registered but disabled by default. Use the enableFunctions to set the functions * from the registry to be used by the ChatModel chat completion requests. */ - @NestedConfigurationProperty @JsonIgnore private List functionCallbacks = new ArrayList<>(); @@ -142,14 +138,12 @@ public class MiniMaxChatOptions implements FunctionCallingOptions, ChatOptions { * Note that function enabled with the default options are enabled for all chat completion requests. This could impact the token count and the billing. * If the functions is set in a prompt options, then the enabled functions are only active for the duration of this prompt execution. */ - @NestedConfigurationProperty @JsonIgnore private Set functions = new HashSet<>(); @JsonIgnore private Boolean proxyToolCalls; - @NestedConfigurationProperty @JsonIgnore private Map toolContext; diff --git a/models/spring-ai-minimax/src/main/java/org/springframework/ai/minimax/api/MiniMaxApi.java b/models/spring-ai-minimax/src/main/java/org/springframework/ai/minimax/api/MiniMaxApi.java index 3216f694056..6757b3c3da5 100644 --- a/models/spring-ai-minimax/src/main/java/org/springframework/ai/minimax/api/MiniMaxApi.java +++ b/models/spring-ai-minimax/src/main/java/org/springframework/ai/minimax/api/MiniMaxApi.java @@ -32,7 +32,6 @@ import org.springframework.ai.model.ChatModelDescription; import org.springframework.ai.model.ModelOptionsUtils; import org.springframework.ai.retry.RetryUtils; -import org.springframework.boot.context.properties.bind.ConstructorBinding; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; @@ -339,7 +338,6 @@ public record FunctionTool( * Create a tool of type 'function' and the given function definition. * @param function function definition. */ - @ConstructorBinding public FunctionTool(Function function) { this(Type.FUNCTION, function); } @@ -381,7 +379,6 @@ public record Function( * @param name tool function name. * @param parameters tool function schema. */ - @ConstructorBinding public Function(String description, String name, Map parameters) { this(description, name, ModelOptionsUtils.toJsonString(parameters)); } diff --git a/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatOptions.java b/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatOptions.java index d256265bd43..f8f080a8253 100644 --- a/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatOptions.java +++ b/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatOptions.java @@ -34,7 +34,6 @@ import org.springframework.ai.mistralai.api.MistralAiApi.FunctionTool; import org.springframework.ai.model.function.FunctionCallback; import org.springframework.ai.model.function.FunctionCallingOptions; -import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.util.Assert; /** @@ -94,7 +93,6 @@ public class MistralAiChatOptions implements FunctionCallingOptions, ChatOptions * Stop generation if this token is detected. Or if one of these tokens is detected * when providing an array. */ - @NestedConfigurationProperty private @JsonProperty("stop") List stop; /** @@ -102,7 +100,6 @@ public class MistralAiChatOptions implements FunctionCallingOptions, ChatOptions * tool. Use this to provide a list of functions the model may generate JSON inputs * for. */ - @NestedConfigurationProperty private @JsonProperty("tools") List tools; /** @@ -110,7 +107,6 @@ public class MistralAiChatOptions implements FunctionCallingOptions, ChatOptions * not call a function and instead generates a message. auto means the model can pick * between generating a message or calling a function. */ - @NestedConfigurationProperty private @JsonProperty("tool_choice") ToolChoice toolChoice; /** @@ -120,7 +116,6 @@ public class MistralAiChatOptions implements FunctionCallingOptions, ChatOptions * disabled by default. Use the enableFunctions to set the functions from the registry * to be used by the ChatModel chat completion requests. */ - @NestedConfigurationProperty @JsonIgnore private List functionCallbacks = new ArrayList<>(); @@ -135,14 +130,12 @@ public class MistralAiChatOptions implements FunctionCallingOptions, ChatOptions * functions is set in a prompt options, then the enabled functions are only active * for the duration of this prompt execution. */ - @NestedConfigurationProperty @JsonIgnore private Set functions = new HashSet<>(); @JsonIgnore private Boolean proxyToolCalls; - @NestedConfigurationProperty @JsonIgnore private Map toolContext; diff --git a/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/api/MistralAiApi.java b/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/api/MistralAiApi.java index 41277a0c07f..273ba6663aa 100644 --- a/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/api/MistralAiApi.java +++ b/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/api/MistralAiApi.java @@ -34,7 +34,6 @@ import org.springframework.ai.model.ModelOptionsUtils; import org.springframework.ai.observation.conventions.AiProvider; import org.springframework.ai.retry.RetryUtils; -import org.springframework.boot.context.properties.bind.ConstructorBinding; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; @@ -324,7 +323,6 @@ public record FunctionTool(@JsonProperty("type") Type type, @JsonProperty("funct * Create a tool of type 'function' and the given function definition. * @param function function definition. */ - @ConstructorBinding public FunctionTool(Function function) { this(Type.FUNCTION, function); } @@ -362,7 +360,6 @@ public record Function(@JsonProperty("description") String description, @JsonPro * @param name tool function name. * @param jsonSchema tool function schema as json. */ - @ConstructorBinding public Function(String description, String name, String jsonSchema) { this(description, name, ModelOptionsUtils.jsonToMap(jsonSchema)); } diff --git a/models/spring-ai-moonshot/src/main/java/org/springframework/ai/moonshot/MoonshotChatOptions.java b/models/spring-ai-moonshot/src/main/java/org/springframework/ai/moonshot/MoonshotChatOptions.java index e5bae8560ab..9d4344b5341 100644 --- a/models/spring-ai-moonshot/src/main/java/org/springframework/ai/moonshot/MoonshotChatOptions.java +++ b/models/spring-ai-moonshot/src/main/java/org/springframework/ai/moonshot/MoonshotChatOptions.java @@ -30,7 +30,6 @@ import org.springframework.ai.model.function.FunctionCallback; import org.springframework.ai.model.function.FunctionCallingOptions; import org.springframework.ai.moonshot.api.MoonshotApi; -import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.util.Assert; /** @@ -90,10 +89,8 @@ public class MoonshotChatOptions implements FunctionCallingOptions, ChatOptions /** * Up to 5 sequences where the API will stop generating further tokens. */ - @NestedConfigurationProperty private @JsonProperty("stop") List stop; - @NestedConfigurationProperty private @JsonProperty("tools") List tools; /** @@ -115,7 +112,6 @@ public class MoonshotChatOptions implements FunctionCallingOptions, ChatOptions * default. Use the enableFunctions to set the functions from the registry to be used * by the ChatModel chat completion requests. */ - @NestedConfigurationProperty @JsonIgnore private List functionCallbacks = new ArrayList<>(); @@ -130,7 +126,6 @@ public class MoonshotChatOptions implements FunctionCallingOptions, ChatOptions * functions is set in a prompt options, then the enabled functions are only active * for the duration of this prompt execution. */ - @NestedConfigurationProperty @JsonIgnore private Set functions = new HashSet<>(); @@ -143,7 +138,6 @@ public class MoonshotChatOptions implements FunctionCallingOptions, ChatOptions @JsonIgnore private Boolean proxyToolCalls; - @NestedConfigurationProperty @JsonIgnore private Map toolContext; diff --git a/models/spring-ai-moonshot/src/main/java/org/springframework/ai/moonshot/api/MoonshotApi.java b/models/spring-ai-moonshot/src/main/java/org/springframework/ai/moonshot/api/MoonshotApi.java index f6eb1c476c7..57222d571c3 100644 --- a/models/spring-ai-moonshot/src/main/java/org/springframework/ai/moonshot/api/MoonshotApi.java +++ b/models/spring-ai-moonshot/src/main/java/org/springframework/ai/moonshot/api/MoonshotApi.java @@ -31,7 +31,6 @@ import org.springframework.ai.model.ChatModelDescription; import org.springframework.ai.model.ModelOptionsUtils; import org.springframework.ai.retry.RetryUtils; -import org.springframework.boot.context.properties.bind.ConstructorBinding; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -600,7 +599,6 @@ public record FunctionTool(@JsonProperty("type") Type type, @JsonProperty("funct * Create a tool of type 'function' and the given function definition. * @param function function definition. */ - @ConstructorBinding public FunctionTool(Function function) { this(Type.FUNCTION, function); } @@ -638,7 +636,6 @@ public record Function(@JsonProperty("description") String description, @JsonPro * @param name tool function name. * @param jsonSchema tool function schema as json. */ - @ConstructorBinding public Function(String description, String name, String jsonSchema) { this(description, name, ModelOptionsUtils.jsonToMap(jsonSchema)); } diff --git a/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaApi.java b/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaApi.java index bbd32c5117b..06a712806b4 100644 --- a/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaApi.java +++ b/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaApi.java @@ -34,7 +34,6 @@ import org.springframework.ai.model.ModelOptionsUtils; import org.springframework.ai.observation.conventions.AiProvider; -import org.springframework.boot.context.properties.bind.ConstructorBinding; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; @@ -654,7 +653,6 @@ public record Tool( * Create a tool of type 'function' and the given function definition. * @param function function definition. */ - @ConstructorBinding public Tool(Function function) { this(Type.FUNCTION, function); } @@ -690,7 +688,6 @@ public record Function( * @param name tool function name. * @param jsonSchema tool function schema as json. */ - @ConstructorBinding public Function(String description, String name, String jsonSchema) { this(description, name, ModelOptionsUtils.jsonToMap(jsonSchema)); } diff --git a/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaOptions.java b/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaOptions.java index 034a4b75c66..863ede3f4e0 100644 --- a/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaOptions.java +++ b/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaOptions.java @@ -34,7 +34,6 @@ import org.springframework.ai.model.ModelOptionsUtils; import org.springframework.ai.model.function.FunctionCallback; import org.springframework.ai.model.function.FunctionCallingOptions; -import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.util.Assert; /** @@ -280,7 +279,6 @@ public class OllamaOptions implements FunctionCallingOptions, ChatOptions, Embed * For Default Options the functionCallbacks are registered but disabled by default. Use the enableFunctions to set the functions * from the registry to be used by the ChatModel chat completion requests. */ - @NestedConfigurationProperty @JsonIgnore private List functionCallbacks = new ArrayList<>(); @@ -292,14 +290,12 @@ public class OllamaOptions implements FunctionCallingOptions, ChatOptions, Embed * Note that function enabled with the default options are enabled for all chat completion requests. This could impact the token count and the billing. * If the functions is set in a prompt options, then the enabled functions are only active for the duration of this prompt execution. */ - @NestedConfigurationProperty @JsonIgnore private Set functions = new HashSet<>(); @JsonIgnore private Boolean proxyToolCalls; - @NestedConfigurationProperty @JsonIgnore private Map toolContext; diff --git a/models/spring-ai-openai/pom.xml b/models/spring-ai-openai/pom.xml index b059ccff986..c4ec80eeaef 100644 --- a/models/spring-ai-openai/pom.xml +++ b/models/spring-ai-openai/pom.xml @@ -51,12 +51,6 @@ ${project.parent.version} - - - org.springframework.boot - spring-boot - - io.rest-assured json-path 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 b79b009d9e0..905071bf90b 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 @@ -38,7 +38,6 @@ import org.springframework.ai.openai.api.OpenAiApi.ChatCompletionRequest.StreamOptions; import org.springframework.ai.openai.api.OpenAiApi.ChatCompletionRequest.ToolChoiceBuilder; import org.springframework.ai.openai.api.OpenAiApi.FunctionTool; -import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.util.Assert; /** @@ -117,7 +116,6 @@ public class OpenAiChatOptions implements FunctionCallingOptions, ChatOptions { /** * Up to 4 sequences where the API will stop generating further tokens. */ - @NestedConfigurationProperty private @JsonProperty("stop") List stop; /** * What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output @@ -135,7 +133,6 @@ public class OpenAiChatOptions implements FunctionCallingOptions, ChatOptions { * A list of tools the model may call. Currently, only functions are supported as a tool. Use this to * provide a list of functions the model may generate JSON inputs for. */ - @NestedConfigurationProperty private @JsonProperty("tools") List tools; /** * Controls which (if any) function is called by the model. none means the model will not call a @@ -161,7 +158,6 @@ public class OpenAiChatOptions implements FunctionCallingOptions, ChatOptions { * For Default Options the functionCallbacks are registered but disabled by default. Use the enableFunctions to set the functions * from the registry to be used by the ChatModel chat completion requests. */ - @NestedConfigurationProperty @JsonIgnore private List functionCallbacks = new ArrayList<>(); @@ -174,7 +170,6 @@ public class OpenAiChatOptions implements FunctionCallingOptions, ChatOptions { * Note that function enabled with the default options are enabled for all chat completion requests. This could impact the token count and the billing. * If the functions is set in a prompt options, then the enabled functions are only active for the duration of this prompt execution. */ - @NestedConfigurationProperty @JsonIgnore private Set functions = new HashSet<>(); @@ -189,11 +184,9 @@ public class OpenAiChatOptions implements FunctionCallingOptions, ChatOptions { /** * Optional HTTP headers to be added to the chat completion request. */ - @NestedConfigurationProperty @JsonIgnore private Map httpHeaders = new HashMap<>(); - @NestedConfigurationProperty @JsonIgnore private Map toolContext; diff --git a/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiApi.java b/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiApi.java index b4dd95d29fe..1fb3a53fa8d 100644 --- a/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiApi.java +++ b/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiApi.java @@ -32,7 +32,6 @@ import org.springframework.ai.model.ModelOptionsUtils; import org.springframework.ai.openai.api.common.OpenAiApiConstants; import org.springframework.ai.retry.RetryUtils; -import org.springframework.boot.context.properties.bind.ConstructorBinding; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; @@ -546,7 +545,6 @@ public record FunctionTool(// @formatter:off * Create a tool of type 'function' and the given function definition. * @param function function definition. */ - @ConstructorBinding public FunctionTool(Function function) { this(Type.FUNCTION, function); } @@ -583,7 +581,6 @@ public record Function( * @param name tool function name. * @param jsonSchema tool function schema as json. */ - @ConstructorBinding public Function(String description, String name, String jsonSchema) { this(description, name, ModelOptionsUtils.jsonToMap(jsonSchema)); } @@ -792,7 +789,6 @@ public ResponseFormat(Type type, String schema) { this(type, "custom_schema", schema, true); } - @ConstructorBinding public ResponseFormat(Type type, String name, String schema, Boolean strict) { this(type, StringUtils.hasText(schema)? new JsonSchema(name, schema, strict): null); } diff --git a/models/spring-ai-qianfan/src/main/java/org/springframework/ai/qianfan/QianFanChatOptions.java b/models/spring-ai-qianfan/src/main/java/org/springframework/ai/qianfan/QianFanChatOptions.java index 24bff760bc9..29a6b72c448 100644 --- a/models/spring-ai-qianfan/src/main/java/org/springframework/ai/qianfan/QianFanChatOptions.java +++ b/models/spring-ai-qianfan/src/main/java/org/springframework/ai/qianfan/QianFanChatOptions.java @@ -25,7 +25,6 @@ import org.springframework.ai.chat.prompt.ChatOptions; import org.springframework.ai.qianfan.api.QianFanApi; -import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * QianFanChatOptions represents the options for performing chat completion using the @@ -67,7 +66,6 @@ public class QianFanChatOptions implements ChatOptions { /** * Up to 4 sequences where the API will stop generating further tokens. */ - @NestedConfigurationProperty private @JsonProperty("stop") List stop; /** * What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output diff --git a/models/spring-ai-vertex-ai-gemini/src/main/java/org/springframework/ai/vertexai/gemini/VertexAiGeminiChatOptions.java b/models/spring-ai-vertex-ai-gemini/src/main/java/org/springframework/ai/vertexai/gemini/VertexAiGeminiChatOptions.java index 574574a75eb..f001c131e30 100644 --- a/models/spring-ai-vertex-ai-gemini/src/main/java/org/springframework/ai/vertexai/gemini/VertexAiGeminiChatOptions.java +++ b/models/spring-ai-vertex-ai-gemini/src/main/java/org/springframework/ai/vertexai/gemini/VertexAiGeminiChatOptions.java @@ -32,7 +32,6 @@ import org.springframework.ai.model.function.FunctionCallback; import org.springframework.ai.model.function.FunctionCallingOptions; import org.springframework.ai.vertexai.gemini.VertexAiGeminiChatModel.ChatModel; -import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.util.Assert; /** @@ -96,7 +95,6 @@ public class VertexAiGeminiChatOptions implements FunctionCallingOptions, ChatOp * For Default Options the functionCallbacks are registered but disabled by default. Use the enableFunctions to set the functions * from the registry to be used by the ChatModel chat completion requests. */ - @NestedConfigurationProperty @JsonIgnore private List functionCallbacks = new ArrayList<>(); @@ -109,7 +107,6 @@ public class VertexAiGeminiChatOptions implements FunctionCallingOptions, ChatOp * Note that function enabled with the default options are enabled for all chat completion requests. This could impact the token count and the billing. * If the functions is set in a prompt options, then the enabled functions are only active for the duration of this prompt execution. */ - @NestedConfigurationProperty @JsonIgnore private Set functions = new HashSet<>(); @@ -122,7 +119,6 @@ public class VertexAiGeminiChatOptions implements FunctionCallingOptions, ChatOp @JsonIgnore private Boolean proxyToolCalls; - @NestedConfigurationProperty @JsonIgnore private Map toolContext; diff --git a/models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai/ZhiPuAiChatOptions.java b/models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai/ZhiPuAiChatOptions.java index c0c66253a41..e37ab4465ab 100644 --- a/models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai/ZhiPuAiChatOptions.java +++ b/models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai/ZhiPuAiChatOptions.java @@ -32,7 +32,6 @@ import org.springframework.ai.model.function.FunctionCallingOptions; import org.springframework.ai.zhipuai.api.ZhiPuAiApi; import org.springframework.ai.zhipuai.api.ZhiPuAiApi.FunctionTool; -import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.util.Assert; /** @@ -58,7 +57,6 @@ public class ZhiPuAiChatOptions implements FunctionCallingOptions, ChatOptions { /** * The model will stop generating characters specified by stop, and currently only supports a single stop word in the format of ["stop_word1"]. */ - @NestedConfigurationProperty private @JsonProperty("stop") List stop; /** * What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output @@ -76,7 +74,6 @@ public class ZhiPuAiChatOptions implements FunctionCallingOptions, ChatOptions { * A list of tools the model may call. Currently, only functions are supported as a tool. Use this to * provide a list of functions the model may generate JSON inputs for. */ - @NestedConfigurationProperty private @JsonProperty("tools") List tools; /** * Controls which (if any) function is called by the model. none means the model will not call a @@ -110,7 +107,6 @@ public class ZhiPuAiChatOptions implements FunctionCallingOptions, ChatOptions { * For Default Options the functionCallbacks are registered but disabled by default. Use the enableFunctions to set the functions * from the registry to be used by the ChatModel chat completion requests. */ - @NestedConfigurationProperty @JsonIgnore private List functionCallbacks = new ArrayList<>(); @@ -123,14 +119,12 @@ public class ZhiPuAiChatOptions implements FunctionCallingOptions, ChatOptions { * Note that function enabled with the default options are enabled for all chat completion requests. This could impact the token count and the billing. * If the functions is set in a prompt options, then the enabled functions are only active for the duration of this prompt execution. */ - @NestedConfigurationProperty @JsonIgnore private Set functions = new HashSet<>(); @JsonIgnore private Boolean proxyToolCalls; - @NestedConfigurationProperty @JsonIgnore private Map toolContext; // @formatter:on diff --git a/models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai/api/ZhiPuAiApi.java b/models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai/api/ZhiPuAiApi.java index 2be99709d4f..a7bce9ac8b7 100644 --- a/models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai/api/ZhiPuAiApi.java +++ b/models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai/api/ZhiPuAiApi.java @@ -33,7 +33,6 @@ import org.springframework.ai.model.ChatModelDescription; import org.springframework.ai.model.ModelOptionsUtils; import org.springframework.ai.retry.RetryUtils; -import org.springframework.boot.context.properties.bind.ConstructorBinding; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; @@ -322,7 +321,6 @@ public record FunctionTool( * Create a tool of type 'function' and the given function definition. * @param function function definition. */ - @ConstructorBinding public FunctionTool(Function function) { this(Type.FUNCTION, function); } @@ -359,7 +357,6 @@ public record Function( * @param name tool function name. * @param jsonSchema tool function schema as json. */ - @ConstructorBinding public Function(String description, String name, String jsonSchema) { this(description, name, ModelOptionsUtils.jsonToMap(jsonSchema)); } diff --git a/spring-ai-core/pom.xml b/spring-ai-core/pom.xml index 8322b5f665c..7d708a87bfb 100644 --- a/spring-ai-core/pom.xml +++ b/spring-ai-core/pom.xml @@ -59,6 +59,12 @@ org.springframework.cloud spring-cloud-function-context ${spring-cloud-function-context.version} + + + org.springframework.boot + spring-boot-autoconfigure + + diff --git a/spring-ai-spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-ai-spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 00000000000..392f16117b5 --- /dev/null +++ b/spring-ai-spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,28 @@ +{ + "groups": [ + { + "name": "spring.ai.azure.openai.chat.options.enhancements", + "type": "com.azure.ai.openai.models.AzureChatEnhancementConfiguration", + "sourceType": "org.springframework.ai.azure.openai.AzureOpenAiChatOptions", + "sourceMethod": "getEnhancements()" + }, + { + "name": "spring.ai.mistralai.chat.options.tool-choice", + "type": "org.springframework.ai.mistralai.api.MistralAiApi$ChatCompletionRequest$ToolChoice", + "sourceType": "org.springframework.ai.mistralai.MistralAiChatOptions" + } + ], + "properties": [ + { + "name": "spring.ai.azure.openai.chat.options.enhancements.grounding", + "type": "com.azure.ai.openai.models.AzureChatGroundingEnhancementConfiguration", + "sourceType": "com.azure.ai.openai.models.AzureChatEnhancementConfiguration" + }, + { + "name": "spring.ai.azure.openai.chat.options.enhancements.ocr", + "type": "com.azure.ai.openai.models.AzureChatOCREnhancementConfiguration", + "sourceType": "com.azure.ai.openai.models.AzureChatEnhancementConfiguration" + } + ], + "hints": [] +}