diff --git a/document-readers/markdown-reader/src/test/java/org/springframework/ai/reader/markdown/MarkdownDocumentReaderTest.java b/document-readers/markdown-reader/src/test/java/org/springframework/ai/reader/markdown/MarkdownDocumentReaderTest.java index c06dab67d3b..0ad03edf91c 100644 --- a/document-readers/markdown-reader/src/test/java/org/springframework/ai/reader/markdown/MarkdownDocumentReaderTest.java +++ b/document-readers/markdown-reader/src/test/java/org/springframework/ai/reader/markdown/MarkdownDocumentReaderTest.java @@ -105,7 +105,7 @@ void testDocumentNotDividedViaHorizontalRulesWhenIsDisabled() { Document documentsFirst = documents.get(0); assertThat(documentsFirst.getMetadata()).isEmpty(); - assertThat(documentsFirst.getContent()).startsWith("Lorem ipsum dolor sit amet, consectetur adipiscing elit") + assertThat(documentsFirst.getText()).startsWith("Lorem ipsum dolor sit amet, consectetur adipiscing elit") .endsWith("Phasellus eget tellus sed nibh ornare interdum eu eu mi."); } @@ -119,7 +119,7 @@ void testSimpleMarkdownDocumentWithHardAndSoftLineBreaks() { Document documentsFirst = documents.get(0); assertThat(documentsFirst.getMetadata()).isEmpty(); - assertThat(documentsFirst.getContent()).isEqualTo( + assertThat(documentsFirst.getText()).isEqualTo( "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tincidunt velit non bibendum gravida. Cras accumsan tincidunt ornare. Donec hendrerit consequat tellus blandit accumsan. Aenean aliquam metus at arcu elementum dignissim.Nullam nisi dui, egestas nec sem nec, interdum lobortis enim. Pellentesque odio orci, faucibus eu luctus nec, venenatis et magna. Vestibulum nec eros non felis fermentum posuere eget ac risus.Aenean eu leo eu nibh tristique posuere quis quis massa. Nullam lacinia luctus sem ut vehicula."); } @@ -135,22 +135,22 @@ void testCode() { assertThat(documents).satisfiesExactly(document -> { assertThat(document.getMetadata()).isEqualTo(Map.of()); - assertThat(document.getContent()).isEqualTo("This is a Java sample application:"); + assertThat(document.getText()).isEqualTo("This is a Java sample application:"); }, document -> { assertThat(document.getMetadata()).isEqualTo(Map.of("lang", "java", "category", "code_block")); - assertThat(document.getContent()).startsWith("package com.example.demo;") + assertThat(document.getText()).startsWith("package com.example.demo;") .contains("SpringApplication.run(DemoApplication.class, args);"); }, document -> { assertThat(document.getMetadata()).isEqualTo(Map.of("category", "code_inline")); - assertThat(document.getContent()).isEqualTo( + assertThat(document.getText()).isEqualTo( "Markdown also provides the possibility to use inline code formatting throughout the entire sentence."); }, document -> { assertThat(document.getMetadata()).isEqualTo(Map.of()); - assertThat(document.getContent()) + assertThat(document.getText()) .isEqualTo("Another possibility is to set block code without specific highlighting:"); }, document -> { assertThat(document.getMetadata()).isEqualTo(Map.of("lang", "", "category", "code_block")); - assertThat(document.getContent()).isEqualTo("./mvnw spring-javaformat:apply\n"); + assertThat(document.getText()).isEqualTo("./mvnw spring-javaformat:apply\n"); }); } @@ -167,15 +167,15 @@ void testCodeWhenCodeBlockShouldNotBeSeparatedDocument() { assertThat(documents).satisfiesExactly(document -> { assertThat(document.getMetadata()).isEqualTo(Map.of("lang", "java", "category", "code_block")); - assertThat(document.getContent()).startsWith("This is a Java sample application: package com.example.demo") + assertThat(document.getText()).startsWith("This is a Java sample application: package com.example.demo") .contains("SpringApplication.run(DemoApplication.class, args);"); }, document -> { assertThat(document.getMetadata()).isEqualTo(Map.of("category", "code_inline")); - assertThat(document.getContent()).isEqualTo( + assertThat(document.getText()).isEqualTo( "Markdown also provides the possibility to use inline code formatting throughout the entire sentence."); }, document -> { assertThat(document.getMetadata()).isEqualTo(Map.of("lang", "", "category", "code_block")); - assertThat(document.getContent()).isEqualTo( + assertThat(document.getText()).isEqualTo( "Another possibility is to set block code without specific highlighting: ./mvnw spring-javaformat:apply\n"); }); } @@ -208,7 +208,7 @@ void testBlockquoteWhenBlockquoteShouldNotBeSeparatedDocument() { Document documentsFirst = documents.get(0); assertThat(documentsFirst.getMetadata()).isEqualTo(Map.of("category", "blockquote")); - assertThat(documentsFirst.getContent()).isEqualTo( + assertThat(documentsFirst.getText()).isEqualTo( "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur diam eros, laoreet sit amet cursus vitae, varius sed nisi. Cras sit amet quam quis velit commodo porta consectetur id nisi. Phasellus tincidunt pulvinar augue. Proin vel laoreet leo, sed luctus augue. Sed et ligula commodo, commodo lacus at, consequat turpis. Maecenas eget sapien odio. Maecenas urna lectus, pellentesque in accumsan aliquam, congue eu libero. Ut rhoncus nec justo a porttitor. Pellentesque auctor pharetra eros, viverra sodales lorem aliquet id. Curabitur semper nisi vel sem interdum suscipit."); } @@ -241,7 +241,7 @@ void testWithAdditionalMetadata() { Document documentsFirst = documents.get(0); assertThat(documentsFirst.getMetadata()).isEqualTo(Map.of("service", "some-service-name", "env", "prod")); - assertThat(documentsFirst.getContent()).startsWith("Lorem ipsum dolor sit amet, consectetur adipiscing elit."); + assertThat(documentsFirst.getText()).startsWith("Lorem ipsum dolor sit amet, consectetur adipiscing elit."); } } diff --git a/document-readers/pdf-reader/src/main/java/org/springframework/ai/reader/pdf/ParagraphPdfDocumentReader.java b/document-readers/pdf-reader/src/main/java/org/springframework/ai/reader/pdf/ParagraphPdfDocumentReader.java index cb657238e89..95863fff649 100644 --- a/document-readers/pdf-reader/src/main/java/org/springframework/ai/reader/pdf/ParagraphPdfDocumentReader.java +++ b/document-readers/pdf-reader/src/main/java/org/springframework/ai/reader/pdf/ParagraphPdfDocumentReader.java @@ -145,7 +145,7 @@ public List get() { while (itr.hasNext()) { var next = itr.next(); Document document = toDocument(current, next); - if (document != null && StringUtils.hasText(document.getContent())) { + if (document != null && StringUtils.hasText(document.getText())) { documents.add(toDocument(current, next)); } current = next; diff --git a/document-readers/tika-reader/src/test/java/org/springframework/ai/reader/tika/TikaDocumentReaderTests.java b/document-readers/tika-reader/src/test/java/org/springframework/ai/reader/tika/TikaDocumentReaderTests.java index 5ae1e7a7d5d..a7c957211b4 100644 --- a/document-readers/tika-reader/src/test/java/org/springframework/ai/reader/tika/TikaDocumentReaderTests.java +++ b/document-readers/tika-reader/src/test/java/org/springframework/ai/reader/tika/TikaDocumentReaderTests.java @@ -43,7 +43,7 @@ public void testDocx(String resourceUri, String resourceName, String contentSnip assertThat(doc.getMetadata()).containsKeys(TikaDocumentReader.METADATA_SOURCE); assertThat(doc.getMetadata().get(TikaDocumentReader.METADATA_SOURCE)).isEqualTo(resourceName); - assertThat(doc.getContent()).contains(contentSnipped); + assertThat(doc.getText()).contains(contentSnipped); } } diff --git a/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/experiments/BedrockConverseChatModelMain2.java b/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/experiments/BedrockConverseChatModelMain2.java index 4851d621e8e..b2d95eab70f 100644 --- a/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/experiments/BedrockConverseChatModelMain2.java +++ b/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/experiments/BedrockConverseChatModelMain2.java @@ -45,7 +45,7 @@ public static void main(String[] args) { String modelId = "anthropic.claude-3-5-sonnet-20240620-v1:0"; // var prompt = new Prompt("Tell me a joke?", - // ChatOptionsBuilder.builder().withModel(modelId).build()); + // ChatOptions.builder().model(modelId).build(); var prompt = new Prompt( // "What's the weather like in San Francisco, Tokyo, and Paris? Return the // temperature in Celsius.", diff --git a/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/experiments/BedrockConverseChatModelMain3.java b/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/experiments/BedrockConverseChatModelMain3.java index b869e4c1704..daee808fbb6 100644 --- a/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/experiments/BedrockConverseChatModelMain3.java +++ b/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/experiments/BedrockConverseChatModelMain3.java @@ -43,7 +43,7 @@ public static void main(String[] args) { String modelId = "anthropic.claude-3-5-sonnet-20240620-v1:0"; // var prompt = new Prompt("Tell me a joke?", - // ChatOptionsBuilder.builder().withModel(modelId).build()); + // ChatOptions.builder().model(modelId).build(); var prompt = new Prompt( // "What's the weather like in San Francisco, Tokyo, and Paris? Return the // temperature in Celsius.", diff --git a/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereEmbeddingModel.java b/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereEmbeddingModel.java index 20163e0078e..170e8f0b549 100644 --- a/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereEmbeddingModel.java +++ b/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereEmbeddingModel.java @@ -73,7 +73,7 @@ public BedrockCohereEmbeddingModel(CohereEmbeddingBedrockApi cohereEmbeddingBedr @Override public float[] embed(Document document) { - return embed(document.getContent()); + return embed(document.getText()); } @Override diff --git a/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/titan/BedrockTitanEmbeddingModel.java b/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/titan/BedrockTitanEmbeddingModel.java index cf01aea8194..2eabc32d4f1 100644 --- a/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/titan/BedrockTitanEmbeddingModel.java +++ b/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/titan/BedrockTitanEmbeddingModel.java @@ -71,7 +71,7 @@ public BedrockTitanEmbeddingModel withInputType(InputType inputType) { @Override public float[] embed(Document document) { - return embed(document.getContent()); + return embed(document.getText()); } @Override diff --git a/models/spring-ai-oci-genai/src/main/java/org/springframework/ai/oci/OCIEmbeddingModel.java b/models/spring-ai-oci-genai/src/main/java/org/springframework/ai/oci/OCIEmbeddingModel.java index c8da46f6221..81b02107c79 100644 --- a/models/spring-ai-oci-genai/src/main/java/org/springframework/ai/oci/OCIEmbeddingModel.java +++ b/models/spring-ai-oci-genai/src/main/java/org/springframework/ai/oci/OCIEmbeddingModel.java @@ -100,7 +100,7 @@ public EmbeddingResponse call(EmbeddingRequest request) { @Override public float[] embed(Document document) { - return embed(document.getContent()); + return embed(document.getText()); } private EmbeddingResponse embedAllWithContext(List embedTextRequests, diff --git a/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/OllamaEmbeddingModel.java b/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/OllamaEmbeddingModel.java index 4ec62e88a4a..5bd50a2268d 100644 --- a/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/OllamaEmbeddingModel.java +++ b/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/OllamaEmbeddingModel.java @@ -96,7 +96,7 @@ public static Builder builder() { @Override public float[] embed(Document document) { - return embed(document.getContent()); + return embed(document.getText()); } @Override diff --git a/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/acme/AcmeIT.java b/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/acme/AcmeIT.java index 9cda24f4bfb..b0b0205b099 100644 --- a/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/acme/AcmeIT.java +++ b/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/acme/AcmeIT.java @@ -117,7 +117,7 @@ void acmeChain() { private Message getSystemMessage(List similarDocuments) { String documents = similarDocuments.stream() - .map(entry -> entry.getContent()) + .map(entry -> entry.getText()) .collect(Collectors.joining(System.lineSeparator())); SystemPromptTemplate systemPromptTemplate = new SystemPromptTemplate(this.systemBikePrompt); diff --git a/models/spring-ai-vertex-ai-embedding/src/main/java/org/springframework/ai/vertexai/embedding/multimodal/VertexAiMultimodalEmbeddingModel.java b/models/spring-ai-vertex-ai-embedding/src/main/java/org/springframework/ai/vertexai/embedding/multimodal/VertexAiMultimodalEmbeddingModel.java index d0a7508debe..a269ca80603 100644 --- a/models/spring-ai-vertex-ai-embedding/src/main/java/org/springframework/ai/vertexai/embedding/multimodal/VertexAiMultimodalEmbeddingModel.java +++ b/models/spring-ai-vertex-ai-embedding/src/main/java/org/springframework/ai/vertexai/embedding/multimodal/VertexAiMultimodalEmbeddingModel.java @@ -141,10 +141,10 @@ private EmbeddingResponse doSingleDocumentPrediction(PredictionServiceClient cli } // optional text parameter - if (StringUtils.hasText(document.getContent())) { - instanceBuilder.text(document.getContent()); + if (StringUtils.hasText(document.getText())) { + instanceBuilder.text(document.getText()); documentMetadata.put(ModalityType.TEXT, - new DocumentMetadata(document.getId(), MimeTypeUtils.TEXT_PLAIN, document.getContent())); + new DocumentMetadata(document.getId(), MimeTypeUtils.TEXT_PLAIN, document.getText())); } Media media = document.getMedia(); @@ -153,7 +153,7 @@ private EmbeddingResponse doSingleDocumentPrediction(PredictionServiceClient cli instanceBuilder.text(media.getData().toString()); documentMetadata.put(ModalityType.TEXT, new DocumentMetadata(document.getId(), MimeTypeUtils.TEXT_PLAIN, media.getData())); - if (StringUtils.hasText(document.getContent())) { + if (StringUtils.hasText(document.getText())) { logger.warn("Media type String overrides the Document text content!"); } } diff --git a/models/spring-ai-watsonx-ai/src/main/java/org/springframework/ai/watsonx/WatsonxAiEmbeddingModel.java b/models/spring-ai-watsonx-ai/src/main/java/org/springframework/ai/watsonx/WatsonxAiEmbeddingModel.java index a6df8fff27e..169307400d7 100644 --- a/models/spring-ai-watsonx-ai/src/main/java/org/springframework/ai/watsonx/WatsonxAiEmbeddingModel.java +++ b/models/spring-ai-watsonx-ai/src/main/java/org/springframework/ai/watsonx/WatsonxAiEmbeddingModel.java @@ -72,7 +72,7 @@ public WatsonxAiEmbeddingModel(WatsonxAiApi watsonxAiApi, WatsonxAiEmbeddingOpti @Override public float[] embed(Document document) { - return embed(document.getContent()); + return embed(document.getText()); } @Override diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/AbstractChatMemoryAdvisor.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/AbstractChatMemoryAdvisor.java index 11ba4a15af1..72a69f657a3 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/AbstractChatMemoryAdvisor.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/AbstractChatMemoryAdvisor.java @@ -274,42 +274,6 @@ public AbstractBuilder order(int order) { return this; } - /** - * @deprecated use {@link #conversationId( String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public AbstractBuilder withConversationId(String conversationId) { - this.conversationId = conversationId; - return this; - } - - /** - * @deprecated use {@link #chatMemoryRetrieveSize(int)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public AbstractBuilder withChatMemoryRetrieveSize(int chatMemoryRetrieveSize) { - this.chatMemoryRetrieveSize = chatMemoryRetrieveSize; - return this; - } - - /** - * @deprecated use {@link #protectFromBlocking(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public AbstractBuilder withProtectFromBlocking(boolean protectFromBlocking) { - this.protectFromBlocking = protectFromBlocking; - return this; - } - - /** - * @deprecated use {@link #order(int)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public AbstractBuilder withOrder(int order) { - this.order = order; - return this; - } - /** * Build the advisor. * @return the advisor diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/PromptChatMemoryAdvisor.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/PromptChatMemoryAdvisor.java index ebcb5f33d8b..aa709878839 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/PromptChatMemoryAdvisor.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/PromptChatMemoryAdvisor.java @@ -157,15 +157,6 @@ public Builder systemTextAdvise(String systemTextAdvise) { return this; } - /** - * @deprecated use {@link #systemTextAdvise(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSystemTextAdvise(String systemTextAdvise) { - this.systemTextAdvise = systemTextAdvise; - return this; - } - public PromptChatMemoryAdvisor build() { return new PromptChatMemoryAdvisor(this.chatMemory, this.conversationId, this.chatMemoryRetrieveSize, this.systemTextAdvise, this.order); diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisor.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisor.java index 57d1406d2f9..7ca09e5872a 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisor.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisor.java @@ -309,44 +309,6 @@ public Builder order(int order) { return this; } - /** - * @deprecated use {@link #searchRequest(SearchRequest)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSearchRequest(SearchRequest searchRequest) { - Assert.notNull(searchRequest, "The searchRequest must not be null!"); - this.searchRequest = searchRequest; - return this; - } - - /** - * @deprecated use {@link #userTextAdvise(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withUserTextAdvise(String userTextAdvise) { - Assert.hasText(userTextAdvise, "The userTextAdvise must not be empty!"); - this.userTextAdvise = userTextAdvise; - return this; - } - - /** - * @deprecated use {@link #protectFromBlocking(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withProtectFromBlocking(boolean protectFromBlocking) { - this.protectFromBlocking = protectFromBlocking; - return this; - } - - /** - * @deprecated use {@link #order(int)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withOrder(int order) { - this.order = order; - return this; - } - public QuestionAnswerAdvisor build() { return new QuestionAnswerAdvisor(this.vectorStore, this.searchRequest, this.userTextAdvise, this.protectFromBlocking, this.order); diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/SafeGuardAdvisor.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/SafeGuardAdvisor.java index 6eb56a1c85b..384ecbf8970 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/SafeGuardAdvisor.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/SafeGuardAdvisor.java @@ -132,33 +132,6 @@ public Builder order(int order) { return this; } - /** - * @deprecated use {@link #sensitiveWords(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSensitiveWords(List sensitiveWords) { - this.sensitiveWords = sensitiveWords; - return this; - } - - /** - * @deprecated use {@link #failureResponse(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withFailureResponse(String failureResponse) { - this.failureResponse = failureResponse; - return this; - } - - /** - * @deprecated use {@link #order(int)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withOrder(int order) { - this.order = order; - return this; - } - public SafeGuardAdvisor build() { return new SafeGuardAdvisor(this.sensitiveWords, this.failureResponse, this.order); } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/VectorStoreChatMemoryAdvisor.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/VectorStoreChatMemoryAdvisor.java index f25279c96c7..8f9660d47ef 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/VectorStoreChatMemoryAdvisor.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/VectorStoreChatMemoryAdvisor.java @@ -219,15 +219,6 @@ public Builder systemTextAdvise(String systemTextAdvise) { return this; } - /** - * @deprecated use {@link #systemTextAdvise(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSystemTextAdvise(String systemTextAdvise) { - this.systemTextAdvise = systemTextAdvise; - return this; - } - @Override public VectorStoreChatMemoryAdvisor build() { return new VectorStoreChatMemoryAdvisor(this.chatMemory, this.conversationId, this.chatMemoryRetrieveSize, diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/api/AdvisedRequest.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/api/AdvisedRequest.java index daef3980fb2..aacb37f8172 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/api/AdvisedRequest.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/api/AdvisedRequest.java @@ -364,132 +364,6 @@ public Builder toolContext(Map toolContext) { return this; } - /** - * @deprecated use {@link #chatModel(ChatModel)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withChatModel(ChatModel chatModel) { - this.chatModel = chatModel; - return this; - } - - /** - * @deprecated use {@link #userText(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withUserText(String userText) { - this.userText = userText; - return this; - } - - /** - * @deprecated use {@link #systemText(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSystemText(String systemText) { - this.systemText = systemText; - return this; - } - - /** - * @deprecated use {@link #chatOptions(ChatOptions)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withChatOptions(ChatOptions chatOptions) { - this.chatOptions = chatOptions; - return this; - } - - /** - * @deprecated use {@link #media(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withMedia(List media) { - this.media = media; - return this; - } - - /** - * @deprecated use {@link #functionNames(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withFunctionNames(List functionNames) { - this.functionNames = functionNames; - return this; - } - - /** - * @deprecated use {@link #functionCallbacks(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withFunctionCallbacks(List functionCallbacks) { - this.functionCallbacks = functionCallbacks; - return this; - } - - /** - * @deprecated use {@link #messages(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withMessages(List messages) { - this.messages = messages; - return this; - } - - /** - * @deprecated use {@link #userParams(Map)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withUserParams(Map userParams) { - this.userParams = userParams; - return this; - } - - /** - * @deprecated use {@link #systemParams(Map)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSystemParams(Map systemParams) { - this.systemParams = systemParams; - return this; - } - - /** - * @deprecated use {@link #advisors(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withAdvisors(List advisors) { - this.advisors = advisors; - return this; - } - - /** - * @deprecated use {@link #advisorParams(Map)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withAdvisorParams(Map advisorParams) { - this.advisorParams = advisorParams; - return this; - } - - /** - * @deprecated use {@link #adviseContext(Map)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withAdviseContext(Map adviseContext) { - this.adviseContext = adviseContext; - return this; - } - - /** - * @deprecated use {@link #toolContext(Map)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withToolContext(Map toolContext) { - this.toolContext = toolContext; - return this; - } - /** * Build the {@link AdvisedRequest} instance. * @return a new {@link AdvisedRequest} instance diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/api/AdvisedResponse.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/api/AdvisedResponse.java index f5d228650d0..7174aceacf7 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/api/AdvisedResponse.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/api/AdvisedResponse.java @@ -110,24 +110,6 @@ public Builder adviseContext(Map adviseContext) { return this; } - /** - * @deprecated use {@link #response(ChatResponse)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withResponse(@Nullable ChatResponse response) { - this.response = response; - return this; - } - - /** - * @deprecated use {@link #adviseContext(Map)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withAdviseContext(Map adviseContext) { - this.adviseContext = adviseContext; - return this; - } - /** * Build the {@link AdvisedResponse}. * @return the advised response diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/observation/AdvisorObservationContext.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/observation/AdvisorObservationContext.java index 530ce47614f..7816d3b8e20 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/observation/AdvisorObservationContext.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/observation/AdvisorObservationContext.java @@ -276,60 +276,6 @@ public Builder order(int order) { return this; } - /** - * @deprecated use {@link #advisorName(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withAdvisorName(String advisorName) { - this.advisorName = advisorName; - return this; - } - - /** - * @deprecated use {@link #advisorType(Type)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withAdvisorType(Type advisorType) { - this.advisorType = advisorType; - return this; - } - - /** - * @deprecated use {@link #advisedRequest(AdvisedRequest)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withAdvisedRequest(AdvisedRequest advisedRequest) { - this.advisorRequest = advisedRequest; - return this; - } - - /** - * @deprecated use {@link #advisorRequestContext(Map)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withAdvisorRequestContext(Map advisorRequestContext) { - this.advisorRequestContext = advisorRequestContext; - return this; - } - - /** - * @deprecated use {@link #advisorResponseContext(Map)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withAdvisorResponseContext(Map advisorResponseContext) { - this.advisorResponseContext = advisorResponseContext; - return this; - } - - /** - * @deprecated use {@link #order(int)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withOrder(int order) { - this.order = order; - return this; - } - /** * Build the {@link AdvisorObservationContext}. * @return the {@link AdvisorObservationContext} diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/metadata/ChatResponseMetadata.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/metadata/ChatResponseMetadata.java index f9969d9c26b..cc168389d29 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/metadata/ChatResponseMetadata.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/metadata/ChatResponseMetadata.java @@ -170,62 +170,6 @@ public Builder promptMetadata(PromptMetadata promptMetadata) { return this; } - /** - * @deprecated use {@link #metadata(Map)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder wihtMetadata(Map mapToCopy) { - return metadata(mapToCopy); - } - - /** - * @deprecated use {@link #keyValue(String, Object)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withKeyValue(String key, Object value) { - return keyValue(key, value); - } - - /** - * @deprecated use {@link #id(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withId(String id) { - return id(id); - } - - /** - * @deprecated use {@link #model(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withModel(String model) { - return model(model); - } - - /** - * @deprecated use {@link #rateLimit(RateLimit)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withRateLimit(RateLimit rateLimit) { - return rateLimit(rateLimit); - } - - /** - * @deprecated use {@link #usage(Usage)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withUsage(Usage usage) { - return usage(usage); - } - - /** - * @deprecated use {@link #promptMetadata(PromptMetadata)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withPromptMetadata(PromptMetadata promptMetadata) { - return promptMetadata(promptMetadata); - } - public ChatResponseMetadata build() { return this.chatResponseMetadata; } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/ChatOptionsBuilder.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/ChatOptionsBuilder.java deleted file mode 100644 index f3e4f793678..00000000000 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/ChatOptionsBuilder.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright 2023-2024 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ai.chat.prompt; - -import java.util.List; - -/** - * @deprecated Use {@link ChatOptions.Builder} instead. - */ -@Deprecated(forRemoval = true, since = "1.0.0-M5") -public final class ChatOptionsBuilder { - - private final DefaultChatOptions options = new DefaultChatOptions(); - - private ChatOptionsBuilder() { - } - - public static ChatOptionsBuilder builder() { - return new ChatOptionsBuilder(); - } - - public ChatOptionsBuilder withModel(String model) { - this.options.setModel(model); - return this; - } - - public ChatOptionsBuilder withFrequencyPenalty(Double frequencyPenalty) { - this.options.setFrequencyPenalty(frequencyPenalty); - return this; - } - - public ChatOptionsBuilder withMaxTokens(Integer maxTokens) { - this.options.setMaxTokens(maxTokens); - return this; - } - - public ChatOptionsBuilder withPresencePenalty(Double presencePenalty) { - this.options.setPresencePenalty(presencePenalty); - return this; - } - - public ChatOptionsBuilder withStopSequences(List stop) { - this.options.setStopSequences(stop); - return this; - } - - public ChatOptionsBuilder withTemperature(Double temperature) { - this.options.setTemperature(temperature); - return this; - } - - public ChatOptionsBuilder withTopK(Integer topK) { - this.options.setTopK(topK); - return this; - } - - public ChatOptionsBuilder withTopP(Double topP) { - this.options.setTopP(topP); - return this; - } - - public ChatOptions build() { - return this.options; - } - - private final static class DefaultChatOptions implements ChatOptions { - - private String model; - - private Double frequencyPenalty; - - private Integer maxTokens; - - private Double presencePenalty; - - private List stopSequences; - - private Double temperature; - - private Integer topK; - - private Double topP; - - @Override - public String getModel() { - return this.model; - } - - public void setModel(String model) { - this.model = model; - } - - @Override - public Double getFrequencyPenalty() { - return this.frequencyPenalty; - } - - public void setFrequencyPenalty(Double frequencyPenalty) { - this.frequencyPenalty = frequencyPenalty; - } - - @Override - public Integer getMaxTokens() { - return this.maxTokens; - } - - public void setMaxTokens(Integer maxTokens) { - this.maxTokens = maxTokens; - } - - @Override - public Double getPresencePenalty() { - return this.presencePenalty; - } - - public void setPresencePenalty(Double presencePenalty) { - this.presencePenalty = presencePenalty; - } - - @Override - public List getStopSequences() { - return this.stopSequences; - } - - public void setStopSequences(List stopSequences) { - this.stopSequences = stopSequences; - } - - @Override - public Double getTemperature() { - return this.temperature; - } - - public void setTemperature(Double temperature) { - this.temperature = temperature; - } - - @Override - public Integer getTopK() { - return this.topK; - } - - public void setTopK(Integer topK) { - this.topK = topK; - } - - @Override - public Double getTopP() { - return this.topP; - } - - public void setTopP(Double topP) { - this.topP = topP; - } - - @Override - public ChatOptions copy() { - return builder().withModel(this.model) - .withFrequencyPenalty(this.frequencyPenalty) - .withMaxTokens(this.maxTokens) - .withPresencePenalty(this.presencePenalty) - .withStopSequences(this.stopSequences != null ? List.copyOf(this.stopSequences) : null) - .withTemperature(this.temperature) - .withTopK(this.topK) - .withTopP(this.topP) - .build(); - } - - } - -} diff --git a/spring-ai-core/src/main/java/org/springframework/ai/document/DefaultContentFormatter.java b/spring-ai-core/src/main/java/org/springframework/ai/document/DefaultContentFormatter.java index e5825818b75..ff8076fc296 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/document/DefaultContentFormatter.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/document/DefaultContentFormatter.java @@ -113,7 +113,7 @@ public String format(Document document, MetadataMode metadataMode) { .collect(Collectors.joining(this.metadataSeparator)); return this.textTemplate.replace(TEMPLATE_METADATA_STRING_PLACEHOLDER, metadataText) - .replace(TEMPLATE_CONTENT_PLACEHOLDER, document.getContent()); + .replace(TEMPLATE_CONTENT_PLACEHOLDER, document.getText()); } /** diff --git a/spring-ai-core/src/main/java/org/springframework/ai/document/Document.java b/spring-ai-core/src/main/java/org/springframework/ai/document/Document.java index 93d46dd578a..7d02ae50e6a 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/document/Document.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/document/Document.java @@ -178,14 +178,6 @@ public String getId() { return this.id; } - /** - * @deprecated Use getText() instead as it more accurately reflects the content type - */ - @Deprecated - public String getContent() { - return this.getText(); - } - /** * Returns the document's text content, if any. * @return the text content if {@link #isText()} is true, null otherwise diff --git a/spring-ai-core/src/main/java/org/springframework/ai/image/ImageOptionsBuilder.java b/spring-ai-core/src/main/java/org/springframework/ai/image/ImageOptionsBuilder.java index bce2c9757d5..693a4f00f9d 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/image/ImageOptionsBuilder.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/image/ImageOptionsBuilder.java @@ -58,60 +58,6 @@ public ImageOptionsBuilder style(String style) { return this; } - /** - * @deprecated use {@link #N(Integer)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public ImageOptionsBuilder withN(Integer n) { - this.options.setN(n); - return this; - } - - /** - * @deprecated use {@link #model(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public ImageOptionsBuilder withModel(String model) { - this.options.setModel(model); - return this; - } - - /** - * @deprecated use {@link #responseFormat(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public ImageOptionsBuilder withResponseFormat(String responseFormat) { - this.options.setResponseFormat(responseFormat); - return this; - } - - /** - * @deprecated use {@link #width(Integer)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public ImageOptionsBuilder withWidth(Integer width) { - this.options.setWidth(width); - return this; - } - - /** - * @deprecated use {@link #height(Integer)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public ImageOptionsBuilder withHeight(Integer height) { - this.options.setHeight(height); - return this; - } - - /** - * @deprecated use {@link #style(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public ImageOptionsBuilder withStyle(String style) { - this.options.setStyle(style); - return this; - } - public ImageOptions build() { return this.options; } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/model/function/FunctionCallingOptions.java b/spring-ai-core/src/main/java/org/springframework/ai/model/function/FunctionCallingOptions.java index 539cefa70f8..ba8529e684f 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/model/function/FunctionCallingOptions.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/model/function/FunctionCallingOptions.java @@ -172,86 +172,6 @@ interface Builder extends ChatOptions.Builder { @Override Builder topP(Double topP); - /** - * @deprecated Use {@link #model(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - default Builder withModel(String model) { - return model(model); - } - - /** - * @deprecated Use {@link #frequencyPenalty(Double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - default Builder withFrequencyPenalty(Double frequencyPenalty) { - return frequencyPenalty(frequencyPenalty); - } - - /** - * @deprecated Use {@link #maxTokens(Integer)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - default Builder withMaxTokens(Integer maxTokens) { - return maxTokens(maxTokens); - } - - /** - * @deprecated Use {@link #presencePenalty(Double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - default Builder withPresencePenalty(Double presencePenalty) { - return presencePenalty(presencePenalty); - } - - /** - * @deprecated Use {@link #stopSequences(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - default Builder withStopSequences(List stopSequences) { - return stopSequences(stopSequences); - } - - /** - * @deprecated Use {@link #temperature(Double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - default Builder withTemperature(Double temperature) { - return temperature(temperature); - } - - /** - * @deprecated Use {@link #functionCallbacks(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - default Builder withFunctionCallbacks(List functionCallbacks) { - return functionCallbacks(functionCallbacks); - } - - /** - * @deprecated Use {@link #functionCallbacks(FunctionCallback...)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - default Builder withFunctionCallbacks(FunctionCallback... functionCallbacks) { - return functionCallbacks(functionCallbacks); - } - - /** - * @deprecated Use {@link #functions(Set)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - default Builder withFunctions(Set functions) { - return functions(functions); - } - - /** - * @deprecated Use {@link #function(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - default Builder withFunction(String function) { - return function(function); - } - } } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/model/function/FunctionCallingOptionsBuilder.java b/spring-ai-core/src/main/java/org/springframework/ai/model/function/FunctionCallingOptionsBuilder.java deleted file mode 100644 index f831a135110..00000000000 --- a/spring-ai-core/src/main/java/org/springframework/ai/model/function/FunctionCallingOptionsBuilder.java +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright 2023-2024 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ai.model.function; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.springframework.ai.chat.prompt.ChatOptions; -import org.springframework.util.Assert; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - -/** - * Builder for {@link FunctionCallingOptions}. Using the {@link FunctionCallingOptions} - * permits options portability between different AI providers that support - * function-calling. - * - * @deprecated Use {@link FunctionCallingOptions.Builder} instead. - * @author Christian Tzolov - * @author Thomas Vitale - * @since 0.8.1 - */ -@Deprecated(forRemoval = true, since = "1.0.0-M5") -public class FunctionCallingOptionsBuilder { - - private final PortableFunctionCallingOptions options; - - public FunctionCallingOptionsBuilder() { - this.options = new PortableFunctionCallingOptions(); - } - - public FunctionCallingOptionsBuilder withFunctionCallbacks(List functionCallbacks) { - this.options.setFunctionCallbacks(functionCallbacks); - return this; - } - - public FunctionCallingOptionsBuilder withFunctionCallbacks(FunctionCallback... functionCallbacks) { - Assert.notNull(functionCallbacks, "FunctionCallbacks must not be null"); - this.options.setFunctionCallbacks(List.of(functionCallbacks)); - return this; - } - - public FunctionCallingOptionsBuilder withFunctions(Set functions) { - this.options.setFunctions(functions); - return this; - } - - public FunctionCallingOptionsBuilder withFunction(String function) { - Assert.notNull(function, "Function must not be null"); - var set = new HashSet<>(this.options.getFunctions()); - set.add(function); - this.options.setFunctions(set); - return this; - } - - public FunctionCallingOptionsBuilder withModel(String model) { - this.options.setModel(model); - return this; - } - - public FunctionCallingOptionsBuilder withFrequencyPenalty(Double frequencyPenalty) { - this.options.setFrequencyPenalty(frequencyPenalty); - return this; - } - - public FunctionCallingOptionsBuilder withMaxTokens(Integer maxTokens) { - this.options.setMaxTokens(maxTokens); - return this; - } - - public FunctionCallingOptionsBuilder withPresencePenalty(Double presencePenalty) { - this.options.setPresencePenalty(presencePenalty); - return this; - } - - public FunctionCallingOptionsBuilder withStopSequences(List stopSequences) { - this.options.setStopSequences(stopSequences); - return this; - } - - public FunctionCallingOptionsBuilder withTemperature(Double temperature) { - this.options.setTemperature(temperature); - return this; - } - - public FunctionCallingOptionsBuilder withTopK(Integer topK) { - this.options.setTopK(topK); - return this; - } - - public FunctionCallingOptionsBuilder withTopP(Double topP) { - this.options.setTopP(topP); - return this; - } - - public FunctionCallingOptionsBuilder withProxyToolCalls(Boolean proxyToolCalls) { - this.options.setProxyToolCalls(proxyToolCalls); - return this; - } - - public FunctionCallingOptionsBuilder withToolContext(Map context) { - Assert.notNull(context, "Tool context must not be null"); - Map newContext = new HashMap<>(this.options.getToolContext()); - newContext.putAll(context); - this.options.setToolContext(newContext); - return this; - } - - public FunctionCallingOptionsBuilder withToolContext(String key, Object value) { - Assert.notNull(key, "Key must not be null"); - Assert.notNull(value, "Value must not be null"); - Map newContext = new HashMap<>(this.options.getToolContext()); - newContext.put(key, value); - this.options.setToolContext(newContext); - return this; - } - - public PortableFunctionCallingOptions build() { - return this.options; - } - - /** - * @deprecated use {@link DefaultFunctionCallingOptions} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public static class PortableFunctionCallingOptions implements FunctionCallingOptions { - - private List functionCallbacks = new ArrayList<>(); - - private Set functions = new HashSet<>(); - - private String model; - - private Double frequencyPenalty; - - private Integer maxTokens; - - private Double presencePenalty; - - private List stopSequences; - - private Double temperature; - - private Integer topK; - - private Double topP; - - private Boolean proxyToolCalls = false; - - private Map context = new HashMap<>(); - - public static FunctionCallingOptionsBuilder builder() { - return new FunctionCallingOptionsBuilder(); - } - - @Override - public List getFunctionCallbacks() { - return Collections.unmodifiableList(this.functionCallbacks); - } - - public void setFunctionCallbacks(List functionCallbacks) { - Assert.notNull(functionCallbacks, "FunctionCallbacks must not be null"); - this.functionCallbacks = new ArrayList<>(functionCallbacks); - } - - @Override - public Set getFunctions() { - return Collections.unmodifiableSet(this.functions); - } - - public void setFunctions(Set functions) { - Assert.notNull(functions, "Functions must not be null"); - this.functions = new HashSet<>(functions); - } - - @Override - public String getModel() { - return this.model; - } - - public void setModel(String model) { - this.model = model; - } - - @Override - public Double getFrequencyPenalty() { - return this.frequencyPenalty; - } - - public void setFrequencyPenalty(Double frequencyPenalty) { - this.frequencyPenalty = frequencyPenalty; - } - - @Override - public Integer getMaxTokens() { - return this.maxTokens; - } - - public void setMaxTokens(Integer maxTokens) { - this.maxTokens = maxTokens; - } - - @Override - public Double getPresencePenalty() { - return this.presencePenalty; - } - - public void setPresencePenalty(Double presencePenalty) { - this.presencePenalty = presencePenalty; - } - - @Override - public List getStopSequences() { - return this.stopSequences; - } - - public void setStopSequences(List stopSequences) { - this.stopSequences = stopSequences; - } - - @Override - public Double getTemperature() { - return this.temperature; - } - - public void setTemperature(Double temperature) { - this.temperature = temperature; - } - - @Override - public Integer getTopK() { - return this.topK; - } - - public void setTopK(Integer topK) { - this.topK = topK; - } - - @Override - public Double getTopP() { - return this.topP; - } - - public void setTopP(Double topP) { - this.topP = topP; - } - - @Override - public Boolean getProxyToolCalls() { - return this.proxyToolCalls; - } - - public void setProxyToolCalls(Boolean proxyToolCalls) { - this.proxyToolCalls = proxyToolCalls; - } - - public Map getToolContext() { - return Collections.unmodifiableMap(this.context); - } - - public void setToolContext(Map context) { - Assert.notNull(context, "Context must not be null"); - this.context = new HashMap<>(context); - } - - @Override - public ChatOptions copy() { - return new FunctionCallingOptionsBuilder().withModel(this.model) - .withFrequencyPenalty(this.frequencyPenalty) - .withMaxTokens(this.maxTokens) - .withPresencePenalty(this.presencePenalty) - .withStopSequences(this.stopSequences != null ? new ArrayList<>(this.stopSequences) : null) - .withTemperature(this.temperature) - .withTopK(this.topK) - .withTopP(this.topP) - .withFunctions(new HashSet<>(this.functions)) - .withFunctionCallbacks(new ArrayList<>(this.functionCallbacks)) - .withProxyToolCalls(this.proxyToolCalls) - .withToolContext(new HashMap<>(this.getToolContext())) - .build(); - } - - public PortableFunctionCallingOptions merge(FunctionCallingOptions options) { - - var builder = PortableFunctionCallingOptions.builder() - .withModel(StringUtils.hasText(options.getModel()) ? options.getModel() : this.model) - .withFrequencyPenalty( - options.getFrequencyPenalty() != null ? options.getFrequencyPenalty() : this.frequencyPenalty) - .withMaxTokens(options.getMaxTokens() != null ? options.getMaxTokens() : this.maxTokens) - .withPresencePenalty( - options.getPresencePenalty() != null ? options.getPresencePenalty() : this.presencePenalty) - .withStopSequences(options.getStopSequences() != null ? options.getStopSequences() : this.stopSequences) - .withTemperature(options.getTemperature() != null ? options.getTemperature() : this.temperature) - .withTopK(options.getTopK() != null ? options.getTopK() : this.topK) - .withTopP(options.getTopP() != null ? options.getTopP() : this.topP) - .withProxyToolCalls( - options.getProxyToolCalls() != null ? options.getProxyToolCalls() : this.proxyToolCalls); - - Set functions = new HashSet<>(); - if (!CollectionUtils.isEmpty(this.functions)) { - functions.addAll(this.functions); - } - if (!CollectionUtils.isEmpty(options.getFunctions())) { - functions.addAll(options.getFunctions()); - } - builder.withFunctions(functions); - - List functionCallbacks = new ArrayList<>(); - if (!CollectionUtils.isEmpty(this.functionCallbacks)) { - functionCallbacks.addAll(this.functionCallbacks); - } - if (!CollectionUtils.isEmpty(options.getFunctionCallbacks())) { - functionCallbacks.addAll(options.getFunctionCallbacks()); - } - builder.withFunctionCallbacks(functionCallbacks); - - Map context = new HashMap<>(); - if (!CollectionUtils.isEmpty(this.context)) { - context.putAll(this.context); - } - if (!CollectionUtils.isEmpty(options.getToolContext())) { - context.putAll(options.getToolContext()); - } - builder.withToolContext(context); - - return builder.build(); - } - - public PortableFunctionCallingOptions merge(ChatOptions options) { - - var builder = PortableFunctionCallingOptions.builder() - .withModel(StringUtils.hasText(options.getModel()) ? options.getModel() : this.model) - .withFrequencyPenalty( - options.getFrequencyPenalty() != null ? options.getFrequencyPenalty() : this.frequencyPenalty) - .withMaxTokens(options.getMaxTokens() != null ? options.getMaxTokens() : this.maxTokens) - .withPresencePenalty( - options.getPresencePenalty() != null ? options.getPresencePenalty() : this.presencePenalty) - .withStopSequences(options.getStopSequences() != null ? options.getStopSequences() : this.stopSequences) - .withTemperature(options.getTemperature() != null ? options.getTemperature() : this.temperature) - .withTopK(options.getTopK() != null ? options.getTopK() : this.topK) - .withTopP(options.getTopP() != null ? options.getTopP() : this.topP); - - return builder.build(); - } - - } - -} diff --git a/spring-ai-core/src/main/java/org/springframework/ai/moderation/Categories.java b/spring-ai-core/src/main/java/org/springframework/ai/moderation/Categories.java index 01f8dc79747..be1c1191bc5 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/moderation/Categories.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/moderation/Categories.java @@ -224,105 +224,6 @@ public Builder violence(boolean violence) { return this; } - /** - * @deprecated use {@link #sexual(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSexual(boolean sexual) { - this.sexual = sexual; - return this; - } - - /** - * @deprecated use {@link #hate(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withHate(boolean hate) { - this.hate = hate; - return this; - } - - /** - * @deprecated use {@link #harassment(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withHarassment(boolean harassment) { - this.harassment = harassment; - return this; - } - - /** - * @deprecated use {@link #selfHarm(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSelfHarm(boolean selfHarm) { - this.selfHarm = selfHarm; - return this; - } - - /** - * @deprecated use {@link #sexualMinors(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSexualMinors(boolean sexualMinors) { - this.sexualMinors = sexualMinors; - return this; - } - - /** - * @deprecated use {@link #hateThreatening(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withHateThreatening(boolean hateThreatening) { - this.hateThreatening = hateThreatening; - return this; - } - - /** - * @deprecated use {@link #violenceGraphic(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withViolenceGraphic(boolean violenceGraphic) { - this.violenceGraphic = violenceGraphic; - return this; - } - - /** - * @deprecated use {@link #selfHarmIntent(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSelfHarmIntent(boolean selfHarmIntent) { - this.selfHarmIntent = selfHarmIntent; - return this; - } - - /** - * @deprecated use {@link #selfHarmInstructions(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSelfHarmInstructions(boolean selfHarmInstructions) { - this.selfHarmInstructions = selfHarmInstructions; - return this; - } - - /** - * @deprecated use {@link #harassmentThreatening(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withHarassmentThreatening(boolean harassmentThreatening) { - this.harassmentThreatening = harassmentThreatening; - return this; - } - - /** - * @deprecated use {@link #violence(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withViolence(boolean violence) { - this.violence = violence; - return this; - } - public Categories build() { return new Categories(this); } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/moderation/CategoryScores.java b/spring-ai-core/src/main/java/org/springframework/ai/moderation/CategoryScores.java index 94717f3c951..f4ee845d53d 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/moderation/CategoryScores.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/moderation/CategoryScores.java @@ -229,105 +229,6 @@ public Builder violence(double violence) { return this; } - /** - * @deprecated use {@link #sexual(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSexual(double sexual) { - this.sexual = sexual; - return this; - } - - /** - * @deprecated use {@link #hate(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withHate(double hate) { - this.hate = hate; - return this; - } - - /** - * @deprecated use {@link #harassment(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withHarassment(double harassment) { - this.harassment = harassment; - return this; - } - - /** - * @deprecated use {@link #selfHarm(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSelfHarm(double selfHarm) { - this.selfHarm = selfHarm; - return this; - } - - /** - * @deprecated use {@link #sexualMinors(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSexualMinors(double sexualMinors) { - this.sexualMinors = sexualMinors; - return this; - } - - /** - * @deprecated use {@link #hateThreatening(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withHateThreatening(double hateThreatening) { - this.hateThreatening = hateThreatening; - return this; - } - - /** - * @deprecated use {@link #violenceGraphic(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withViolenceGraphic(double violenceGraphic) { - this.violenceGraphic = violenceGraphic; - return this; - } - - /** - * @deprecated use {@link #selfHarmIntent(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSelfHarmIntent(double selfHarmIntent) { - this.selfHarmIntent = selfHarmIntent; - return this; - } - - /** - * @deprecated use {@link #selfHarmInstructions(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSelfHarmInstructions(double selfHarmInstructions) { - this.selfHarmInstructions = selfHarmInstructions; - return this; - } - - /** - * @deprecated use {@link #harassmentThreatening(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withHarassmentThreatening(double harassmentThreatening) { - this.harassmentThreatening = harassmentThreatening; - return this; - } - - /** - * @deprecated use {@link #violence(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withViolence(double violence) { - this.violence = violence; - return this; - } - public CategoryScores build() { return new CategoryScores(this); } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/moderation/Generation.java b/spring-ai-core/src/main/java/org/springframework/ai/moderation/Generation.java index b074304a5ea..804de3b851f 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/moderation/Generation.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/moderation/Generation.java @@ -50,15 +50,6 @@ public Generation generationMetadata(@Nullable ModerationGenerationMetadata mode return this; } - /** - * @deprecated use {@link #generationMetadata(ModerationGenerationMetadata)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Generation withGenerationMetadata(@Nullable ModerationGenerationMetadata moderationGenerationMetadata) { - this.moderationGenerationMetadata = moderationGenerationMetadata; - return this; - } - @Override public Moderation getOutput() { return this.moderation; diff --git a/spring-ai-core/src/main/java/org/springframework/ai/moderation/Moderation.java b/spring-ai-core/src/main/java/org/springframework/ai/moderation/Moderation.java index c3143490e07..18bb5f9d64d 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/moderation/Moderation.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/moderation/Moderation.java @@ -106,33 +106,6 @@ public Builder results(List results) { return this; } - /** - * @deprecated use {@link #id(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withId(String id) { - this.id = id; - return this; - } - - /** - * @deprecated use {@link #model(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withModel(String model) { - this.model = model; - return this; - } - - /** - * @deprecated use {@link #results(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withResults(List results) { - this.moderationResultList = results; - return this; - } - public Moderation build() { return new Moderation(this); } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/moderation/ModerationOptionsBuilder.java b/spring-ai-core/src/main/java/org/springframework/ai/moderation/ModerationOptionsBuilder.java index efb3b1c98e2..b573b074d45 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/moderation/ModerationOptionsBuilder.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/moderation/ModerationOptionsBuilder.java @@ -42,15 +42,6 @@ public ModerationOptionsBuilder model(String model) { return this; } - /** - * @deprecated use {@link #model(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public ModerationOptionsBuilder withModel(String model) { - this.options.setModel(model); - return this; - } - public ModerationOptions build() { return this.options; } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/moderation/ModerationResult.java b/spring-ai-core/src/main/java/org/springframework/ai/moderation/ModerationResult.java index 18e9a9b2348..857a3a273ef 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/moderation/ModerationResult.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/moderation/ModerationResult.java @@ -115,33 +115,6 @@ public Builder categoryScores(CategoryScores categoryScores) { return this; } - /** - * @deprecated use {@link #flagged(boolean)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withFlagged(boolean flagged) { - this.flagged = flagged; - return this; - } - - /** - * @deprecated use {@link #categories(Categories)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withCategories(Categories categories) { - this.categories = categories; - return this; - } - - /** - * @deprecated use {@link #categoryScores(CategoryScores)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withCategoryScores(CategoryScores categoryScores) { - this.categoryScores = categoryScores; - return this; - } - public ModerationResult build() { return new ModerationResult(this); } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/reader/ExtractedTextFormatter.java b/spring-ai-core/src/main/java/org/springframework/ai/reader/ExtractedTextFormatter.java index 493d17e037d..0ad3e3290b3 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/reader/ExtractedTextFormatter.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/reader/ExtractedTextFormatter.java @@ -95,18 +95,6 @@ public static String alignToLeft(String pageText) { return pageText.replaceAll("(?m)(^ *| +(?= |$))", "").replaceAll("(?m)^$( ?)(^$[\r\n]+?^)+", "$1"); } - /** - * Removes the specified number of lines from the bottom part of the text. - * @param pageText Text to remove lines from. - * @param numberOfLines Number of lines to remove. - * @return Returns the text striped from last lines. - * @deprecated use {@link #deleteTopTextLines(String, int, String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public static String deleteBottomTextLines(String pageText, int numberOfLines) { - return deleteBottomTextLines(pageText, numberOfLines, System.lineSeparator()); - } - /** * Removes the specified number of lines from the bottom part of the text. * @param pageText Text to remove lines from. @@ -130,33 +118,6 @@ public static String deleteBottomTextLines(String pageText, int numberOfLines, S return pageText.substring(0, truncateIndex); } - /** - * Removes a specified number of lines from the top part of the given text. - * - *

- * This method takes a text and trims it by removing a certain number of lines from - * the top. If the provided text is null or contains only whitespace, it will be - * returned as is. If the number of lines to remove exceeds the actual number of lines - * in the text, the result will be an empty string. - *

- * - *

- * The method identifies lines based on the system's line separator, making it - * compatible with different platforms. - *

- * @param pageText The text from which the top lines need to be removed. If this is - * null, empty, or consists only of whitespace, it will be returned unchanged. - * @param numberOfLines The number of lines to remove from the top of the text. If - * this exceeds the actual number of lines in the text, an empty string will be - * returned. - * @return The text with the specified number of lines removed from the top. - * @deprecated use {@link #deleteTopTextLines(String, int, String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public static String deleteTopTextLines(String pageText, int numberOfLines) { - return deleteTopTextLines(pageText, numberOfLines, System.lineSeparator()); - } - /** * Removes a specified number of lines from the top part of the given text. * diff --git a/spring-ai-core/src/main/java/org/springframework/ai/transformer/KeywordMetadataEnricher.java b/spring-ai-core/src/main/java/org/springframework/ai/transformer/KeywordMetadataEnricher.java index ff5a4a5d1ef..c57b09a1993 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/transformer/KeywordMetadataEnricher.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/transformer/KeywordMetadataEnricher.java @@ -64,7 +64,7 @@ public List apply(List documents) { for (Document document : documents) { var template = new PromptTemplate(String.format(KEYWORDS_TEMPLATE, this.keywordCount)); - Prompt prompt = template.create(Map.of(CONTEXT_STR_PLACEHOLDER, document.getContent())); + Prompt prompt = template.create(Map.of(CONTEXT_STR_PLACEHOLDER, document.getText())); String keywords = this.chatModel.call(prompt).getResult().getOutput().getText(); document.getMetadata().putAll(Map.of(EXCERPT_KEYWORDS_METADATA_KEY, keywords)); } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/transformer/splitter/TextSplitter.java b/spring-ai-core/src/main/java/org/springframework/ai/transformer/splitter/TextSplitter.java index 7d5439c8653..793c3fb7589 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/transformer/splitter/TextSplitter.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/transformer/splitter/TextSplitter.java @@ -65,7 +65,7 @@ private List doSplitDocuments(List documents) { List formatters = new ArrayList<>(); for (Document doc : documents) { - texts.add(doc.getContent()); + texts.add(doc.getText()); metadataList.add(doc.getMetadata()); formatters.add(doc.getContentFormatter()); } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/SearchRequest.java b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/SearchRequest.java index feea876b79e..5a91fbecc06 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/SearchRequest.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/SearchRequest.java @@ -71,84 +71,6 @@ public static Builder from(SearchRequest originalSearchRequest) { .filterExpression(originalSearchRequest.getFilterExpression()); } - /** - * @deprecated use {@link SearchRequest.Builder#query(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public static SearchRequest query(String query) { - Assert.notNull(query, "Query can not be null."); - return builder().query(query).build(); - } - - /** - * Create a new {@link SearchRequest} builder instance with an empty embedding query - * string. Use the {@link Builder#query(String query)} to set/update the embedding - * query text. - * @return Returns new {@link SearchRequest} builder instance. - * @deprecated use {@link Builder#builder()} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public static Builder defaults() { - return new Builder().topK(DEFAULT_TOP_K).similarityThresholdAll(); - } - - /** - * @deprecated use {@link Builder#query(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public SearchRequest withQuery(String query) { - Assert.notNull(query, "Query can not be null."); - this.query = query; - return this; - } - - /** - * @deprecated use {@link Builder#topK(int)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public SearchRequest withTopK(int topK) { - Assert.isTrue(topK >= 0, "TopK should be positive."); - this.topK = topK; - return this; - } - - /** - * @deprecated use {@link Builder#similarityThreshold(double)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public SearchRequest withSimilarityThreshold(double threshold) { - Assert.isTrue(threshold >= 0 && threshold <= 1, "Similarity threshold must be in [0,1] range."); - this.similarityThreshold = threshold; - return this; - } - - /** - * @deprecated use {@link Builder#similarityThresholdAll()} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public SearchRequest withSimilarityThresholdAll() { - return withSimilarityThreshold(SIMILARITY_THRESHOLD_ACCEPT_ALL); - } - - /** - * @deprecated use {@link Builder#filterExpression(Filter.Expression)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public SearchRequest withFilterExpression(@Nullable Filter.Expression expression) { - this.filterExpression = expression; - return this; - } - - /** - * @deprecated use {@link Builder#filterExpression(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public SearchRequest withFilterExpression(@Nullable String textExpression) { - this.filterExpression = (textExpression != null) ? new FilterExpressionTextParser().parse(textExpression) - : null; - return this; - } - public String getQuery() { return this.query; } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/SimpleVectorStore.java b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/SimpleVectorStore.java index 8273a11188f..532ace8e8f7 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/SimpleVectorStore.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/SimpleVectorStore.java @@ -78,24 +78,6 @@ public class SimpleVectorStore extends AbstractObservationVectorStore { protected Map store = new ConcurrentHashMap<>(); - /** - * use {@link #SimpleVectorStore(SimpleVectorStoreBuilder)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public SimpleVectorStore(EmbeddingModel embeddingModel) { - this(embeddingModel, ObservationRegistry.NOOP, null); - } - - /** - * use {@link #SimpleVectorStore(SimpleVectorStoreBuilder)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public SimpleVectorStore(EmbeddingModel embeddingModel, ObservationRegistry observationRegistry, - VectorStoreObservationConvention customObservationConvention) { - this(builder(embeddingModel).observationRegistry(observationRegistry) - .customObservationConvention(customObservationConvention)); - } - protected SimpleVectorStore(SimpleVectorStoreBuilder builder) { super(builder); this.objectMapper = JsonMapper.builder().addModules(JacksonUtils.instantiateAvailableModules()).build(); @@ -119,8 +101,8 @@ public void doAdd(List documents) { for (Document document : documents) { logger.info("Calling EmbeddingModel for document id = {}", document.getId()); float[] embedding = this.embeddingModel.embed(document); - SimpleVectorStoreContent storeContent = new SimpleVectorStoreContent(document.getId(), - document.getContent(), document.getMetadata(), embedding); + SimpleVectorStoreContent storeContent = new SimpleVectorStoreContent(document.getId(), document.getText(), + document.getMetadata(), embedding); this.store.put(document.getId(), storeContent); } } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/observation/AbstractObservationVectorStore.java b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/observation/AbstractObservationVectorStore.java index ec6c641bec6..440c5990579 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/observation/AbstractObservationVectorStore.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/observation/AbstractObservationVectorStore.java @@ -47,17 +47,6 @@ public abstract class AbstractObservationVectorStore implements VectorStore { protected final EmbeddingModel embeddingModel; - /** - * Create a new {@link AbstractObservationVectorStore} instance. - * @param observationRegistry the observation registry to use - * @param customObservationConvention the custom observation convention to use - */ - @Deprecated(since = "1.0.0-M5", forRemoval = true) - public AbstractObservationVectorStore(ObservationRegistry observationRegistry, - @Nullable VectorStoreObservationConvention customObservationConvention) { - this(null, observationRegistry, customObservationConvention); - } - private AbstractObservationVectorStore(EmbeddingModel embeddingModel, ObservationRegistry observationRegistry, @Nullable VectorStoreObservationConvention customObservationConvention) { this.embeddingModel = embeddingModel; diff --git a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/observation/VectorStoreObservationContext.java b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/observation/VectorStoreObservationContext.java index b02dca46247..dbd61435bab 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/observation/VectorStoreObservationContext.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/observation/VectorStoreObservationContext.java @@ -220,69 +220,6 @@ public Builder similarityMetric(String similarityMetric) { return this; } - /** - * @deprecated use {@link #collectionName(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withCollectionName(String collectionName) { - this.context.setCollectionName(collectionName); - return this; - } - - /** - * @deprecated use {@link #dimensions(Integer)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withDimensions(Integer dimensions) { - this.context.setDimensions(dimensions); - return this; - } - - /** - * @deprecated use {@link #fieldName(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withFieldName(@Nullable String fieldName) { - this.context.setFieldName(fieldName); - return this; - } - - /** - * @deprecated use {@link #namespace(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withNamespace(String namespace) { - this.context.setNamespace(namespace); - return this; - } - - /** - * @deprecated use {@link #queryRequest(SearchRequest)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withQueryRequest(SearchRequest request) { - this.context.setQueryRequest(request); - return this; - } - - /** - * @deprecated use {@link #queryResponse(List)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withQueryResponse(List documents) { - this.context.setQueryResponse(documents); - return this; - } - - /** - * @deprecated use {@link #similarityMetric(String)} instead. - */ - @Deprecated(forRemoval = true, since = "1.0.0-M5") - public Builder withSimilarityMetric(String similarityMetric) { - this.context.setSimilarityMetric(similarityMetric); - return this; - } - public VectorStoreObservationContext build() { return this.context; } diff --git a/spring-ai-core/src/test/java/org/springframework/ai/document/ContentFormatterTests.java b/spring-ai-core/src/test/java/org/springframework/ai/document/ContentFormatterTests.java index 2e3574d5370..e71daba9a43 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/document/ContentFormatterTests.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/document/ContentFormatterTests.java @@ -32,7 +32,7 @@ public class ContentFormatterTests { @Test public void noExplicitlySetFormatter() { - assertThat(this.document.getContent()).isEqualTo(""" + assertThat(this.document.getText()).isEqualTo(""" The World is Big and Salvation Lurks Around the Corner"""); assertThat(this.document.getFormattedContent()).isEqualTo(this.document.getFormattedContent(MetadataMode.ALL)); diff --git a/spring-ai-core/src/test/java/org/springframework/ai/document/DocumentBuilderTests.java b/spring-ai-core/src/test/java/org/springframework/ai/document/DocumentBuilderTests.java index ca89c1e2472..bdb2a52df74 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/document/DocumentBuilderTests.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/document/DocumentBuilderTests.java @@ -93,7 +93,7 @@ void testWithContent() { Document.Builder result = this.builder.text("Test content"); assertThat(result).isSameAs(this.builder); - assertThat(result.build().getContent()).isEqualTo("Test content"); + assertThat(result.build().getText()).isEqualTo("Test content"); } @Test @@ -152,7 +152,7 @@ void testBuildWithoutId() { Document document = this.builder.text("text").text("Test content").build(); assertThat(document.getId()).isNotNull().isNotEmpty(); - assertThat(document.getContent()).isEqualTo("Test content"); + assertThat(document.getText()).isEqualTo("Test content"); } @Test diff --git a/spring-ai-core/src/test/java/org/springframework/ai/reader/JsonReaderTests.java b/spring-ai-core/src/test/java/org/springframework/ai/reader/JsonReaderTests.java index af7aa19d7f9..77a69a2c39e 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/reader/JsonReaderTests.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/reader/JsonReaderTests.java @@ -46,7 +46,7 @@ void loadJsonArray() { List documents = jsonReader.get(); assertThat(documents).isNotEmpty(); for (Document document : documents) { - assertThat(document.getContent()).isNotEmpty(); + assertThat(document.getText()).isNotEmpty(); } } @@ -57,7 +57,7 @@ void loadJsonObject() { List documents = jsonReader.get(); assertThat(documents).isNotEmpty(); for (Document document : documents) { - assertThat(document.getContent()).isNotEmpty(); + assertThat(document.getText()).isNotEmpty(); } } @@ -68,8 +68,8 @@ void loadJsonArrayFromPointer() { List documents = jsonReader.get("/0/sessions"); assertThat(documents).isNotEmpty(); for (Document document : documents) { - assertThat(document.getContent()).isNotEmpty(); - assertThat(document.getContent()).contains("Session"); + assertThat(document.getText()).isNotEmpty(); + assertThat(document.getText()).contains("Session"); } } @@ -80,7 +80,7 @@ void loadJsonObjectFromPointer() { List documents = jsonReader.get("/store"); assertThat(documents).isNotEmpty(); assertThat(documents.size()).isEqualTo(1); - assertThat(documents.get(0).getContent()).contains("name: Bike Shop"); + assertThat(documents.get(0).getText()).contains("name: Bike Shop"); } } diff --git a/spring-ai-core/src/test/java/org/springframework/ai/reader/TextReaderTests.java b/spring-ai-core/src/test/java/org/springframework/ai/reader/TextReaderTests.java index 835d17f777a..c12851accf7 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/reader/TextReaderTests.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/reader/TextReaderTests.java @@ -52,7 +52,7 @@ void loadText() { assertThat(document.getMetadata().get("customKey")).isEqualTo("Value"); assertThat(document.getMetadata().get(TextReader.SOURCE_METADATA)).isEqualTo("text_source.txt"); assertThat(document.getMetadata().get(TextReader.CHARSET_METADATA)).isEqualTo("UTF-8"); - assertThat(document.getContent()).isNotEmpty(); + assertThat(document.getText()).isNotEmpty(); } } @@ -76,7 +76,7 @@ void loadTextFromByteArrayResource() { assertThat(defaultDocument.getMetadata().get(TextReader.SOURCE_METADATA)) .isEqualTo("Byte array resource [resource loaded from byte array]"); - assertThat(defaultDocument.getContent()).isEqualTo("Test content"); + assertThat(defaultDocument.getText()).isEqualTo("Test content"); // Test with custom description constructor String customDescription = "Custom byte array resource"; @@ -98,7 +98,7 @@ void loadTextFromByteArrayResource() { assertThat(customDocument.getMetadata().get(TextReader.SOURCE_METADATA)) .isEqualTo("Byte array resource [Custom byte array resource]"); - assertThat(customDocument.getContent()).isEqualTo("Another test content"); + assertThat(customDocument.getText()).isEqualTo("Another test content"); } } diff --git a/spring-ai-core/src/test/java/org/springframework/ai/transformer/splitter/TextSplitterTests.java b/spring-ai-core/src/test/java/org/springframework/ai/transformer/splitter/TextSplitterTests.java index c3172380dac..88fee22e92d 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/transformer/splitter/TextSplitterTests.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/transformer/splitter/TextSplitterTests.java @@ -73,13 +73,13 @@ public void testSplitText() { assertThat(chunks).hasSize(4); // Doc1 chunks: - assertThat(chunks.get(0).getContent()).isEqualTo("In the end, writing arises when man"); - assertThat(chunks.get(1).getContent()).isEqualTo(" realizes that memory is not enough."); + assertThat(chunks.get(0).getText()).isEqualTo("In the end, writing arises when man"); + assertThat(chunks.get(1).getText()).isEqualTo(" realizes that memory is not enough."); // Doc2 chunks: - assertThat(chunks.get(2).getContent()) + assertThat(chunks.get(2).getText()) .isEqualTo("The most oppressive thing about the labyrinth is that you are constantly being forced to "); - assertThat(chunks.get(3).getContent()) + assertThat(chunks.get(3).getText()) .isEqualTo("choose. It isn’t the lack of an exit, but the abundance of exits that is so disorienting."); // Verify that the same, merged metadata is copied to all chunks. @@ -233,8 +233,8 @@ public void testSplitTextWithNullMetadata() { assertThat(chunks).hasSize(2); // Doc chunks: - assertThat(chunks.get(0).getContent()).isEqualTo("In the end, writing arises when man"); - assertThat(chunks.get(1).getContent()).isEqualTo(" realizes that memory is not enough."); + assertThat(chunks.get(0).getText()).isEqualTo("In the end, writing arises when man"); + assertThat(chunks.get(1).getText()).isEqualTo(" realizes that memory is not enough."); // Verify that the same, merged metadata is copied to all chunks. assertThat(chunks.get(0).getMetadata()).isEqualTo(chunks.get(1).getMetadata()); diff --git a/spring-ai-core/src/test/java/org/springframework/ai/transformer/splitter/TokenTextSplitterTest.java b/spring-ai-core/src/test/java/org/springframework/ai/transformer/splitter/TokenTextSplitterTest.java index c30225b5cca..e803c8a4e40 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/transformer/splitter/TokenTextSplitterTest.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/transformer/splitter/TokenTextSplitterTest.java @@ -55,10 +55,10 @@ public void testTokenTextSplitterBuilderWithDefaultValues() { assertThat(chunks.size()).isEqualTo(2); // Doc 1 - assertThat(chunks.get(0).getContent()) + assertThat(chunks.get(0).getText()) .isEqualTo("In the end, writing arises when man realizes that memory is not enough."); // Doc 2 - assertThat(chunks.get(1).getContent()).isEqualTo( + assertThat(chunks.get(1).getText()).isEqualTo( "The most oppressive thing about the labyrinth is that you are constantly being forced to choose. It isn’t the lack of an exit, but the abundance of exits that is so disorienting."); assertThat(chunks.get(0).getMetadata()).containsKeys("key1", "key2").doesNotContainKeys("key3"); @@ -95,14 +95,14 @@ public void testTokenTextSplitterBuilderWithAllFields() { assertThat(chunks.size()).isEqualTo(6); // Doc 1 - assertThat(chunks.get(0).getContent()).isEqualTo("In the end, writing arises when man realizes that"); - assertThat(chunks.get(1).getContent()).isEqualTo("memory is not enough."); + assertThat(chunks.get(0).getText()).isEqualTo("In the end, writing arises when man realizes that"); + assertThat(chunks.get(1).getText()).isEqualTo("memory is not enough."); // Doc 2 - assertThat(chunks.get(2).getContent()).isEqualTo("The most oppressive thing about the labyrinth is that you"); - assertThat(chunks.get(3).getContent()).isEqualTo("are constantly being forced to choose."); - assertThat(chunks.get(4).getContent()).isEqualTo("It isn’t the lack of an exit, but"); - assertThat(chunks.get(5).getContent()).isEqualTo("the abundance of exits that is so disorienting"); + assertThat(chunks.get(2).getText()).isEqualTo("The most oppressive thing about the labyrinth is that you"); + assertThat(chunks.get(3).getText()).isEqualTo("are constantly being forced to choose."); + assertThat(chunks.get(4).getText()).isEqualTo("It isn’t the lack of an exit, but"); + assertThat(chunks.get(5).getText()).isEqualTo("the abundance of exits that is so disorienting"); // Verify that the same, merged metadata is copied to all chunks. assertThat(chunks.get(0).getMetadata()).isEqualTo(chunks.get(1).getMetadata()); diff --git a/spring-ai-core/src/test/java/org/springframework/ai/vectorstore/SimpleVectorStoreSimilarityTests.java b/spring-ai-core/src/test/java/org/springframework/ai/vectorstore/SimpleVectorStoreSimilarityTests.java index 499d0269af1..895dee54a6a 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/vectorstore/SimpleVectorStoreSimilarityTests.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/vectorstore/SimpleVectorStoreSimilarityTests.java @@ -42,7 +42,7 @@ public void testSimilarity() { Document document = storeContent.toDocument(0.6); assertThat(document).isNotNull(); assertThat(document.getId()).isEqualTo("1"); - assertThat(document.getContent()).isEqualTo("hello, how are you?"); + assertThat(document.getText()).isEqualTo("hello, how are you?"); assertThat(document.getMetadata().get("foo")).isEqualTo("bar"); } diff --git a/spring-ai-core/src/test/java/org/springframework/ai/vectorstore/SimpleVectorStoreTests.java b/spring-ai-core/src/test/java/org/springframework/ai/vectorstore/SimpleVectorStoreTests.java index 94d9f77c59c..1aba11dbef5 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/vectorstore/SimpleVectorStoreTests.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/vectorstore/SimpleVectorStoreTests.java @@ -69,7 +69,7 @@ void shouldAddAndRetrieveDocument() { List results = this.vectorStore.similaritySearch("test content"); assertThat(results).hasSize(1).first().satisfies(result -> { assertThat(result.getId()).isEqualTo("1"); - assertThat(result.getContent()).isEqualTo("test content"); + assertThat(result.getText()).isEqualTo("test content"); assertThat(result.getMetadata()).containsEntry("key", "value"); }); } @@ -150,7 +150,7 @@ void shouldSaveAndLoadVectorStore() throws IOException { List results = loadedStore.similaritySearch("test content"); assertThat(results).hasSize(1).first().satisfies(result -> { assertThat(result.getId()).isEqualTo("1"); - assertThat(result.getContent()).isEqualTo("test content"); + assertThat(result.getText()).isEqualTo("test content"); assertThat(result.getMetadata()).containsEntry("key", "value"); }); } @@ -208,7 +208,7 @@ void shouldHandleConcurrentOperations() throws InterruptedException { assertThat(resultIds).containsExactlyInAnyOrderElementsOf(expectedIds); // Verify content integrity - results.forEach(doc -> assertThat(doc.getContent()).isEqualTo("content " + doc.getId())); + results.forEach(doc -> assertThat(doc.getText()).isEqualTo("content " + doc.getId())); } @Test diff --git a/spring-ai-integration-tests/src/test/java/org/springframework/ai/integration/tests/vectorstore/SimpleVectorStoreIT.java b/spring-ai-integration-tests/src/test/java/org/springframework/ai/integration/tests/vectorstore/SimpleVectorStoreIT.java index 24e3b3e6e6c..98086f898e8 100644 --- a/spring-ai-integration-tests/src/test/java/org/springframework/ai/integration/tests/vectorstore/SimpleVectorStoreIT.java +++ b/spring-ai-integration-tests/src/test/java/org/springframework/ai/integration/tests/vectorstore/SimpleVectorStoreIT.java @@ -95,7 +95,7 @@ public void searchWithThreshold() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -112,7 +112,7 @@ public void searchWithThreshold() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/azure/AzureVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/azure/AzureVectorStoreAutoConfigurationIT.java index cd579328edf..edf6d3a2ce7 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/azure/AzureVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/azure/AzureVectorStoreAutoConfigurationIT.java @@ -123,7 +123,7 @@ public void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKeys("spring", "distance"); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/cassandra/CassandraVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/cassandra/CassandraVectorStoreAutoConfigurationIT.java index 0a658b11338..fbef9287bae 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/cassandra/CassandraVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/cassandra/CassandraVectorStoreAutoConfigurationIT.java @@ -92,7 +92,7 @@ void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertObservationRegistry(observationRegistry, VectorStoreProvider.CASSANDRA, diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/elasticsearch/ElasticsearchVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/elasticsearch/ElasticsearchVectorStoreAutoConfigurationIT.java index 472fbfeef7d..cb7d1d990c7 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/elasticsearch/ElasticsearchVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/elasticsearch/ElasticsearchVectorStoreAutoConfigurationIT.java @@ -100,7 +100,7 @@ public void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey("distance"); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/gemfire/GemFireVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/gemfire/GemFireVectorStoreAutoConfigurationIT.java index 27df7555dee..28765a6f3a8 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/gemfire/GemFireVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/gemfire/GemFireVectorStoreAutoConfigurationIT.java @@ -167,7 +167,7 @@ public void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKeys("spring", "distance"); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/milvus/MilvusVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/milvus/MilvusVectorStoreAutoConfigurationIT.java index 3cdc8b72a3b..ef27d5564ea 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/milvus/MilvusVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/milvus/MilvusVectorStoreAutoConfigurationIT.java @@ -89,7 +89,7 @@ public void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKeys("spring", "distance"); @@ -141,7 +141,7 @@ public void searchWithCustomFields() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKeys("spring", "distance"); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/mongo/MongoDBAtlasVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/mongo/MongoDBAtlasVectorStoreAutoConfigurationIT.java index acc07ff4ceb..c374f116523 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/mongo/MongoDBAtlasVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/mongo/MongoDBAtlasVectorStoreAutoConfigurationIT.java @@ -107,7 +107,7 @@ public void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).isEqualTo( + assertThat(resultDoc.getText()).isEqualTo( "Great Depression Great Depression Great Depression Great Depression Great Depression Great Depression"); assertThat(resultDoc.getMetadata()).containsEntry("meta2", "meta2"); @@ -143,7 +143,7 @@ public void addAndSearchWithFilters() { List results = vectorStore .similaritySearch(SearchRequest.builder().query("Testcontainers").topK(2).build()); assertThat(results).hasSize(2); - results.forEach(doc -> assertThat(doc.getContent().contains("Testcontainers")).isTrue()); + results.forEach(doc -> assertThat(doc.getText().contains("Testcontainers")).isTrue()); FilterExpressionBuilder b = new FilterExpressionBuilder(); results = vectorStore.similaritySearch(SearchRequest.builder() @@ -155,7 +155,7 @@ public void addAndSearchWithFilters() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(3).getId()); - assertThat(resultDoc.getContent().contains("Testcontainers")).isTrue(); + assertThat(resultDoc.getText().contains("Testcontainers")).isTrue(); assertThat(resultDoc.getMetadata()).containsEntry("foo", "bar"); context.getBean(MongoTemplate.class).dropCollection("test_collection"); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/neo4j/Neo4jVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/neo4j/Neo4jVectorStoreAutoConfigurationIT.java index 4e18a8be2d0..074b923be8a 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/neo4j/Neo4jVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/neo4j/Neo4jVectorStoreAutoConfigurationIT.java @@ -95,7 +95,7 @@ void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertObservationRegistry(observationRegistry, VectorStoreProvider.NEO4J, diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/opensearch/AwsOpenSearchVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/opensearch/AwsOpenSearchVectorStoreAutoConfigurationIT.java index 877fdd6d92c..5b14d68e888 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/opensearch/AwsOpenSearchVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/opensearch/AwsOpenSearchVectorStoreAutoConfigurationIT.java @@ -123,7 +123,7 @@ public void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey("distance"); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/opensearch/OpenSearchVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/opensearch/OpenSearchVectorStoreAutoConfigurationIT.java index 88fd264c70f..0a4ea7d0b5a 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/opensearch/OpenSearchVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/opensearch/OpenSearchVectorStoreAutoConfigurationIT.java @@ -123,7 +123,7 @@ public void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey("distance"); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/pinecone/PineconeVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/pinecone/PineconeVectorStoreAutoConfigurationIT.java index 1d6742c97ba..7ae2f53e8d8 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/pinecone/PineconeVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/pinecone/PineconeVectorStoreAutoConfigurationIT.java @@ -109,7 +109,7 @@ public void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKeys("spring", "customDistanceField"); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/redis/RedisVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/redis/RedisVectorStoreAutoConfigurationIT.java index 6bddfe08255..de40037c99c 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/redis/RedisVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/redis/RedisVectorStoreAutoConfigurationIT.java @@ -87,7 +87,7 @@ void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertObservationRegistry(observationRegistry, VectorStoreProvider.REDIS, diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/typesense/TypesenseVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/typesense/TypesenseVectorStoreAutoConfigurationIT.java index 32cbc7fb778..0911534efc7 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/typesense/TypesenseVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/typesense/TypesenseVectorStoreAutoConfigurationIT.java @@ -93,7 +93,7 @@ public void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKeys("spring", "distance"); diff --git a/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/milvus/MilvusContainerConnectionDetailsFactoryIT.java b/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/milvus/MilvusContainerConnectionDetailsFactoryIT.java index f2227058ddc..c148932b9fa 100644 --- a/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/milvus/MilvusContainerConnectionDetailsFactoryIT.java +++ b/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/milvus/MilvusContainerConnectionDetailsFactoryIT.java @@ -71,7 +71,7 @@ public void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()) + assertThat(resultDoc.getText()) .contains("Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKeys("spring", "distance"); diff --git a/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/mongo/MongoDbAtlasLocalContainerConnectionDetailsFactoryIT.java b/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/mongo/MongoDbAtlasLocalContainerConnectionDetailsFactoryIT.java index 3fba05b8b57..2324171213c 100644 --- a/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/mongo/MongoDbAtlasLocalContainerConnectionDetailsFactoryIT.java +++ b/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/mongo/MongoDbAtlasLocalContainerConnectionDetailsFactoryIT.java @@ -81,7 +81,7 @@ public void addAndSearch() throws InterruptedException { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(documents.get(2).getId()); - assertThat(resultDoc.getContent()).isEqualTo( + assertThat(resultDoc.getText()).isEqualTo( "Great Depression Great Depression Great Depression Great Depression Great Depression Great Depression"); assertThat(resultDoc.getMetadata()).containsEntry("meta2", "meta2"); diff --git a/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/opensearch/AwsOpenSearchContainerConnectionDetailsFactoryIT.java b/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/opensearch/AwsOpenSearchContainerConnectionDetailsFactoryIT.java index fa4fca7cfb8..9f7a7065904 100644 --- a/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/opensearch/AwsOpenSearchContainerConnectionDetailsFactoryIT.java +++ b/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/opensearch/AwsOpenSearchContainerConnectionDetailsFactoryIT.java @@ -110,7 +110,7 @@ public void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey("distance"); diff --git a/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/opensearch/OpenSearchContainerConnectionDetailsFactoryIT.java b/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/opensearch/OpenSearchContainerConnectionDetailsFactoryIT.java index 1e5e92eff82..b448ed1bdce 100644 --- a/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/opensearch/OpenSearchContainerConnectionDetailsFactoryIT.java +++ b/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/opensearch/OpenSearchContainerConnectionDetailsFactoryIT.java @@ -90,7 +90,7 @@ public void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey("distance"); diff --git a/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/typesense/TypesenseContainerConnectionDetailsFactoryIT.java b/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/typesense/TypesenseContainerConnectionDetailsFactoryIT.java index 408a8cb30e3..9ba47d474b2 100644 --- a/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/typesense/TypesenseContainerConnectionDetailsFactoryIT.java +++ b/spring-ai-spring-boot-testcontainers/src/test/java/org/springframework/ai/testcontainers/service/connection/typesense/TypesenseContainerConnectionDetailsFactoryIT.java @@ -76,7 +76,7 @@ public void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()) + assertThat(resultDoc.getText()) .contains("Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKeys("spring", "distance"); diff --git a/vector-stores/spring-ai-azure-store/src/test/java/org/springframework/ai/vectorstore/azure/AzureVectorStoreIT.java b/vector-stores/spring-ai-azure-store/src/test/java/org/springframework/ai/vectorstore/azure/AzureVectorStoreIT.java index 24df9388c6e..862a52979d7 100644 --- a/vector-stores/spring-ai-azure-store/src/test/java/org/springframework/ai/vectorstore/azure/AzureVectorStoreIT.java +++ b/vector-stores/spring-ai-azure-store/src/test/java/org/springframework/ai/vectorstore/azure/AzureVectorStoreIT.java @@ -103,7 +103,7 @@ public void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -241,7 +241,7 @@ public void documentUpdateTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -254,7 +254,7 @@ public void documentUpdateTest() { SearchRequest fooBarSearchRequest = SearchRequest.builder().query("FooBar").topK(5).build(); Awaitility.await() - .until(() -> vectorStore.similaritySearch(fooBarSearchRequest).get(0).getContent(), + .until(() -> vectorStore.similaritySearch(fooBarSearchRequest).get(0).getText(), equalTo("The World is Big and Salvation Lurks Around the Corner")); results = vectorStore.similaritySearch(fooBarSearchRequest); @@ -262,7 +262,7 @@ public void documentUpdateTest() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -305,7 +305,7 @@ public void searchThresholdTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); assertThat(resultDoc.getScore()).isGreaterThanOrEqualTo(similarityThreshold); diff --git a/vector-stores/spring-ai-cassandra-store/src/test/java/org/springframework/ai/vectorstore/cassandra/CassandraRichSchemaVectorStoreIT.java b/vector-stores/spring-ai-cassandra-store/src/test/java/org/springframework/ai/vectorstore/cassandra/CassandraRichSchemaVectorStoreIT.java index 6a5cfb8bb9b..e85a844c047 100644 --- a/vector-stores/spring-ai-cassandra-store/src/test/java/org/springframework/ai/vectorstore/cassandra/CassandraRichSchemaVectorStoreIT.java +++ b/vector-stores/spring-ai-cassandra-store/src/test/java/org/springframework/ai/vectorstore/cassandra/CassandraRichSchemaVectorStoreIT.java @@ -227,7 +227,7 @@ void addAndSearch() { Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains("Neptunes gravity makes its atmosphere"); + assertThat(resultDoc.getText()).contains("Neptunes gravity makes its atmosphere"); assertThat(resultDoc.getMetadata()).hasSize(3); @@ -490,7 +490,7 @@ void documentUpdate() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); - assertThat(resultDoc.getContent()).contains(URANUS_ORBIT_QUERY); + assertThat(resultDoc.getText()).contains(URANUS_ORBIT_QUERY); assertThat(resultDoc.getMetadata()).containsKey("revision"); String newContent = "The World is Big and Salvation Lurks Around the Corner"; @@ -523,7 +523,7 @@ void documentUpdate() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isNotEqualTo(sameIdDocument.getId()); - assertThat(resultDoc.getContent()).doesNotContain(newContent); + assertThat(resultDoc.getText()).doesNotContain(newContent); assertThat(resultDoc.getMetadata()).containsKeys("id", "revision", DocumentMetadata.DISTANCE.value()); } @@ -555,7 +555,7 @@ void searchWithThreshold() { Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(documents.get(1).getId()); - assertThat(resultDoc.getContent()).contains(URANUS_ORBIT_QUERY); + assertThat(resultDoc.getText()).contains(URANUS_ORBIT_QUERY); assertThat(resultDoc.getMetadata()).containsKeys("id", "revision", DocumentMetadata.DISTANCE.value()); assertThat(resultDoc.getScore()).isGreaterThanOrEqualTo(similarityThreshold); diff --git a/vector-stores/spring-ai-cassandra-store/src/test/java/org/springframework/ai/vectorstore/cassandra/CassandraVectorStoreIT.java b/vector-stores/spring-ai-cassandra-store/src/test/java/org/springframework/ai/vectorstore/cassandra/CassandraVectorStoreIT.java index 0e4e13fc1a2..1168c7e4533 100644 --- a/vector-stores/spring-ai-cassandra-store/src/test/java/org/springframework/ai/vectorstore/cassandra/CassandraVectorStoreIT.java +++ b/vector-stores/spring-ai-cassandra-store/src/test/java/org/springframework/ai/vectorstore/cassandra/CassandraVectorStoreIT.java @@ -132,7 +132,7 @@ void addAndSearch() { Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(documents().get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); @@ -165,7 +165,7 @@ void addAndSearchReturnEmbeddings() { Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(documents().get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(1); @@ -361,7 +361,7 @@ void documentUpdate() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); Document sameIdDocument = new Document(document.getId(), @@ -375,7 +375,7 @@ void documentUpdate() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKeys("meta2", DocumentMetadata.DISTANCE.value()); store.delete(List.of(document.getId())); @@ -408,7 +408,7 @@ void searchWithThreshold() { Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(documents().get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).containsKeys("meta1", DocumentMetadata.DISTANCE.value()); diff --git a/vector-stores/spring-ai-chroma-store/src/test/java/org/springframework/ai/chroma/vectorstore/ChromaVectorStoreIT.java b/vector-stores/spring-ai-chroma-store/src/test/java/org/springframework/ai/chroma/vectorstore/ChromaVectorStoreIT.java index a0371aae6f8..113903b797c 100644 --- a/vector-stores/spring-ai-chroma-store/src/test/java/org/springframework/ai/chroma/vectorstore/ChromaVectorStoreIT.java +++ b/vector-stores/spring-ai-chroma-store/src/test/java/org/springframework/ai/chroma/vectorstore/ChromaVectorStoreIT.java @@ -82,7 +82,7 @@ public void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).isEqualTo( + assertThat(resultDoc.getText()).isEqualTo( "Great Depression Great Depression Great Depression Great Depression Great Depression Great Depression"); assertThat(resultDoc.getMetadata()).containsKeys("meta2", DocumentMetadata.DISTANCE.value()); @@ -114,7 +114,7 @@ public void simpleSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The sky is blue because of Rayleigh scattering."); + assertThat(resultDoc.getText()).isEqualTo("The sky is blue because of Rayleigh scattering."); // Remove all documents from the store assertThat(vectorStore.delete(List.of(document.getId()))).isEqualTo(Optional.of(Boolean.TRUE)); @@ -188,7 +188,7 @@ public void documentUpdateTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -203,7 +203,7 @@ public void documentUpdateTest() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -237,7 +237,7 @@ public void searchThresholdTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).isEqualTo( + assertThat(resultDoc.getText()).isEqualTo( "Great Depression Great Depression Great Depression Great Depression Great Depression Great Depression"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); diff --git a/vector-stores/spring-ai-coherence-store/src/test/java/org/springframework/ai/vectorstore/coherence/CoherenceVectorStoreIT.java b/vector-stores/spring-ai-coherence-store/src/test/java/org/springframework/ai/vectorstore/coherence/CoherenceVectorStoreIT.java index 309b92f9947..32739a36152 100644 --- a/vector-stores/spring-ai-coherence-store/src/test/java/org/springframework/ai/vectorstore/coherence/CoherenceVectorStoreIT.java +++ b/vector-stores/spring-ai-coherence-store/src/test/java/org/springframework/ai/vectorstore/coherence/CoherenceVectorStoreIT.java @@ -235,7 +235,7 @@ public void documentUpdate() { Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKeys("meta1", DocumentMetadata.DISTANCE.value()); Document sameIdDocument = new Document(document.getId(), @@ -248,7 +248,7 @@ public void documentUpdate() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKeys("meta2", DocumentMetadata.DISTANCE.value()); truncateMap(context, ((CoherenceVectorStore) vectorStore).getMapName()); diff --git a/vector-stores/spring-ai-elasticsearch-store/src/test/java/org/springframework/ai/vectorstore/elasticsearch/ElasticsearchVectorStoreIT.java b/vector-stores/spring-ai-elasticsearch-store/src/test/java/org/springframework/ai/vectorstore/elasticsearch/ElasticsearchVectorStoreIT.java index 04ebc0bbd93..a6bebd77280 100644 --- a/vector-stores/spring-ai-elasticsearch-store/src/test/java/org/springframework/ai/vectorstore/elasticsearch/ElasticsearchVectorStoreIT.java +++ b/vector-stores/spring-ai-elasticsearch-store/src/test/java/org/springframework/ai/vectorstore/elasticsearch/ElasticsearchVectorStoreIT.java @@ -164,7 +164,7 @@ public void addAndSearchTest(String similarityFunction) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -316,7 +316,7 @@ public void documentUpdateTest(String similarityFunction) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -331,7 +331,7 @@ public void documentUpdateTest(String similarityFunction) { .build(); Awaitility.await() - .until(() -> vectorStore.similaritySearch(fooBarSearchRequest).get(0).getContent(), + .until(() -> vectorStore.similaritySearch(fooBarSearchRequest).get(0).getText(), equalTo("The World is Big and Salvation Lurks Around the Corner")); results = vectorStore.similaritySearch(fooBarSearchRequest); @@ -339,7 +339,7 @@ public void documentUpdateTest(String similarityFunction) { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -385,7 +385,7 @@ public void searchThresholdTest(String similarityFunction) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); assertThat(resultDoc.getScore()).isGreaterThanOrEqualTo(similarityThreshold); diff --git a/vector-stores/spring-ai-gemfire-store/src/test/java/org/springframework/ai/vectorstore/gemfire/GemFireVectorStoreIT.java b/vector-stores/spring-ai-gemfire-store/src/test/java/org/springframework/ai/vectorstore/gemfire/GemFireVectorStoreIT.java index 94c4702975a..9bbecf30cb0 100644 --- a/vector-stores/spring-ai-gemfire-store/src/test/java/org/springframework/ai/vectorstore/gemfire/GemFireVectorStoreIT.java +++ b/vector-stores/spring-ai-gemfire-store/src/test/java/org/springframework/ai/vectorstore/gemfire/GemFireVectorStoreIT.java @@ -135,7 +135,7 @@ public void addAndSearchTest() { .similaritySearch(SearchRequest.builder().query("Great Depression").topK(5).build()); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939)" + " was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939)" + " was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -158,7 +158,7 @@ public void documentUpdateTest() { List results = vectorStore.similaritySearch(springSearchRequest); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -173,7 +173,7 @@ public void documentUpdateTest() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation" + " Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation" + " Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); }); @@ -209,7 +209,7 @@ public void searchThresholdTest() { Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression " + "(1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression " + "(1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); assertThat(resultDoc.getScore()).isGreaterThanOrEqualTo(similarityThreshold); diff --git a/vector-stores/spring-ai-hanadb-store/src/test/java/org/springframework/ai/vectorstore/hanadb/HanaCloudVectorStoreIT.java b/vector-stores/spring-ai-hanadb-store/src/test/java/org/springframework/ai/vectorstore/hanadb/HanaCloudVectorStoreIT.java index 6a4131f3475..8f0f1d488d1 100644 --- a/vector-stores/spring-ai-hanadb-store/src/test/java/org/springframework/ai/vectorstore/hanadb/HanaCloudVectorStoreIT.java +++ b/vector-stores/spring-ai-hanadb-store/src/test/java/org/springframework/ai/vectorstore/hanadb/HanaCloudVectorStoreIT.java @@ -74,7 +74,7 @@ public void vectorStoreTest() { List results = vectorStore.similaritySearch("Who won the 2023 cricket world cup finals?"); Assertions.assertEquals(1, results.size()); - Assertions.assertTrue(results.get(0).getContent().contains("Australia")); + Assertions.assertTrue(results.get(0).getText().contains("Australia")); // Remove all documents from the store vectorStore.delete(documents.stream().map(Document::getId).toList()); diff --git a/vector-stores/spring-ai-mariadb-store/src/test/java/org/springframework/ai/vectorstore/mariadb/MariaDBStoreIT.java b/vector-stores/spring-ai-mariadb-store/src/test/java/org/springframework/ai/vectorstore/mariadb/MariaDBStoreIT.java index c2d01991c93..e1875f6290f 100644 --- a/vector-stores/spring-ai-mariadb-store/src/test/java/org/springframework/ai/vectorstore/mariadb/MariaDBStoreIT.java +++ b/vector-stores/spring-ai-mariadb-store/src/test/java/org/springframework/ai/vectorstore/mariadb/MariaDBStoreIT.java @@ -299,7 +299,7 @@ public void documentUpdate(String distanceType) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKeys("meta1", "distance"); Document sameIdDocument = new Document(document.getId(), @@ -313,7 +313,7 @@ public void documentUpdate(String distanceType) { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKeys("meta2", "distance"); dropTable(context); diff --git a/vector-stores/spring-ai-milvus-store/src/test/java/org/springframework/ai/vectorstore/milvus/MilvusVectorStoreCustomFieldNamesIT.java b/vector-stores/spring-ai-milvus-store/src/test/java/org/springframework/ai/vectorstore/milvus/MilvusVectorStoreCustomFieldNamesIT.java index fea2fd53f79..757b5cba889 100644 --- a/vector-stores/spring-ai-milvus-store/src/test/java/org/springframework/ai/vectorstore/milvus/MilvusVectorStoreCustomFieldNamesIT.java +++ b/vector-stores/spring-ai-milvus-store/src/test/java/org/springframework/ai/vectorstore/milvus/MilvusVectorStoreCustomFieldNamesIT.java @@ -117,7 +117,7 @@ void searchWithCustomFieldNames(String metricType) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(String.valueOf(resultDoc.getId())).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).containsKeys("meta1", "distance"); @@ -158,7 +158,7 @@ void searchWithoutMetadataFieldOverride(String metricType) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(String.valueOf(resultDoc.getId())).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).containsKeys("meta1", "distance"); @@ -202,7 +202,7 @@ void searchWithAutoIdEnabled(String metricType) { Document resultDoc = results.get(0); // Verify that the auto ID is used assertThat(String.valueOf(resultDoc.getId())).isNotEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).containsKeys("meta1", "distance"); diff --git a/vector-stores/spring-ai-milvus-store/src/test/java/org/springframework/ai/vectorstore/milvus/MilvusVectorStoreIT.java b/vector-stores/spring-ai-milvus-store/src/test/java/org/springframework/ai/vectorstore/milvus/MilvusVectorStoreIT.java index 24cb4cceb99..bf8610f333f 100644 --- a/vector-stores/spring-ai-milvus-store/src/test/java/org/springframework/ai/vectorstore/milvus/MilvusVectorStoreIT.java +++ b/vector-stores/spring-ai-milvus-store/src/test/java/org/springframework/ai/vectorstore/milvus/MilvusVectorStoreIT.java @@ -106,7 +106,7 @@ public void addAndSearch(String metricType) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKeys("meta1", DocumentMetadata.DISTANCE.value()); @@ -211,7 +211,7 @@ public void documentUpdate(String metricType) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -226,7 +226,7 @@ public void documentUpdate(String metricType) { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -266,7 +266,7 @@ public void searchWithThreshold(String metricType) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).containsKeys("meta1", DocumentMetadata.DISTANCE.value()); assertThat(resultDoc.getScore()).isGreaterThanOrEqualTo(similarityThreshold); diff --git a/vector-stores/spring-ai-mongodb-atlas-store/src/test/java/org/springframework/ai/vectorstore/mongodb/atlas/MongoDBAtlasVectorStoreIT.java b/vector-stores/spring-ai-mongodb-atlas-store/src/test/java/org/springframework/ai/vectorstore/mongodb/atlas/MongoDBAtlasVectorStoreIT.java index 810b750f750..1276b89b898 100644 --- a/vector-stores/spring-ai-mongodb-atlas-store/src/test/java/org/springframework/ai/vectorstore/mongodb/atlas/MongoDBAtlasVectorStoreIT.java +++ b/vector-stores/spring-ai-mongodb-atlas-store/src/test/java/org/springframework/ai/vectorstore/mongodb/atlas/MongoDBAtlasVectorStoreIT.java @@ -103,7 +103,7 @@ void vectorStoreTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(documents.get(2).getId()); - assertThat(resultDoc.getContent()).isEqualTo( + assertThat(resultDoc.getText()).isEqualTo( "Great Depression Great Depression Great Depression Great Depression Great Depression Great Depression"); assertThat(resultDoc.getMetadata()).containsEntry("meta2", "meta2"); @@ -134,7 +134,7 @@ void documentUpdateTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsEntry("meta1", "meta1"); Document sameIdDocument = new Document(document.getId(), @@ -148,7 +148,7 @@ void documentUpdateTest() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsEntry("meta2", "meta2"); }); } @@ -247,7 +247,7 @@ public void searchWithThreshold() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).containsKeys("meta1", DocumentMetadata.DISTANCE.value()); assertThat(resultDoc.getScore()).isGreaterThanOrEqualTo(similarityThreshold); diff --git a/vector-stores/spring-ai-neo4j-store/src/test/java/org/springframework/ai/vectorstore/neo4j/Neo4jVectorStoreIT.java b/vector-stores/spring-ai-neo4j-store/src/test/java/org/springframework/ai/vectorstore/neo4j/Neo4jVectorStoreIT.java index f8e160a5ac4..a96899b40ce 100644 --- a/vector-stores/spring-ai-neo4j-store/src/test/java/org/springframework/ai/vectorstore/neo4j/Neo4jVectorStoreIT.java +++ b/vector-stores/spring-ai-neo4j-store/src/test/java/org/springframework/ai/vectorstore/neo4j/Neo4jVectorStoreIT.java @@ -92,7 +92,7 @@ void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).isEqualTo( + assertThat(resultDoc.getText()).isEqualTo( "Great Depression Great Depression Great Depression Great Depression Great Depression Great Depression"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -221,7 +221,7 @@ void documentUpdateTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -236,7 +236,7 @@ void documentUpdateTest() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -267,7 +267,7 @@ void searchThresholdTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).isEqualTo( + assertThat(resultDoc.getText()).isEqualTo( "Great Depression Great Depression Great Depression Great Depression Great Depression Great Depression"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); diff --git a/vector-stores/spring-ai-opensearch-store/src/test/java/org/springframework/ai/vectorstore/opensearch/OpenSearchVectorStoreIT.java b/vector-stores/spring-ai-opensearch-store/src/test/java/org/springframework/ai/vectorstore/opensearch/OpenSearchVectorStoreIT.java index 39721fd68a5..047d1eeebda 100644 --- a/vector-stores/spring-ai-opensearch-store/src/test/java/org/springframework/ai/vectorstore/opensearch/OpenSearchVectorStoreIT.java +++ b/vector-stores/spring-ai-opensearch-store/src/test/java/org/springframework/ai/vectorstore/opensearch/OpenSearchVectorStoreIT.java @@ -144,7 +144,7 @@ public void addAndSearchTest(String similarityFunction) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -300,7 +300,7 @@ public void documentUpdateTest(String similarityFunction) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -311,7 +311,7 @@ public void documentUpdateTest(String similarityFunction) { SearchRequest fooBarSearchRequest = SearchRequest.builder().query("FooBar").topK(5).build(); Awaitility.await() - .until(() -> vectorStore.similaritySearch(fooBarSearchRequest).get(0).getContent(), + .until(() -> vectorStore.similaritySearch(fooBarSearchRequest).get(0).getText(), equalTo("The World is Big and Salvation Lurks Around the Corner")); results = vectorStore.similaritySearch(fooBarSearchRequest); @@ -319,7 +319,7 @@ public void documentUpdateTest(String similarityFunction) { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -368,7 +368,7 @@ public void searchThresholdTest(String similarityFunction) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); assertThat(resultDoc.getScore()).isGreaterThanOrEqualTo(similarityThreshold); diff --git a/vector-stores/spring-ai-opensearch-store/src/test/java/org/springframework/ai/vectorstore/opensearch/OpenSearchVectorStoreWithOllamaIT.java b/vector-stores/spring-ai-opensearch-store/src/test/java/org/springframework/ai/vectorstore/opensearch/OpenSearchVectorStoreWithOllamaIT.java index a7b454a7929..9a9b4860cfd 100644 --- a/vector-stores/spring-ai-opensearch-store/src/test/java/org/springframework/ai/vectorstore/opensearch/OpenSearchVectorStoreWithOllamaIT.java +++ b/vector-stores/spring-ai-opensearch-store/src/test/java/org/springframework/ai/vectorstore/opensearch/OpenSearchVectorStoreWithOllamaIT.java @@ -147,7 +147,7 @@ public void addAndSearchTest(String similarityFunction) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey("distance"); diff --git a/vector-stores/spring-ai-oracle-store/src/test/java/org/springframework/ai/vectorstore/oracle/OracleVectorStoreIT.java b/vector-stores/spring-ai-oracle-store/src/test/java/org/springframework/ai/vectorstore/oracle/OracleVectorStoreIT.java index 9523ee704f7..d43425233c3 100644 --- a/vector-stores/spring-ai-oracle-store/src/test/java/org/springframework/ai/vectorstore/oracle/OracleVectorStoreIT.java +++ b/vector-stores/spring-ai-oracle-store/src/test/java/org/springframework/ai/vectorstore/oracle/OracleVectorStoreIT.java @@ -255,7 +255,7 @@ public void documentUpdate(String distanceType) { Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKeys("meta1", DocumentMetadata.DISTANCE.value()); Document sameIdDocument = new Document(document.getId(), @@ -268,7 +268,7 @@ public void documentUpdate(String distanceType) { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKeys("meta2", DocumentMetadata.DISTANCE.value()); dropTable(context, ((OracleVectorStore) vectorStore).getTableName()); diff --git a/vector-stores/spring-ai-pgvector-store/src/test/java/org/springframework/ai/vectorstore/pgvector/PgVectorStoreIT.java b/vector-stores/spring-ai-pgvector-store/src/test/java/org/springframework/ai/vectorstore/pgvector/PgVectorStoreIT.java index d6cf6db547a..82a70237a2f 100644 --- a/vector-stores/spring-ai-pgvector-store/src/test/java/org/springframework/ai/vectorstore/pgvector/PgVectorStoreIT.java +++ b/vector-stores/spring-ai-pgvector-store/src/test/java/org/springframework/ai/vectorstore/pgvector/PgVectorStoreIT.java @@ -305,7 +305,7 @@ public void documentUpdate(String distanceType) { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKeys("meta1", DocumentMetadata.DISTANCE.value()); Document sameIdDocument = new Document(document.getId(), @@ -319,7 +319,7 @@ public void documentUpdate(String distanceType) { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKeys("meta2", DocumentMetadata.DISTANCE.value()); dropTable(context); diff --git a/vector-stores/spring-ai-pinecone-store/src/test/java/org/springframework/ai/vectorstore/pinecone/PineconeVectorStoreIT.java b/vector-stores/spring-ai-pinecone-store/src/test/java/org/springframework/ai/vectorstore/pinecone/PineconeVectorStoreIT.java index 38a4e4a4772..6345723ba6b 100644 --- a/vector-stores/spring-ai-pinecone-store/src/test/java/org/springframework/ai/vectorstore/pinecone/PineconeVectorStoreIT.java +++ b/vector-stores/spring-ai-pinecone-store/src/test/java/org/springframework/ai/vectorstore/pinecone/PineconeVectorStoreIT.java @@ -110,7 +110,7 @@ public void addAndSearchTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -206,7 +206,7 @@ public void documentUpdateTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -219,7 +219,7 @@ public void documentUpdateTest() { SearchRequest fooBarSearchRequest = SearchRequest.builder().query("FooBar").topK(5).build(); Awaitility.await() - .until(() -> vectorStore.similaritySearch(fooBarSearchRequest).get(0).getContent(), + .until(() -> vectorStore.similaritySearch(fooBarSearchRequest).get(0).getText(), equalTo("The World is Big and Salvation Lurks Around the Corner")); results = vectorStore.similaritySearch(fooBarSearchRequest); @@ -227,7 +227,7 @@ public void documentUpdateTest() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -270,7 +270,7 @@ public void searchThresholdTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).contains("The Great Depression (1929–1939) was an economic shock"); + assertThat(resultDoc.getText()).contains("The Great Depression (1929–1939) was an economic shock"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); assertThat(resultDoc.getScore()).isGreaterThanOrEqualTo(similarityThreshold); diff --git a/vector-stores/spring-ai-qdrant-store/src/test/java/org/springframework/ai/vectorstore/qdrant/QdrantVectorStoreIT.java b/vector-stores/spring-ai-qdrant-store/src/test/java/org/springframework/ai/vectorstore/qdrant/QdrantVectorStoreIT.java index ae02fa3bbb9..8a05e32c549 100644 --- a/vector-stores/spring-ai-qdrant-store/src/test/java/org/springframework/ai/vectorstore/qdrant/QdrantVectorStoreIT.java +++ b/vector-stores/spring-ai-qdrant-store/src/test/java/org/springframework/ai/vectorstore/qdrant/QdrantVectorStoreIT.java @@ -107,7 +107,7 @@ public void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).isEqualTo( + assertThat(resultDoc.getText()).isEqualTo( "Great Depression Great Depression Great Depression Great Depression Great Depression Great Depression"); assertThat(resultDoc.getMetadata()).containsKeys("meta2", DocumentMetadata.DISTANCE.value()); @@ -197,7 +197,7 @@ public void documentUpdateTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -212,7 +212,7 @@ public void documentUpdateTest() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -245,7 +245,7 @@ public void searchThresholdTest() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(2).getId()); - assertThat(resultDoc.getContent()).isEqualTo( + assertThat(resultDoc.getText()).isEqualTo( "Great Depression Great Depression Great Depression Great Depression Great Depression Great Depression"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); diff --git a/vector-stores/spring-ai-redis-store/src/test/java/org/springframework/ai/vectorstore/redis/RedisVectorStoreIT.java b/vector-stores/spring-ai-redis-store/src/test/java/org/springframework/ai/vectorstore/redis/RedisVectorStoreIT.java index b2b49cdd7c3..1f3d0d02d84 100644 --- a/vector-stores/spring-ai-redis-store/src/test/java/org/springframework/ai/vectorstore/redis/RedisVectorStoreIT.java +++ b/vector-stores/spring-ai-redis-store/src/test/java/org/springframework/ai/vectorstore/redis/RedisVectorStoreIT.java @@ -107,7 +107,7 @@ void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(3); assertThat(resultDoc.getMetadata()).containsKeys("meta1", RedisVectorStore.DISTANCE_FIELD_NAME, @@ -202,7 +202,7 @@ void documentUpdate() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(RedisVectorStore.DISTANCE_FIELD_NAME); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -218,7 +218,7 @@ void documentUpdate() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(RedisVectorStore.DISTANCE_FIELD_NAME); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -252,7 +252,7 @@ void searchWithThreshold() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).containsKeys("meta1", RedisVectorStore.DISTANCE_FIELD_NAME, DocumentMetadata.DISTANCE.value()); diff --git a/vector-stores/spring-ai-typesense-store/src/test/java/org/springframework/ai/vectorstore/typesense/TypesenseVectorStoreIT.java b/vector-stores/spring-ai-typesense-store/src/test/java/org/springframework/ai/vectorstore/typesense/TypesenseVectorStoreIT.java index a94085288c8..397ee15c07b 100644 --- a/vector-stores/spring-ai-typesense-store/src/test/java/org/springframework/ai/vectorstore/typesense/TypesenseVectorStoreIT.java +++ b/vector-stores/spring-ai-typesense-store/src/test/java/org/springframework/ai/vectorstore/typesense/TypesenseVectorStoreIT.java @@ -97,7 +97,7 @@ void documentUpdate() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -115,7 +115,7 @@ void documentUpdate() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -235,7 +235,7 @@ void searchWithThreshold() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).containsKeys("meta1", DocumentMetadata.DISTANCE.value()); assertThat(resultDoc.getScore()).isGreaterThanOrEqualTo(similarityThreshold); diff --git a/vector-stores/spring-ai-weaviate-store/src/test/java/org/springframework/ai/vectorstore/weaviate/WeaviateVectorStoreIT.java b/vector-stores/spring-ai-weaviate-store/src/test/java/org/springframework/ai/vectorstore/weaviate/WeaviateVectorStoreIT.java index 70ea7ace6ac..5595a8f3b1c 100644 --- a/vector-stores/spring-ai-weaviate-store/src/test/java/org/springframework/ai/vectorstore/weaviate/WeaviateVectorStoreIT.java +++ b/vector-stores/spring-ai-weaviate-store/src/test/java/org/springframework/ai/vectorstore/weaviate/WeaviateVectorStoreIT.java @@ -100,7 +100,7 @@ public void addAndSearch() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).hasSize(2); assertThat(resultDoc.getMetadata()).containsKeys("meta1", DocumentMetadata.DISTANCE.value()); @@ -196,7 +196,7 @@ public void documentUpdate() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("Spring AI rocks!!"); + assertThat(resultDoc.getText()).isEqualTo("Spring AI rocks!!"); assertThat(resultDoc.getMetadata()).containsKey("meta1"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -211,7 +211,7 @@ public void documentUpdate() { assertThat(results).hasSize(1); resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(document.getId()); - assertThat(resultDoc.getContent()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); + assertThat(resultDoc.getText()).isEqualTo("The World is Big and Salvation Lurks Around the Corner"); assertThat(resultDoc.getMetadata()).containsKey("meta2"); assertThat(resultDoc.getMetadata()).containsKey(DocumentMetadata.DISTANCE.value()); @@ -246,7 +246,7 @@ public void searchWithThreshold() { assertThat(results).hasSize(1); Document resultDoc = results.get(0); assertThat(resultDoc.getId()).isEqualTo(this.documents.get(0).getId()); - assertThat(resultDoc.getContent()).contains( + assertThat(resultDoc.getText()).contains( "Spring AI provides abstractions that serve as the foundation for developing AI applications."); assertThat(resultDoc.getMetadata()).containsKeys("meta1", DocumentMetadata.DISTANCE.value()); assertThat(resultDoc.getScore()).isGreaterThanOrEqualTo(similarityThreshold);