diff --git a/advisors/spring-ai-advisors-vector-store/src/main/java/org/springframework/ai/chat/client/advisor/vectorstore/VectorStoreChatMemoryAdvisor.java b/advisors/spring-ai-advisors-vector-store/src/main/java/org/springframework/ai/chat/client/advisor/vectorstore/VectorStoreChatMemoryAdvisor.java index 48b538c92d9..c09b9719ff0 100644 --- a/advisors/spring-ai-advisors-vector-store/src/main/java/org/springframework/ai/chat/client/advisor/vectorstore/VectorStoreChatMemoryAdvisor.java +++ b/advisors/spring-ai-advisors-vector-store/src/main/java/org/springframework/ai/chat/client/advisor/vectorstore/VectorStoreChatMemoryAdvisor.java @@ -26,7 +26,6 @@ import org.springframework.ai.chat.client.advisor.AbstractChatMemoryAdvisor; import org.springframework.ai.chat.client.advisor.api.AdvisedRequest; import org.springframework.ai.chat.client.advisor.api.AdvisedResponse; -import org.springframework.ai.chat.client.advisor.api.Advisor; import org.springframework.ai.chat.client.advisor.api.CallAroundAdvisorChain; import org.springframework.ai.chat.client.advisor.api.StreamAroundAdvisorChain; import org.springframework.ai.chat.messages.AssistantMessage; @@ -67,51 +66,6 @@ public class VectorStoreChatMemoryAdvisor extends AbstractChatMemoryAdvisor messages) { - this.messages = messages; - return this; - } - public ChatCompletionRequestBuilder messages(List messages) { this.messages = messages; return this; } - /** - * @deprecated use {@link #system(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withSystem(String system) { - this.system = system; - return this; - } - public ChatCompletionRequestBuilder system(String system) { this.system = system; return this; } - /** - * @deprecated use {@link #maxTokens(Integer)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withMaxTokens(Integer maxTokens) { - this.maxTokens = maxTokens; - return this; - } - public ChatCompletionRequestBuilder maxTokens(Integer maxTokens) { this.maxTokens = maxTokens; return this; } - /** - * @deprecated use {@link #metadata(ChatCompletionRequest.Metadata)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withMetadata(ChatCompletionRequest.Metadata metadata) { - this.metadata = metadata; - return this; - } - public ChatCompletionRequestBuilder metadata(ChatCompletionRequest.Metadata metadata) { this.metadata = metadata; return this; } - /** - * @deprecated use {@link #stopSequences(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withStopSequences(List stopSequences) { - this.stopSequences = stopSequences; - return this; - } - public ChatCompletionRequestBuilder stopSequences(List stopSequences) { this.stopSequences = stopSequences; return this; } - /** - * @deprecated use {@link #stream(Boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withStream(Boolean stream) { - this.stream = stream; - return this; - } - public ChatCompletionRequestBuilder stream(Boolean stream) { this.stream = stream; return this; } - /** - * @deprecated use {@link #temperature(Double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withTemperature(Double temperature) { - this.temperature = temperature; - return this; - } - public ChatCompletionRequestBuilder temperature(Double temperature) { this.temperature = temperature; return this; } - /** - * @deprecated use {@link #topP(Double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withTopP(Double topP) { - this.topP = topP; - return this; - } - public ChatCompletionRequestBuilder topP(Double topP) { this.topP = topP; return this; } - /** - * @deprecated use {@link #topK(Integer)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withTopK(Integer topK) { - this.topK = topK; - return this; - } - public ChatCompletionRequestBuilder topK(Integer topK) { this.topK = topK; return this; } - /** - * @deprecated use {@link #tools(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withTools(List tools) { - this.tools = tools; - return this; - } - public ChatCompletionRequestBuilder tools(List tools) { this.tools = tools; return this; } - /** - * @deprecated use {@link #thinking(ChatCompletionRequest.ThinkingConfig)} - * instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withThinking(ChatCompletionRequest.ThinkingConfig thinking) { - this.thinking = thinking; - return this; - } - public ChatCompletionRequestBuilder thinking(ChatCompletionRequest.ThinkingConfig thinking) { this.thinking = thinking; return this; } - /** - * @deprecated use {@link #thinking(ThinkingType, Integer)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M6") - public ChatCompletionRequestBuilder withThinking(ThinkingType type, Integer budgetTokens) { - this.thinking = new ChatCompletionRequest.ThinkingConfig(type, budgetTokens); - return this; - } - public ChatCompletionRequestBuilder thinking(ThinkingType type, Integer budgetTokens) { this.thinking = new ChatCompletionRequest.ThinkingConfig(type, budgetTokens); return this; diff --git a/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/BedrockProxyChatModelIT.java b/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/BedrockProxyChatModelIT.java index 731eec5498d..86ef360e22d 100644 --- a/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/BedrockProxyChatModelIT.java +++ b/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/BedrockProxyChatModelIT.java @@ -244,31 +244,6 @@ void multiModalityTest() throws IOException { "fruit stand"); } - @Deprecated - @Test - void functionCallTestDeprecated() { - - UserMessage userMessage = new UserMessage( - "What's the weather like in San Francisco, Tokyo and Paris? Return the result in Celsius."); - - List messages = new ArrayList<>(List.of(userMessage)); - - var promptOptions = ToolCallingChatOptions.builder() - .toolCallbacks(List.of(FunctionToolCallback.builder("getCurrentWeather", new MockWeatherService()) - .description( - "Get the weather in location. Return temperature in 36°F or 36°C format. Use multi-turn if needed.") - .inputType(MockWeatherService.Request.class) - .build())) - .build(); - - ChatResponse response = this.chatModel.call(new Prompt(messages, promptOptions)); - - logger.info("Response: {}", response); - - Generation generation = response.getResult(); - assertThat(generation.getOutput().getText()).contains("30", "10", "15"); - } - @Test void functionCallTest() { diff --git a/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/OpenAiChatModelIT.java b/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/OpenAiChatModelIT.java index 5dbd922602c..78d5806d461 100644 --- a/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/OpenAiChatModelIT.java +++ b/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/OpenAiChatModelIT.java @@ -331,31 +331,6 @@ void beanStreamOutputConverterRecords() { assertThat(actorsFilms.movies()).hasSize(5); } - @Test - @Deprecated - void functionCallTestDeprecated() { - - UserMessage userMessage = new UserMessage("What's the weather like in San Francisco, Tokyo, and Paris?"); - - List messages = new ArrayList<>(List.of(userMessage)); - - var promptOptions = OpenAiChatOptions.builder() - .model(OpenAiApi.ChatModel.GPT_4_O.getValue()) - .toolCallbacks(List.of(FunctionToolCallback.builder("getCurrentWeather", new MockWeatherService()) - .description("Get the weather in location") - .inputType(MockWeatherService.Request.class) - .build())) - .build(); - - ChatResponse response = this.chatModel.call(new Prompt(messages, promptOptions)); - - logger.info("Response: {}", response); - - assertThat(response.getResult().getOutput().getText()).containsAnyOf("30.0", "30"); - assertThat(response.getResult().getOutput().getText()).containsAnyOf("10.0", "10"); - assertThat(response.getResult().getOutput().getText()).containsAnyOf("15.0", "15"); - } - @Test void functionCallTest() { 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 2f71b0a4099..50f37ab2c87 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 @@ -417,22 +417,12 @@ public Builder toolCallbacks(ToolCallback... toolCallbacks) { return this; } - @Deprecated - public Builder functions(Set functionNames) { - return this.toolNames(functionNames); - } - public Builder toolNames(Set toolNames) { Assert.notNull(toolNames, "Function names must not be null"); this.options.toolNames = toolNames; return this; } - @Deprecated - public Builder function(String functionName) { - return this.toolName(functionName); - } - public Builder toolName(String toolName) { Assert.hasText(toolName, "Function name must not be empty"); this.options.toolNames.add(toolName); diff --git a/spring-ai-commons/src/main/java/org/springframework/ai/document/Document.java b/spring-ai-commons/src/main/java/org/springframework/ai/document/Document.java index 366480df327..d274592fc50 100644 --- a/spring-ai-commons/src/main/java/org/springframework/ai/document/Document.java +++ b/spring-ai-commons/src/main/java/org/springframework/ai/document/Document.java @@ -247,12 +247,9 @@ public Double getScore() { /** * Returns the content formatter associated with this document. - * @deprecated We are considering getting rid of this, please comment on - * https://github.com/spring-projects/spring-ai/issues/1782 * @return the current ContentFormatter instance used for formatting the document * content. */ - @Deprecated(since = "1.0.0-M4") public ContentFormatter getContentFormatter() { return this.contentFormatter; } diff --git a/spring-ai-vector-store/src/main/java/org/springframework/ai/vectorstore/SimpleVectorStoreContent.java b/spring-ai-vector-store/src/main/java/org/springframework/ai/vectorstore/SimpleVectorStoreContent.java index 28b3ad52b36..4e653310eab 100644 --- a/spring-ai-vector-store/src/main/java/org/springframework/ai/vectorstore/SimpleVectorStoreContent.java +++ b/spring-ai-vector-store/src/main/java/org/springframework/ai/vectorstore/SimpleVectorStoreContent.java @@ -103,19 +103,6 @@ public SimpleVectorStoreContent(String id, String text, Map meta this.embedding = Arrays.copyOf(embedding, embedding.length); } - /** - * Creates a new instance with an updated embedding vector. - * @param embedding the new embedding vector, must not be null - * @return a new instance with the updated embedding - * @throws IllegalArgumentException if embedding is null or empty - */ - @Deprecated(forRemoval = true, since = "1.0.0-M7") - public SimpleVectorStoreContent withEmbedding(float[] embedding) { - Assert.notNull(embedding, "embedding must not be null"); - Assert.isTrue(embedding.length > 0, "embedding vector must not be empty"); - return new SimpleVectorStoreContent(this.id, this.text, this.metadata, embedding); - } - public String getId() { return this.id; }