Skip to content

Commit 8dd2210

Browse files
ddobrinchedim
authored andcommitted
Fixes spring-projects#4270 Add documentation for the new Spring AI - Google GenAI integration modules
Signed-off-by: ddobrin <[email protected]>
1 parent df15b8e commit 8dd2210

File tree

8 files changed

+769
-9
lines changed

8 files changed

+769
-9
lines changed

auto-configurations/models/spring-ai-autoconfigure-model-google-genai/MIGRATION_GUIDE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@
44

55
This guide helps you migrate from the old Vertex AI-based autoconfiguration to the new Google GenAI SDK-based autoconfiguration.
66

7+
## Starter Dependencies
8+
9+
Spring AI provides separate starters for Google GenAI functionality:
10+
11+
### Chat Functionality
12+
```xml
13+
<dependency>
14+
<groupId>org.springframework.ai</groupId>
15+
<artifactId>spring-ai-starter-model-google-genai</artifactId>
16+
<version>1.1.0-SNAPSHOT</version>
17+
</dependency>
18+
```
19+
20+
### Embedding Functionality
21+
```xml
22+
<dependency>
23+
<groupId>org.springframework.ai</groupId>
24+
<artifactId>spring-ai-starter-model-google-genai-embedding</artifactId>
25+
<version>1.1.0-SNAPSHOT</version>
26+
</dependency>
27+
```
28+
29+
**Note**: If you need both chat and embedding capabilities, include both starters in your project. The starters are designed to be used independently or together based on your requirements.
30+
731
## Key Changes
832

933
### 1. Property Namespace Changes

