From 7aad51da7f9ba28676c7d19860518bc3c61de12a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9FuzhanSarisakaloglu?= Date: Tue, 5 Dec 2023 21:02:48 +0300 Subject: [PATCH] Fix typo errors in code and readme file. --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- README.md | 2 +- .../ai/embedding/ResourceCacheService.java | 2 +- .../org/springframework/ai/vectorstore/SearchRequest.java | 2 +- .../ai/vectorstore/filter/antlr4/FiltersLexer.java | 3 --- .../ai/vectorstore/filter/antlr4/FiltersParser.java | 3 --- .../antora/modules/ROOT/pages/api/clients/ollama.adoc | 4 ++-- .../main/antora/modules/ROOT/pages/api/embeddings.adoc | 2 +- .../antora/modules/ROOT/pages/api/embeddings/onnx.adoc | 4 ++-- .../main/antora/modules/ROOT/pages/api/output-parser.adoc | 4 ++-- .../antora/modules/ROOT/pages/api/vectordbs/chroma.adoc | 2 +- .../TransformersEmbeddingClientProperties.java | 2 +- .../ai/autoconfigure/openai/OpenAiAutoConfiguration.java | 1 - .../chroma/ChromaVectorStoreAutoConfigurationIT.java | 6 +++--- .../WeaviateVectorStoreAutoConfigurationTests.java | 6 +++--- .../src/main/resources/test/data/great.depression.txt | 2 +- spring-ai-test/src/main/resources/test/data/spring.ai.txt | 2 +- .../src/main/resources/test/data/time.shelter.txt | 2 +- .../ai/vectorstore/ChromaVectorStoreIT.java | 8 ++++---- .../springframework/ai/vectorstore/PgVectorStoreIT.java | 1 + .../ai/vectorstore/PineconeVectorStore.java | 1 - .../ai/vectorstore/PineconeVectorStoreIT.java | 6 +++--- .../ai/vectorstore/WeaviateVectorStore.java | 2 +- .../src/test/resources/docker-compose.yml | 2 +- 25 files changed, 33 insertions(+), 40 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c1fb79a3866..19667e1a7d0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,7 +7,7 @@ assignees: '' --- -Please do a quick search on Github issues first, there might be already a duplicate issue for the one you are about to create. +Please do a quick search on GitHub issues first, there might be already a duplicate issue for the one you are about to create. If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections: **Bug description** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 0f32f34d21c..aba7d39de8e 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,7 +7,7 @@ assignees: '' --- -Please do a quick search on Github issues first, the feature you are about to request might have already been requested. +Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested. **Expected Behavior** diff --git a/README.md b/README.md index 61c1ec131e5..d27498d4aab 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ For usage details, consult the [AiClient API guide](https://docs.spring.io/spri **Prompts:** Central to AI model interaction is the Prompt, which provides specific instructions for the AI to act upon. -Crafting an effective Prompt is both an art and science, giving rist to the discipline of "Prompt Engineering". +Crafting an effective Prompt is both an art and science, giving rise to the discipline of "Prompt Engineering". These prompts often leverage a templating engine for easy data substitution within predefined text using placeholders. Explore more on [Prompts](https://docs.spring.io/spring-ai/reference/concepts.html#_prompts) in our concept guide. diff --git a/embedding-clients/transformers-embedding/src/main/java/org/springframework/ai/embedding/ResourceCacheService.java b/embedding-clients/transformers-embedding/src/main/java/org/springframework/ai/embedding/ResourceCacheService.java index 0956303e31f..47a281764ba 100644 --- a/embedding-clients/transformers-embedding/src/main/java/org/springframework/ai/embedding/ResourceCacheService.java +++ b/embedding-clients/transformers-embedding/src/main/java/org/springframework/ai/embedding/ResourceCacheService.java @@ -50,7 +50,7 @@ public class ResourceCacheService { /** * Resources with URI schemas belonging to the excludedUriSchemas are not cached. By - * default the file and classpath resources are not cached as they are already in the + * default, the file and classpath resources are not cached as they are already in the * local file system. */ private List excludedUriSchemas = new ArrayList<>(List.of("file", "classpath")); 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 8b82bb96aca..6b354ff5f4b 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 @@ -112,7 +112,7 @@ public SearchRequest withTopK(int topK) { /** * Similarity threshold score to filter the search response by. Only documents with * similarity score equal or greater than the 'threshold' will be returned. Note that - * this is a post processing step performed on the client not the server side. A + * this is a post-processing step performed on the client not the server side. A * threshold value of 0.0 means any similarity is accepted or disable the similarity * threshold filtering. A threshold value of 1.0 means an exact match is required. * @param threshold The lower bound of the similarity score. diff --git a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/filter/antlr4/FiltersLexer.java b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/filter/antlr4/FiltersLexer.java index de5b29a3c76..85e6e4b3f94 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/filter/antlr4/FiltersLexer.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/filter/antlr4/FiltersLexer.java @@ -23,12 +23,9 @@ import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.CharStream; -import org.antlr.v4.runtime.Token; -import org.antlr.v4.runtime.TokenStream; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.misc.*; @SuppressWarnings({ "all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue", "this-escape" }) public class FiltersLexer extends Lexer { diff --git a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/filter/antlr4/FiltersParser.java b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/filter/antlr4/FiltersParser.java index a17e355d7ee..ac829094f5f 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/filter/antlr4/FiltersParser.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/vectorstore/filter/antlr4/FiltersParser.java @@ -24,11 +24,8 @@ import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.misc.*; import org.antlr.v4.runtime.tree.*; import java.util.List; -import java.util.Iterator; -import java.util.ArrayList; @SuppressWarnings({ "all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue" }) public class FiltersParser extends Parser { diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/ollama.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/ollama.adoc index a581cd4fef4..a474bcfc6f5 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/ollama.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/ollama.adoc @@ -21,7 +21,7 @@ Add the `spring-ai-ollama` dependency to your project's pom: ---- -then create an client and use generate response: +then create a client and use generate response: [source,java] ---- @@ -38,7 +38,7 @@ AiResponse aiResponse = ollamaClient.generate(new Prompt("Hello")); === Spring Boot Starter For convenience, you can opt for the Ollama Boot starter. -For this, add the following dependency: +For this add the following dependency: [source,xml] ---- diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings.adoc index 9286f6fcebf..ef7da7bf2c1 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings.adoc @@ -9,7 +9,7 @@ The design of the EmbeddingClient interface centers around two primary goals: * *Portability*: This interface ensures easy adaptability across various embedding models. It allows developers to switch between different embedding techniques or models with minimal code changes. -This design aligns with Spring's philophy of modularity and interchangeability. +This design aligns with Spring's philosophy of modularity and interchangeability. * *Simplicity*: EmbeddingClient simplifies the process of converting text to embeddings. By providing straightforward methods like `embed(String text)` and `embed(Document document)`, it takes the complexity out of dealing with raw text data and embedding algorithms. This design choice makes it easier for developers, especially those new to AI, to utilize embeddings in their applications without delving deep into the underlying mechanics. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/onnx.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/onnx.adoc index 63e22ee3305..7c8d645dcd9 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/onnx.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/onnx.adoc @@ -82,8 +82,8 @@ List> embeddings = embeddingClient.embed(List.of("Hello world", "Wo Note that when created manually you have to call the `afterPropertiesSet()` after setting the properties and before using the client. -The first `embed()` call downloads the the large ONNX model and caches it on the local file system. -Therefore the first call might take longer than usual. +The first `embed()` call downloads the large ONNX model and caches it on the local file system. +Therefore, the first call might take longer than usual. Use the `#setResourceCacheDirectory()` to set the local folder where the ONNX models as stored. The default cache folder is `${java.io.tmpdir}/spring-ai-onnx-model`. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/output-parser.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/output-parser.adoc index 0bf8d00e3af..8c9d759d0a6 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/output-parser.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/output-parser.adoc @@ -2,7 +2,7 @@ = Output Parsers -The `OutputParser` interface allows you to obtain structured output, for example ampping the output to a Java class or an array of values from the String based ouput of AI Models. +The `OutputParser` interface allows you to obtain structured output, for example mapping the output to a Java class or an array of values from the String based ouput of AI Models. You can think of it in terms similar to Spring JDBC's concept of a `RowMapper` or `ResultSetExtractor`. Developers want to quickly turn results from an AI model into data types that can be passed to other functions and methods in their application. @@ -66,7 +66,7 @@ There has been considerable effort in recent OpenAI models to improve the model' You can run a fully working example that demonstrates the use of `BeanOutputParser` as part of the https://github.com/Azure-Samples/spring-ai-azure-workshop[Spring AI Azure Workshop]. Part of this workshop code is reproduced below. -The use case for the example is to as the AI Model to generate the filography for an actor. +The use case for the example is to as the AI Model to generate the filmography for an actor. The User prompt used is diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/chroma.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/chroma.adoc index 509662f44c3..233d6df8090 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/chroma.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/chroma.adoc @@ -145,7 +145,7 @@ For example, this portable filter expression: author in ['john', 'jill'] && article_type == 'blog' ``` -is converted inot the proprietyar Chroma format +is converted into the proprietary Chroma format ```json {"$and":[ diff --git a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/embedding/transformer/TransformersEmbeddingClientProperties.java b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/embedding/transformer/TransformersEmbeddingClientProperties.java index c81e7dd18da..2266209a0a3 100644 --- a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/embedding/transformer/TransformersEmbeddingClientProperties.java +++ b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/embedding/transformer/TransformersEmbeddingClientProperties.java @@ -57,7 +57,7 @@ public static class Tokenizer { /** * HuggingFaceTokenizer options such as 'addSpecialTokens', 'modelMaxLength', * 'truncation', 'padding', 'maxLength', 'stride' and 'padToMultipleOf'. Leave - * empty to fallback to the defaults. + * empty to fall back to the defaults. */ private Map options = new HashMap<>(); diff --git a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/openai/OpenAiAutoConfiguration.java b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/openai/OpenAiAutoConfiguration.java index 0da17ad05e2..9b0e1e12cd8 100644 --- a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/openai/OpenAiAutoConfiguration.java +++ b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/openai/OpenAiAutoConfiguration.java @@ -41,7 +41,6 @@ import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; -import retrofit2.http.HEAD; @AutoConfiguration @ConditionalOnClass(OpenAiService.class) diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/chroma/ChromaVectorStoreAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/chroma/ChromaVectorStoreAutoConfigurationIT.java index 2e4de29620b..f78d9e44d75 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/chroma/ChromaVectorStoreAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/chroma/ChromaVectorStoreAutoConfigurationIT.java @@ -63,7 +63,7 @@ public void addAndSearchWithFilters() { var bgDocument = new Document("The World is Big and Salvation Lurks Around the Corner", Map.of("country", "Bulgaria")); var nlDocument = new Document("The World is Big and Salvation Lurks Around the Corner", - Map.of("country", "Netherland")); + Map.of("country", "Netherlands")); vectorStore.add(List.of(bgDocument, nlDocument)); @@ -77,8 +77,8 @@ public void addAndSearchWithFilters() { assertThat(results).hasSize(1); assertThat(results.get(0).getId()).isEqualTo(bgDocument.getId()); - results = vectorStore - .similaritySearch(request.withSimilarityThresholdAll().withFilterExpression("country == 'Netherland'")); + results = vectorStore.similaritySearch( + request.withSimilarityThresholdAll().withFilterExpression("country == 'Netherlands'")); assertThat(results).hasSize(1); assertThat(results.get(0).getId()).isEqualTo(nlDocument.getId()); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/weaviate/WeaviateVectorStoreAutoConfigurationTests.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/weaviate/WeaviateVectorStoreAutoConfigurationTests.java index 9b3f413f55e..a5d112099ce 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/weaviate/WeaviateVectorStoreAutoConfigurationTests.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/weaviate/WeaviateVectorStoreAutoConfigurationTests.java @@ -81,7 +81,7 @@ public void addAndSearchWithFilters() { var bgDocument = new Document("The World is Big and Salvation Lurks Around the Corner", Map.of("country", "Bulgaria", "price", 3.14, "active", true, "year", 2020)); var nlDocument = new Document("The World is Big and Salvation Lurks Around the Corner", - Map.of("country", "Netherland", "price", 1.57, "active", false, "year", 2023)); + Map.of("country", "Netherlands", "price", 1.57, "active", false, "year", 2023)); vectorStore.add(List.of(bgDocument, nlDocument)); @@ -95,8 +95,8 @@ public void addAndSearchWithFilters() { assertThat(results).hasSize(1); assertThat(results.get(0).getId()).isEqualTo(bgDocument.getId()); - results = vectorStore - .similaritySearch(request.withSimilarityThresholdAll().withFilterExpression("country == 'Netherland'")); + results = vectorStore.similaritySearch( + request.withSimilarityThresholdAll().withFilterExpression("country == 'Netherlands'")); assertThat(results).hasSize(1); assertThat(results.get(0).getId()).isEqualTo(nlDocument.getId()); diff --git a/spring-ai-test/src/main/resources/test/data/great.depression.txt b/spring-ai-test/src/main/resources/test/data/great.depression.txt index ce3d79a5bde..cef3eef9931 100644 --- a/spring-ai-test/src/main/resources/test/data/great.depression.txt +++ b/spring-ai-test/src/main/resources/test/data/great.depression.txt @@ -1,4 +1,4 @@ The Great Depression (1929–1939) was an economic shock that affected most countries across the world. It was a period of economic depression that became evident after a major fall in stock prices in the United States.[1] The economic contagion began around September 1929 and led to the Wall Street stock market crash of October 24 (Black Thursday). It was the longest, deepest, and most widespread depression of the 20th century.[2] Between 1929 and 1932, worldwide gross domestic product (GDP) fell by an estimated 15%. By comparison, worldwide GDP fell by less than 1% from 2008 to 2009 during the Great Recession.[3] Some economies started to recover by the mid-1930s. However, in many countries,[specify] the negative effects of the Great Depression lasted until the beginning of World War II. Devastating effects were seen in both rich and poor countries with falling personal income, prices, tax revenues, and profits. International trade fell by more than 50%, unemployment in the U.S. rose to 23% and in some countries rose as high as 33%.[4] Cities around the world were hit hard, especially those dependent on heavy industry. Construction was virtually halted in many countries. Farming communities and rural areas suffered as crop prices fell by about 60%.[5][6][7] Faced with plummeting demand and few job alternatives, areas dependent on primary sector industries suffered the most.[8] -Economic historians usually consider the catalyst of the Great Depression to be the sudden devastating collapse of U.S. stock market prices, starting on October 24, 1929. However, some dispute this conclusion, seeing the stock crash less as a cause of the Depression and more as a symptom of the rising nervousness of investors partly due to gradual price declines caused by falling sales of consumer goods (as a result of overproduction because of new production techniques, falling exports and income inequality, among other factors) that had already been underway as part of a gradual Depression \ No newline at end of file +Economic historians usually consider the catalyst of the Great Depression to be the sudden devastating collapse of U.S. stock market prices, starting on October 24, 1929. However, some dispute this conclusion, seeing the stock crash less than a cause of the Depression and more as a symptom of the rising nervousness of investors partly due to gradual price declines caused by falling sales of consumer goods (as a result of overproduction because of new production techniques, falling exports and income inequality, among other factors) that had already been underway as part of a gradual Depression \ No newline at end of file diff --git a/spring-ai-test/src/main/resources/test/data/spring.ai.txt b/spring-ai-test/src/main/resources/test/data/spring.ai.txt index b5ac0c0947b..bd83d7eeb28 100644 --- a/spring-ai-test/src/main/resources/test/data/spring.ai.txt +++ b/spring-ai-test/src/main/resources/test/data/spring.ai.txt @@ -2,5 +2,5 @@ The Spring AI project aims to streamline the development of applications that in The project draws inspiration from notable Python projects, such as LangChain and LlamaIndex, but Spring AI is not a direct port of those projects. The project was founded with the belief that the next wave of Generative AI applications will not be only for Python developers but will be ubiquitous across many programming languages. At its core, Spring AI provides abstractions that serve as the foundation for developing AI applications. These abstractions have multiple implementations, enabling easy component swapping with minimal code changes. For example, Spring AI introduces the AiClient interface with implementations for OpenAI and Azure OpenAI. In addition to these core abstractions, Spring AI aims to provide higher-level functionalities to address common use cases such as “Q&A over your documentation” or “Chat with your documentation.” As the complexity of the use cases increases, the Spring AI project will integrate with other projects in the Spring Ecosystem, such as Spring Integration, Spring Batch, and Spring Data. -To simplify setup, Spring Boot starters are available to help set up essential dependencies and classes. There is also a collection of sample applications to help you explore the project’s features. Lastly, the new Spring CLI project also enables you to get started quickly by using the spring boot new ai command for new projects or spring boot add ai for adding AI capabilities to your existing application. +To simplify setup, Spring Boot starters are available to help set up essential dependencies and classes. There is also a collection of sample applications to help you explore the project’s features. Lastly, the new Spring CLI project also enables you to get started quickly by using the spring boot new AI command for new projects or spring boot add AI for adding AI capabilities to your existing application. diff --git a/spring-ai-test/src/main/resources/test/data/time.shelter.txt b/spring-ai-test/src/main/resources/test/data/time.shelter.txt index 4ae95027f94..1def18b976d 100644 --- a/spring-ai-test/src/main/resources/test/data/time.shelter.txt +++ b/spring-ai-test/src/main/resources/test/data/time.shelter.txt @@ -1,2 +1,2 @@ -Somewhere in the Andes, they believe to this very day that the future is behind you. It comes up from behind your back, surprising and unforeseeable, while the past is always before your eyes, that which has already happened. When they talk about the past, the people of the Aymara tribe point in front of them. You walk forward facing the past and you turn back toward the future. +Somewhere in the Andes, they believe in this very day that the future is behind you. It comes up from behind your back, surprising and unforeseeable, while the past is always before your eyes, that which has already happened. When they talk about the past, the people of the Aymara tribe point in front of them. You walk forward facing the past, and you turn back toward the future. ― Georgi Gospodinov, Time Shelter \ No newline at end of file diff --git a/vector-stores/spring-ai-chroma/src/test/java/org/springframework/ai/vectorstore/ChromaVectorStoreIT.java b/vector-stores/spring-ai-chroma/src/test/java/org/springframework/ai/vectorstore/ChromaVectorStoreIT.java index 45f9576a87d..3bbe8e2ca96 100644 --- a/vector-stores/spring-ai-chroma/src/test/java/org/springframework/ai/vectorstore/ChromaVectorStoreIT.java +++ b/vector-stores/spring-ai-chroma/src/test/java/org/springframework/ai/vectorstore/ChromaVectorStoreIT.java @@ -101,7 +101,7 @@ public void addAndSearchWithFilters() { var bgDocument = new Document("The World is Big and Salvation Lurks Around the Corner", Map.of("country", "Bulgaria")); var nlDocument = new Document("The World is Big and Salvation Lurks Around the Corner", - Map.of("country", "Netherland")); + Map.of("country", "Netherlands")); vectorStore.add(List.of(bgDocument, nlDocument)); @@ -115,13 +115,13 @@ public void addAndSearchWithFilters() { assertThat(results).hasSize(1); assertThat(results.get(0).getId()).isEqualTo(bgDocument.getId()); - results = vectorStore - .similaritySearch(request.withSimilarityThresholdAll().withFilterExpression("country == 'Netherland'")); + results = vectorStore.similaritySearch( + request.withSimilarityThresholdAll().withFilterExpression("country == 'Netherlands'")); assertThat(results).hasSize(1); assertThat(results.get(0).getId()).isEqualTo(nlDocument.getId()); results = vectorStore.similaritySearch( - request.withSimilarityThresholdAll().withFilterExpression("NOT(country == 'Netherland')")); + request.withSimilarityThresholdAll().withFilterExpression("NOT(country == 'Netherlands')")); assertThat(results).hasSize(1); assertThat(results.get(0).getId()).isEqualTo(bgDocument.getId()); diff --git a/vector-stores/spring-ai-pgvector-store/src/test/java/org/springframework/ai/vectorstore/PgVectorStoreIT.java b/vector-stores/spring-ai-pgvector-store/src/test/java/org/springframework/ai/vectorstore/PgVectorStoreIT.java index adf88701116..58477880ec1 100644 --- a/vector-stores/spring-ai-pgvector-store/src/test/java/org/springframework/ai/vectorstore/PgVectorStoreIT.java +++ b/vector-stores/spring-ai-pgvector-store/src/test/java/org/springframework/ai/vectorstore/PgVectorStoreIT.java @@ -31,6 +31,7 @@ import com.theokanning.openai.service.OpenAiService; import com.zaxxer.hikari.HikariDataSource; import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/vector-stores/spring-ai-pinecone/src/main/java/org/springframework/ai/vectorstore/PineconeVectorStore.java b/vector-stores/spring-ai-pinecone/src/main/java/org/springframework/ai/vectorstore/PineconeVectorStore.java index 10bf9a11155..bfe963be1fd 100644 --- a/vector-stores/spring-ai-pinecone/src/main/java/org/springframework/ai/vectorstore/PineconeVectorStore.java +++ b/vector-stores/spring-ai-pinecone/src/main/java/org/springframework/ai/vectorstore/PineconeVectorStore.java @@ -36,7 +36,6 @@ import org.springframework.ai.document.Document; import org.springframework.ai.embedding.EmbeddingClient; -import org.springframework.ai.vectorstore.filter.Filter; import org.springframework.ai.vectorstore.filter.converter.FilterExpressionConverter; import org.springframework.ai.vectorstore.filter.converter.PineconeFilterExpressionConverter; import org.springframework.util.Assert; diff --git a/vector-stores/spring-ai-pinecone/src/test/java/org/springframework/ai/vectorstore/PineconeVectorStoreIT.java b/vector-stores/spring-ai-pinecone/src/test/java/org/springframework/ai/vectorstore/PineconeVectorStoreIT.java index 2506aa19f9b..3cd9ec081a2 100644 --- a/vector-stores/spring-ai-pinecone/src/test/java/org/springframework/ai/vectorstore/PineconeVectorStoreIT.java +++ b/vector-stores/spring-ai-pinecone/src/test/java/org/springframework/ai/vectorstore/PineconeVectorStoreIT.java @@ -131,7 +131,7 @@ public void addAndSearchWithFilters() { var bgDocument = new Document("The World is Big and Salvation Lurks Around the Corner", Map.of("country", "Bulgaria")); var nlDocument = new Document("The World is Big and Salvation Lurks Around the Corner", - Map.of("country", "Netherland")); + Map.of("country", "Netherlands")); vectorStore.add(List.of(bgDocument, nlDocument)); @@ -152,13 +152,13 @@ public void addAndSearchWithFilters() { results = vectorStore.similaritySearch(searchRequest.withTopK(5) .withSimilarityThresholdAll() - .withFilterExpression("country == 'Netherland'")); + .withFilterExpression("country == 'Netherlands'")); assertThat(results).hasSize(1); assertThat(results.get(0).getId()).isEqualTo(nlDocument.getId()); results = vectorStore.similaritySearch(searchRequest.withTopK(5) .withSimilarityThresholdAll() - .withFilterExpression("NOT(country == 'Netherland')")); + .withFilterExpression("NOT(country == 'Netherlands')")); assertThat(results).hasSize(1); assertThat(results.get(0).getId()).isEqualTo(bgDocument.getId()); diff --git a/vector-stores/spring-ai-weaviate/src/main/java/org/springframework/ai/vectorstore/WeaviateVectorStore.java b/vector-stores/spring-ai-weaviate/src/main/java/org/springframework/ai/vectorstore/WeaviateVectorStore.java index 2440344fc6c..9e4c5c53319 100644 --- a/vector-stores/spring-ai-weaviate/src/main/java/org/springframework/ai/vectorstore/WeaviateVectorStore.java +++ b/vector-stores/spring-ai-weaviate/src/main/java/org/springframework/ai/vectorstore/WeaviateVectorStore.java @@ -577,7 +577,7 @@ private Document toDocument(Map item) { } /** - * Converts a list of doubles to a array of floats. + * Converts a list of doubles to an array of floats. * @param doubleList The list of doubles. * @return The converted array of floats. */ diff --git a/vector-stores/spring-ai-weaviate/src/test/resources/docker-compose.yml b/vector-stores/spring-ai-weaviate/src/test/resources/docker-compose.yml index 17bbe004e75..db8aad34476 100644 --- a/vector-stores/spring-ai-weaviate/src/test/resources/docker-compose.yml +++ b/vector-stores/spring-ai-weaviate/src/test/resources/docker-compose.yml @@ -10,7 +10,7 @@ services: - http image: semitechnologies/weaviate:1.22.4 ports: - - 8080:8080 + - "8080:8080" restart: on-failure:0 environment: QUERY_DEFAULTS_LIMIT: 25