Fixes #187 : Correct Gemini API Model for generateContent
#208
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.
Description
This PR fixes a critical bug where the Gemini API call fails due to an unsupported model name (
gemini-2.5-flash-preview-04-17
).As a result, the “Discover Fact” feature was unable to generate content, even with a valid API key.
The fix ensures that the app now uses a valid, supported Gemini model (
gemini-2.5-flash-preview-05-20
) for text generation.Changes Made
GEMINI_MODEL_TEXT_GENERATION
constant to use a supported model.services/geminiService.ts
constants.ts
generateContent
method of the Gemini API.Issue Reference
Closes #187
Steps to Test
process.env.API_KEY
is set to a valid Gemini API key.Before vs After
Before:
404 NOT_FOUND error due to
gemini-2.5-flash-preview-04-17
.After:
Tech fact generated successfully with
gemini-2.5-flash-preview-05-20
.Labels
bug
fix
gssoc25
level 3
Notes
Ensuring the correct Gemini model restores the Discover Fact functionality and prevents API call failures in both development and production.