auto-configurations/models/spring-ai-autoconfigure-model-google-genai/src/main/java/org/springframework/ai/model/google/genai/autoconfigure/embedding/GoogleGenAiEmbeddingConnectionAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* @since 1.1.0
4040
*/
4141
@AutoConfiguration
42-
@ConditionalOnClass(Client.class)
42+
@ConditionalOnClass({ Client.class, GoogleGenAiEmbeddingConnectionDetails.class })
4343
@EnableConfigurationProperties(GoogleGenAiEmbeddingConnectionProperties.class)
4444
public class GoogleGenAiEmbeddingConnectionAutoConfiguration {
4545

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
1-
# Google Gen AI Embeddings module
1+
# Google GenAI Embeddings Module
22

3-
Please note that at this time the *spring-ai-google-genai-embedding* module supports only text embeddings only.
3+
[Google GenAI Text Embeddings Documentation](https://docs.spring.io/spring-ai/reference/api/embeddings/google-genai-embeddings-text.html)
44

5-
This is due to the fact that the Google GenAI SDK supports text embeddings only, with multimedia embeddings pending.
5+
## Overview
6+
7+
The Google GenAI Embeddings module provides text embedding generation using Google's embedding models through either the Gemini Developer API or Vertex AI.
8+
9+
## Current Support
10+
11+
Please note that at this time the *spring-ai-google-genai-embedding* module supports **text embeddings only**.
12+
13+
This is due to the fact that the Google GenAI SDK currently supports text embeddings only, with multimodal embeddings support pending.
14+
15+
## Starter Dependency
16+
17+
```xml
18+
<dependency>
19+
<groupId>org.springframework.ai</groupId>
20+
<artifactId>spring-ai-starter-model-google-genai-embedding</artifactId>
21+
</dependency>
22+
```
23+
24+
## Manual Configuration
25+
26+
```xml
27+
<dependency>
28+
<groupId>org.springframework.ai</groupId>
29+
<artifactId>spring-ai-google-genai-embedding</artifactId>
30+
</dependency>
31+
```
32+
33+
## Authentication Modes
34+
35+
The module supports two authentication modes:
36+
- **Gemini Developer API**: Use an API key for quick prototyping
37+
- **Vertex AI**: Use Google Cloud credentials for production deployments
38+
39+
See the [documentation](https://docs.spring.io/spring-ai/reference/api/embeddings/google-genai-embeddings-text.html) for detailed configuration instructions.

models/spring-ai-google-genai/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
[VertexAI Gemini Chat](https://docs.spring.io/spring-ai/reference/api/chat/vertexai-gemini-chat.html)
1+
[Google GenAI Chat](https://docs.spring.io/spring-ai/reference/api/chat/google-genai-chat.html)
22

3-
### Starter - WIP
3+
### Starter
44
```xml
55
<dependency>
66
<groupId>org.springframework.ai</groupId>
7-
<artifactId>spring-ai-starter-model-spring-ai-google-genai</artifactId>
7+
<artifactId>spring-ai-starter-model-google-genai</artifactId>
88
</dependency>
99
```
1010

spring-ai-docs/src/main/antora/modules/ROOT/nav.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
**** xref:api/chat/azure-openai-chat.adoc[Azure OpenAI]
1919
**** xref:api/chat/deepseek-chat.adoc[DeepSeek]
2020
**** xref:api/chat/dmr-chat.adoc[Docker Model Runner]
21-
**** xref:api/chat/google-vertexai.adoc[Google VertexAI]
22-
***** xref:api/chat/vertexai-gemini-chat.adoc[VertexAI Gemini]
21+
**** Google
22+
***** xref:api/chat/google-genai-chat.adoc[Google GenAI]
23+
***** xref:api/chat/google-vertexai.adoc[Google VertexAI]
24+
****** xref:api/chat/vertexai-gemini-chat.adoc[VertexAI Gemini]
2325
**** xref:api/chat/groq-chat.adoc[Groq]
2426
**** xref:api/chat/huggingface.adoc[Hugging Face]
2527
**** xref:api/chat/mistralai-chat.adoc[Mistral AI]
@@ -39,6 +41,8 @@
3941
***** xref:api/embeddings/bedrock-cohere-embedding.adoc[Cohere]
4042
***** xref:api/embeddings/bedrock-titan-embedding.adoc[Titan]
4143
**** xref:api/embeddings/azure-openai-embeddings.adoc[Azure OpenAI]
44+
**** Google
45+
***** xref:api/embeddings/google-genai-embeddings-text.adoc[Google GenAI Text Embedding]
4246
**** xref:api/embeddings/mistralai-embeddings.adoc[Mistral AI]
4347
**** xref:api/embeddings/minimax-embeddings.adoc[MiniMax]
4448
**** xref:api/embeddings/oci-genai-embeddings.adoc[OCI GenAI]

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/comparison.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This table compares various Chat Models supported by Spring AI, detailing their
2222
| xref::api/chat/anthropic-chat.adoc[Anthropic Claude] | text, pdf, image ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::no.svg[width=12] ^a| image::no.svg[width=12] ^a| image::no.svg[width=12]
2323
| xref::api/chat/azure-openai-chat.adoc[Azure OpenAI] | text, image ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::no.svg[width=12] ^a| image::yes.svg[width=16]
2424
| xref::api/chat/deepseek-chat.adoc[DeepSeek (OpenAI-proxy)] | text ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16]
25+
| xref::api/chat/google-genai-chat.adoc[Google GenAI] | text, pdf, image, audio, video ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::no.svg[width=12] ^a| image::no.svg[width=12]
2526
| xref::api/chat/vertexai-gemini-chat.adoc[Google VertexAI Gemini] | text, pdf, image, audio, video ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::no.svg[width=12] ^a| image::yes.svg[width=16]
2627
| xref::api/chat/groq-chat.adoc[Groq (OpenAI-proxy)] | text, image ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::yes.svg[width=16] ^a| image::no.svg[width=12] ^a| image::no.svg[width=12] ^a| image::yes.svg[width=16]
2728
| xref::api/chat/huggingface.adoc[HuggingFace] | text ^a| image::no.svg[width=12] ^a| image::no.svg[width=12] ^a| image::no.svg[width=12] ^a| image::no.svg[width=12] ^a| image::no.svg[width=12] ^a| image::no.svg[width=12] ^a| image::no.svg[width=12]

0 commit comments

Comments
 (0)