Skip to content

Conversation

ragingtitan
Copy link

@ragingtitan ragingtitan commented Aug 17, 2025

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

  • Updated GEMINI_MODEL_TEXT_GENERATION constant to use a supported model.
  • Replaced deprecated/unsupported model reference across:
    • services/geminiService.ts
    • constants.ts
  • Verified compatibility with the generateContent method of the Gemini API.

Issue Reference

Closes #187


Steps to Test

  1. Pull this branch.
  2. Ensure process.env.API_KEY is set to a valid Gemini API key.
  3. Navigate to the Giveaways page.
  4. Click “Discover Fact”.
  5. Confirm that:
    • No 404 error appears in the console.
    • A valid tech fact is generated and displayed successfully.

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.

Copy link

vercel bot commented Aug 17, 2025

@ragingtitan is attempting to deploy a commit to the Aadil Latif Team on Vercel.

A member of the Team first needs to authorize it.

@ragingtitan ragingtitan changed the title Fixes : Correct Gemini API Model for generateContent Fixes #187 : Correct Gemini API Model for generateContent Aug 17, 2025
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.

Gemini API Model Not Found for generateContent.
1 participant