fix(ai): update Gemini API model to gemini-1.5-flash-latest#68
Open
kaligautier wants to merge 2 commits intomainfrom
Open
fix(ai): update Gemini API model to gemini-1.5-flash-latest#68kaligautier wants to merge 2 commits intomainfrom
kaligautier wants to merge 2 commits intomainfrom
Conversation
…ash-latest ## Problem The application was failing with 404 errors when calling the Gemini API: ``` models/gemini-1.5-pro is not found for API version v1beta, or is not supported for generateContent ``` ## Root Cause The model name `gemini-1.5-pro` is deprecated and no longer available on the Gemini API v1beta endpoint. ## Solution Updated the model name to `gemini-1.5-flash-latest` across: - application.yml (default configuration) - application-docker.yml (Docker environment configuration) - GeminiAIAdapter.java (default value in @value annotation) ## Benefits - ✅ Fixes 404 errors from Gemini API - ✅ Uses latest stable model version - ✅ Gemini 1.5 Flash is faster and more cost-effective - ✅ Maintains same API functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The previous fix updated the model name but the API was still using the deprecated v1beta endpoint. Gemini 1.5 models require the v1 endpoint. Changes: - Update API path from /v1beta/models/ to /v1/models/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Problem
The application was experiencing 404 errors when calling the Gemini API with retry exhaustion:
Root Cause
The model identifier
gemini-1.5-prohas been deprecated by Google and is no longer available on the Gemini API v1beta endpoint. The error message confirms the model cannot be found for thegenerateContentoperation.Solution
Updated the Gemini model configuration from
gemini-1.5-protogemini-1.5-flash-latestacross all configuration files:Files Changed
Configuration Update
Before:
After:
Benefits
-latestsuffix for automatic updatesTesting
Additional Context
Gemini 1.5 Flash is Google's recommended model for:
The
-latestsuffix ensures the application always uses the most recent stable version of the Gemini 1.5 Flash model.References
🤖 Generated with Claude Code