Docs: start adding tabs for Maven/Gradle sections

This commit is contained in:
Christian Tzolov
2024-10-21 08:58:58 +02:00
parent 9c390ff9fb
commit 6006bd7abe
20 changed files with 95 additions and 41 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 497 KiB

View File

@@ -31,8 +31,12 @@ To help with dependency management, Spring AI provides a BOM (bill of materials)
== Auto-configuration
Spring AI provides Spring Boot auto-configuration for the Anthropic Chat Client.
To enable it add the following dependency to your project's Maven `pom.xml` file:
To enable it add the following dependency to your project's Maven `pom.xml` or Gradle `build.gradle` file:
[tabs]
======
Maven::
+
[source, xml]
----
<dependency>
@@ -41,14 +45,15 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
</dependency>
----
or to your Gradle `build.gradle` build file.
Gradle::
+
[source,groovy]
----
dependencies {
implementation 'org.springframework.ai:spring-ai-anthropic-spring-boot-starter'
}
----
======
TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Management] section to add the Spring AI BOM to your build file.

View File

@@ -26,7 +26,6 @@ export SPRING_AI_AZURE_OPENAI_API_KEY=<INSERT AZURE KEY HERE>
export SPRING_AI_AZURE_OPENAI_ENDPOINT=<INSERT ENDPOINT URL HERE>
----
=== OpenAI Key
To authenticate with the OpenAI service (not Azure), provide an OpenAI API key. This will automatically set the endpoint to https://api.openai.com/v1.
@@ -85,8 +84,12 @@ To help with dependency management, Spring AI provides a BOM (bill of materials)
== Auto-configuration
Spring AI provides Spring Boot auto-configuration for the Azure OpenAI Chat Client.
To enable it add the following dependency to your project's Maven `pom.xml` file:
To enable it add the following dependency to your project's Maven `pom.xml` or Gradle `build.gradle` build files:
[tabs]
======
Maven::
+
[source, xml]
----
<dependency>
@@ -95,14 +98,15 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
</dependency>
----
or to your Gradle `build.gradle` build file.
Gradle::
+
[source,groovy]
----
dependencies {
implementation 'org.springframework.ai:spring-ai-azure-openai-spring-boot-starter'
}
----
======
TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Management] section to add the Spring AI BOM to your build file.

View File

@@ -82,6 +82,7 @@ TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Man
You can use the following properties in your Spring Boot configuration to customize the Apache Cassandra vector store.
[stripes=even]
|===
|Property|Default value

View File

@@ -46,8 +46,10 @@ Add these dependencies to your project:
=== 1. Select an Embeddings interface implementation. You can choose between:
* OpenAI Embedding:
[tabs]
======
OpenAI Embedding::
+
[source,xml]
----
<dependency>
@@ -56,8 +58,8 @@ Add these dependencies to your project:
</dependency>
----
* Or Azure AI Embedding:
Azure AI Embedding::
+
[source,xml]
----
<dependency>
@@ -66,8 +68,8 @@ Add these dependencies to your project:
</dependency>
----
* Or Local Sentence Transformers Embedding:
Local Sentence Transformers Embedding::
+
[source,xml]
----
<dependency>
@@ -75,6 +77,7 @@ Add these dependencies to your project:
<artifactId>spring-ai-transformers-spring-boot-starter</artifactId>
</dependency>
----
======
=== 2. Azure (AI Search) Vector Store
@@ -92,6 +95,7 @@ TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Man
You can use the following properties in your Spring Boot configuration to customize the Azure vector store.
[stripes=even]
|===
|Property|Default value

View File

@@ -108,6 +108,7 @@ List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Sprin
You can use the following properties in your Spring Boot configuration to customize the vector store.
[stripes=even]
|===
|Property| Description | Default value

View File

