Skip to content

Fixes #3824, 3849 - New Google Gen AI Embedding Module, Starters for GenAI and GenAI EMbedding Module and support for ThinkingBudget#3914

Closed
ddobrin wants to merge 5 commits intospring-projects:mainfrom
ddobrin:main
Closed

Fixes #3824, 3849 - New Google Gen AI Embedding Module, Starters for GenAI and GenAI EMbedding Module and support for ThinkingBudget#3914
ddobrin wants to merge 5 commits intospring-projects:mainfrom
ddobrin:main

Conversation

@ddobrin
Copy link
Contributor

@ddobrin ddobrin commented Jul 25, 2025

This PR introduces comprehensive support for Google's latest Unified SDK with text embedding capabilities and enhances the existing chat model functionality.

Key Changes:

  1. New Google Gen AI Text Embedding Support (Support latest Google Unified SDK to access Google AI Embedding Models #3824)
    - Added a new spring-ai-google-genai-embedding module with full text embedding model implementation
    - Supports Google's text embedding models (text-embedding-005, text-embedding-004, gemini-embedding-001) with configurable options
    - Includes comprehensive test coverage with retry logic and observability support

  2. Spring Boot Starter for Google Gen AI (Support latest Google Unified SDK to access Google AI Embedding Models #3824)
    - Created spring-ai-autoconfigure-model-google-genai module with auto-configuration for both chat and embedding models
    - Provides property-based configuration for easy integration
    - Includes migration guide and extensive integration tests

  3. Thinking Configuration Support (Add Thinking Config and Content Caching to the Google Gen AI Module #3849)
    - Enhanced Google Gen AI chat model with thinking/reasoning configuration in the spring-ai-google-genai module
    - Added support for configurable thinking parameters in chat options
    - Enables advanced reasoning capabilities in the chat model

ddobrin added 3 commits July 24, 2025 21:52
…odule

Signed-off-by: ddobrin <ddobrin@google.com>
…ess Google AI Embedding Models - text embeddings

Signed-off-by: ddobrin <ddobrin@google.com>
…re-genai-embedding modules

Signed-off-by: ddobrin <ddobrin@google.com>
ddobrin added 2 commits July 29, 2025 09:33
Signed-off-by: ddobrin <ddobrin@google.com>
Signed-off-by: ddobrin <ddobrin@google.com>
@markpollack
Copy link
Member

thank you very much!

merged in 085446c

@markpollack markpollack closed this Aug 5, 2025
Lewik added a commit to Lewik/gromozeka that referenced this pull request Nov 7, 2025
…ound

- Migrate to Spring AI snapshot 1.1.0-20251106.200546-785 with google-genai module
- Add GoogleGenAiGeminiChatModelWithWorkarounds to fix two Spring AI limitations:
  1. Extract thought summaries from Gemini API (Spring AI ignores thought parts)
  2. Fix empty tool call IDs causing protobuf errors (inject UUIDs)
- Override responseCandidateToGeneration() to manually process all part types
- Override createGeminiRequest() to inject includeThoughts(true) via toBuilder()
- Add usage logging for thinking tokens (GoogleGenAiUsage)
- Update GeminiConfig with .vertexAI(true) for Vertex AI authentication
- Migrate application.yaml from vertex-ai-gemini to google-genai configuration
- Remove old VertexAiGeminiChatModelWithIdFix (replaced by unified workaround)

Related issues:
- spring-projects/spring-ai#4629 (empty tool call IDs)
- spring-projects/spring-ai#3914 (thinking support PR)

Thinking blocks now visible in UI with metadata["thinking"]=true protocol.
Verified with 4 thinking blocks extracted and thoughts=490/300 tokens logged.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants