diff --git a/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereEmbeddingOptions.java b/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereEmbeddingOptions.java index d09c38a26..420aff28d 100644 --- a/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereEmbeddingOptions.java +++ b/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereEmbeddingOptions.java @@ -32,7 +32,7 @@ public class BedrockCohereEmbeddingOptions implements EmbeddingOptions { // @formatter:off /** * Prepends special tokens to differentiate each type from one another. You should not mix - * different types together, except when mixing types for for search and retrieval. + * different types together, except when mixing types for search and retrieval. * In this case, embed your corpus with the search_document type and embedded queries with * type search_query type. */ diff --git a/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/api/CohereEmbeddingBedrockApi.java b/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/api/CohereEmbeddingBedrockApi.java index 71d0b958d..9bd928a4a 100644 --- a/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/api/CohereEmbeddingBedrockApi.java +++ b/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/api/CohereEmbeddingBedrockApi.java @@ -69,7 +69,7 @@ public class CohereEmbeddingBedrockApi extends * @param texts An array of strings for the model to embed. For optimal performance, we recommend reducing the * length of each text to less than 512 tokens. 1 token is about 4 characters. * @param inputType Prepends special tokens to differentiate each type from one another. You should not mix - * different types together, except when mixing types for for search and retrieval. In this case, embed your corpus + * different types together, except when mixing types for search and retrieval. In this case, embed your corpus * with the search_document type and embedded queries with type search_query type. * @param truncate Specifies how the API handles inputs longer than the maximum token length. If you specify LEFT or * RIGHT, the model discards the input until the remaining input is exactly the maximum input token length for the diff --git a/spring-ai-core/src/main/java/org/springframework/ai/document/ContentFormatter.java b/spring-ai-core/src/main/java/org/springframework/ai/document/ContentFormatter.java index d67819990..2e7c9aca6 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/document/ContentFormatter.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/document/ContentFormatter.java @@ -16,7 +16,7 @@ package org.springframework.ai.document; /** - * Converts the Document text and metadata into a AI, prompt-friendly text representation. + * Converts the Document text and metadata into an AI, prompt-friendly text representation. * * @author Christian Tzolov */ diff --git a/spring-ai-core/src/main/java/org/springframework/ai/model/StreamingModelClient.java b/spring-ai-core/src/main/java/org/springframework/ai/model/StreamingModelClient.java index c6574ee85..0f0db47c9 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/model/StreamingModelClient.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/model/StreamingModelClient.java @@ -18,7 +18,7 @@ package org.springframework.ai.model; import reactor.core.publisher.Flux; /** - * The StreamingModelClient interface provides a generic API for invoking a AI models with + * The StreamingModelClient interface provides a generic API for invoking an AI models with * streaming response. It abstracts the process of sending requests and receiving a * streaming responses. The interface uses Java generics to accommodate different types of * requests and responses, enhancing flexibility and adaptability across different AI diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/vertexai-gemini-chat-functions.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/vertexai-gemini-chat-functions.adoc index 9324d390b..7375ca682 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/vertexai-gemini-chat-functions.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/vertexai-gemini-chat-functions.adoc @@ -108,7 +108,7 @@ static class Config { public record Request(String location, Unit unit) {} ---- -It is a best practice to annotate the request object with information such that the generats JSON schema of that function is as descriptive as possible to help the AI model pick the correct funciton to invoke. +It is a best practice to annotate the request object with information such that the generates JSON schema of that function is as descriptive as possible to help the AI model pick the correct function to invoke. The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/gemini/tool/FunctionCallWithFunctionBeanIT.java[FunctionCallWithFunctionBeanIT.java] demonstrates this approach. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-cohere-embedding.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-cohere-embedding.adoc index d8b811553..ce278d89c 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-cohere-embedding.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-cohere-embedding.adoc @@ -69,7 +69,7 @@ The prefix `spring.ai.bedrock.cohere.embedding` (defined in `BedrockCohereEmbedd | Property | Description | Default | spring.ai.bedrock.cohere.embedding.enabled | Enable or disable support for Cohere | false | spring.ai.bedrock.cohere.embedding.model | The model id to use. See the https://github.com/spring-projects/spring-ai/blob/056b95a00efa5b014a1f488329fbd07a46c02378/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/api/CohereEmbeddingBedrockApi.java#L150[CohereEmbeddingModel] for the supported models. | cohere.embed-multilingual-v3 -| spring.ai.bedrock.cohere.embedding.options.input-type | Prepends special tokens to differentiate each type from one another. You should not mix different types together, except when mixing types for for search and retrieval. In this case, embed your corpus with the search_document type and embedded queries with type search_query type. | SEARCH_DOCUMENT +| spring.ai.bedrock.cohere.embedding.options.input-type | Prepends special tokens to differentiate each type from one another. You should not mix different types together, except when mixing types for search and retrieval. In this case, embed your corpus with the search_document type and embedded queries with type search_query type. | SEARCH_DOCUMENT | spring.ai.bedrock.cohere.embedding.options.truncate | Specifies how the API handles inputs longer than the maximum token length. If you specify LEFT or RIGHT, the model discards the input until the remaining input is exactly the maximum input token length for the model. | NONE |==== diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc index 8f7441b99..c591d6d2d 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc @@ -110,7 +110,7 @@ TIP: All properties prefixed with `spring.ai.ollama.embedding.options` can be ov === Embedding Options [[embedding-options]] -The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaOptions.java[OllamaOptions.java] provides the Ollama configurations, such as the model to use, the low level GPU and CPU tunning, etc. +The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaOptions.java[OllamaOptions.java] provides the Ollama configurations, such as the model to use, the low level GPU and CPU tuning, etc. The default options can be configured using the `spring.ai.ollama.embedding.options` properties as well. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/generic-model.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/generic-model.adoc index 2bebd053b..197fccb99 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/generic-model.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/generic-model.adoc @@ -31,7 +31,7 @@ public interface ModelClient, TRes extends ModelRes == StreamingModelClient -The StreamingModelClient interface provides a generic API for invoking a AI models with streaming response. It abstracts the process of sending requests and receiving a streaming responses. The interface uses Java generics to accommodate different types of requests and responses, enhancing flexibility and adaptability across different AI model implementations. +The StreamingModelClient interface provides a generic API for invoking an AI models with streaming response. It abstracts the process of sending requests and receiving a streaming responses. The interface uses Java generics to accommodate different types of requests and responses, enhancing flexibility and adaptability across different AI model implementations. [source,java] ---- 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 4fd5a6eb1..d919c5e1f 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 @@ -43,7 +43,7 @@ public interface FormatProvider { The `Parser` interface parses text strings to produce instances of the type T. -The `FormatProvider` provides text instructions for the AI Model to format the output so that it an be parsed into the type T by the `Parser`. +The `FormatProvider` provides text instructions for the AI Model to format the output so that it can be parsed into the type T by the `Parser`. These text instructions are most often appended to the end of the user input to the AI Model. 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 c179b27a1..ae4b474a3 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 @@ -12,7 +12,7 @@ link:https://docs.trychroma.com/[Chroma] is the open-source embedding database. 1. OpenAI Account: Create an account at link:https://platform.openai.com/signup[OpenAI Signup] and generate the token at link:https://platform.openai.com/account/api-keys[API Keys]. -2. Access to ChromeDB. The <> appendix shows how to set up a DB locally with a Docker container. +2. Access to ChromeDB. The <> appendix shows how to set up a DB locally with a Docker container. On startup, the `ChromaVectorStore` creates the required collection if one is not provisioned already. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/pgvector.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/pgvector.adoc index cf01482c9..7ee62d0f1 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/pgvector.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/pgvector.adoc @@ -6,9 +6,9 @@ link:https://github.com/pgvector/pgvector[PGvector] is an open-source extension == Prerequisites -First you need an access to PostgreSQL instance with enabled `vector`, `hstore` and `uuid-ossp` extensions. +First you need access to PostgreSQL instance with enabled `vector`, `hstore` and `uuid-ossp` extensions. -TIP: The <> appendix shows how to set up a DB locally with a Docker container. +TIP: The <> appendix shows how to set up a DB locally with a Docker container. On startup, the `PgVectorStore` will attempt to install the required database extensions and create the required `vector_store` table with an index. @@ -200,7 +200,7 @@ You can use the following properties in your Spring Boot configuration to custom |`spring.ai.vectorstore.pgvector.index-type`| Nearest neighbor search index type. Options are `NONE` - exact nearest neighbor search, `IVFFlat` - index divides vectors into lists, and then searches a subset of those lists that are closest to the query vector. It has faster build times and uses less memory than HNSW, but has lower query performance (in terms of speed-recall tradeoff). `HNSW` - creates a multilayer graph. It has slower build times and uses more memory than IVFFlat, but has better query performance (in terms of speed-recall tradeoff). There’s no training step like IVFFlat, so the index can be created without any data in the table.| HNSW |`spring.ai.vectorstore.pgvector.distance-type`| Search distance type. Defaults to `COSINE_DISTANCE`. But if vectors are normalized to length 1, you can use `EUCLIDEAN_DISTANCE` or `NEGATIVE_INNER_PRODUCT` for best performance.| COSINE_DISTANCE -|`spring.ai.vectorstore.pgvector.dimension`| Embeddings dimension. If not specified explicitly the PgVectorStore will retrieve the dimensions form the provided `EmbeddingClient`. Dimensions are set to the embedding column the on table creation. If you change the dimensions your would have to to re-create the vector_store table as well. | - +|`spring.ai.vectorstore.pgvector.dimension`| Embeddings dimension. If not specified explicitly the PgVectorStore will retrieve the dimensions form the provided `EmbeddingClient`. Dimensions are set to the embedding column the on table creation. If you change the dimensions your would have to re-create the vector_store table as well. | - |spring.ai.vectorstore.pgvector.remove-existing-vector-store-table| Deletes the existing `vector_store` table on start up. | false |===