@@ -16,8 +16,12 @@ A running Elasticsearch instance. The following options are available:
== Auto-configuration
Spring AI provides Spring Boot auto-configuration for the Elasticsearch Vector Store.
To enable it, add the following dependency to your project's Maven `pom.xml` file:
To enable it, add the following dependency to your project's Maven `pom.xml` or Gradle `build.gradle` build files:
[tabs]
======
Maven::
+
[source,xml]
----
<dependency>
@@ -26,29 +30,47 @@ To enable it, add the following dependency to your project's Maven `pom.xml` fil
</dependency>
----
or to your Gradle `build.gradle` build file.
Gradle::
+
[source,groovy]
----
dependencies {
implementation 'org.springframework.ai:spring-ai-elasticsearch-store-spring-boot-starter'
}
----
NOTE: For spring-boot versions pre 3.3.0 it's necessary to explicitly add the elasticsearch-java dependency with version > 8.13.3, otherwise the older version used will be incompatible with the queries performed:
```
======
[NOTE]
--
For spring-boot versions pre 3.3.0 it's necessary to explicitly add the elasticsearch-java dependency with version > 8.13.3, otherwise the older version used will be incompatible with the queries performed:
[tabs]
======
Maven::
+
[source,xml]
----
<dependency>
<groupId>co.elastic.clients</groupId>
<artifactId>elasticsearch-java</artifactId>
<version>8.13.3</version>
</dependency>
```
----
Gradle::
+
[source,groovy]
----
dependencies {
implementation 'co.elastic.clients:elasticsearch-java:8.13.3'
}
----
======
--
TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Management] section to add the Spring AI BOM to your build file.
TIP: Refer to the xref:getting-started.adoc#repositories[Repositories] section to add Milestone and/or Snapshot Repositories to your build file.
The vector store implementation can initialize the requisite schema for you, but you must opt-in by specifying the `initializeSchema` boolean in the appropriate constructor or by setting `...initialize-schema=true` in the `application.properties` file.
Alternatively you can opt-out the initialization and create the index manually using the Elasticsearch client, which can be useful if the index needs advanced mapping or additional configuration.
@@ -122,6 +144,7 @@ Spring Boot's auto-configuration feature for the Elasticsearch RestClient will c
The Spring Boot properties starting with `spring.elasticsearch.*` are used to configure the Elasticsearch client:
[stripes=even]
|===
|Property | Description | Default Value
@@ -139,6 +162,7 @@ The Spring Boot properties starting with `spring.elasticsearch.*` are used to co
Properties starting with the `spring.ai.vectorstore.elasticsearch.*` prefix are used to configure `ElasticsearchVectorStore`.
[stripes=even]
|===
|Property | Description | Default Value

View File

@@ -39,6 +39,7 @@ dependencies {
You can use the following properties in your Spring Boot configuration to further configure the `GemFireVectorStore`.
[stripes=even]
|===
|Property|Default value

View File

@@ -165,7 +165,7 @@ NOTE: These filter expressions are converted into the equivalent Milvus filters.
You can use the following properties in your Spring Boot configuration to customize the Milvus vector store.
[cols="4,5,1"]
[cols="4,5,1",stripes=even]
|===
|Property| Description | Default value

View File

@@ -123,7 +123,7 @@ spring.ai.vectorstore.mongodb.indexName=vector_index
spring.ai.vectorstore.mongodb.metadata-fields-to-filter=foo
----
[stripes=even]
|===
|Property| Description | Default value

View File

@@ -189,6 +189,7 @@ node.`metadata.author` IN ["john","jill"] AND node.`metadata.'article_type'` = "
You can use the following properties in your Spring Boot configuration to customize the Neo4j vector store.
[stripes=even]
|===
|Property|Default value

View File

@@ -116,7 +116,7 @@ List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Sprin
You can use the following properties in your Spring Boot configuration to customize the OpenSearch vector store.
[cols="2,5,1"]
[cols="2,5,1",stripes=even]
|===
|Property| Description | Default value

View File

@@ -99,7 +99,7 @@ List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Sprin
You can use the following properties in your Spring Boot configuration to customize the `OracleVectorStore`.
[cols="2,5,1"]
[cols="2,5,1",stripes=even]
|===
|Property| Description | Default value

View File

@@ -133,7 +133,7 @@ List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Sprin
You can use the following properties in your Spring Boot configuration to customize the PGVector vector store.
[cols="2,5,1"]
[cols="2,5,1",stripes=even]
|===
|Property| Description | Default value

View File

@@ -103,6 +103,7 @@ List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Sprin
You can use the following properties in your Spring Boot configuration to customize the Pinecone vector store.
[stripes=even]
|===
|Property| Description | Default value

View File

@@ -106,7 +106,7 @@ List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Sprin
You can use the following properties in your Spring Boot configuration to customize the Qdrant vector store.
[cols="3,5,1"]
[cols="3,5,1",stripes=even]
|===
|Property| Description | Default value

View File

@@ -103,6 +103,7 @@ List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Sprin
You can use the following properties in your Spring Boot configuration to customize the Redis vector store.
[stripes=even]
|===
|Property| Description | Default value

View File

@@ -96,6 +96,7 @@ List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Sprin
You can use the following properties in your Spring Boot configuration to customize the Typesense vector store.
[stripes=even]
|===
|Property| Description | Default value

View File

@@ -110,7 +110,7 @@ List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Sprin
You can use the following properties in your Spring Boot configuration to customize the weaviate vector store.
[cols="3,5,1"]
[cols="3,5,1",stripes=even]
|===
|Property| Description | Default value

View File

@@ -18,9 +18,13 @@ If you prefer to add the dependency snippets by hand, follow the directions in t
To use the Milestone and Snapshot version, you need to add references to the Spring Milestone and/or Snapshot repositories in your build file.
For Maven, add the following repository definitions as needed:
Add the following repository definitions to your Maven or Gradle build file:
[source,xml]
[tabs]
======
Maven::
+
[source,xml,indent=0,subs="verbatim,quotes"]
----
<repositories>
<repository>
@@ -42,9 +46,9 @@ For Maven, add the following repository definitions as needed:
</repositories>
----
For Gradle, add the following repository definitions as needed:
[source,groovy]
Gradle::
+
[source,groovy,indent=0,subs="verbatim,quotes"]
----
repositories {
mavenCentral()
@@ -52,7 +56,7 @@ repositories {
maven { url 'https://repo.spring.io/snapshot' }
}
----
======
[[dependency-management]]
== Dependency Management
@@ -62,9 +66,13 @@ Using the BOM from your applications build script avoids the need for you to
Instead, the version of the BOM youre using determines the utilized dependency versions.
It also ensures that youre using supported and tested versions of the dependencies by default, unless you choose to override them.
If youre a Maven user, you can use the BOM by adding the following to your pom.xml file -
Add the BOM to your project:
[source,xml]
[tabs]
======
Maven::
+
[source,xml,indent=0,subs="verbatim,quotes"]
----
<dependencyManagement>
<dependencies>
@@ -79,11 +87,9 @@ If youre a Maven user, you can use the BOM by adding the following to your po
</dependencyManagement>
----
Gradle users can also use the Spring AI BOM by leveraging Gradle (5.0+) native support for declaring dependency constraints using a Maven BOM.
This is implemented by adding a 'platform' dependency handler method to the dependencies section of your Gradle build script.
As shown in the snippet below this can then be followed by version-less declarations of the Starter Dependencies for the one or more spring-ai modules you wish to use, e.g. spring-ai-openai.
[source,gradle]
Gradle::
+
[source,groovy,indent=0,subs="verbatim,quotes"]
----
dependencies {
implementation platform("org.springframework.ai:spring-ai-bom:1.0.0-SNAPSHOT")
@@ -91,6 +97,10 @@ dependencies {
implementation 'org.springframework.ai:spring-ai-openai'
}
----
Gradle users can also use the Spring AI BOM by leveraging Gradle (5.0+) native support for declaring dependency constraints using a Maven BOM.
This is implemented by adding a 'platform' dependency handler method to the dependencies section of your Gradle build script.
As shown in the snippet below this can then be followed by version-less declarations of the Starter Dependencies for the one or more spring-ai modules you wish to use, e.g. spring-ai-openai.
======
[[add-dependencies]]
== Add dependencies for specific components