Skip to content

fix(search): make Gemini grounded model configurable (avoid hardcoded 2.0)#8

Open
DeadlySilent wants to merge 1 commit intoPyx-Corp:mainfrom
DeadlySilent:fix/configurable-gemini-grounded-model
Open

fix(search): make Gemini grounded model configurable (avoid hardcoded 2.0)#8
DeadlySilent wants to merge 1 commit intoPyx-Corp:mainfrom
DeadlySilent:fix/configurable-gemini-grounded-model

Conversation

@DeadlySilent
Copy link

Summary

Fix grounded search model selection so it no longer hardcodes gemini-2.0-flash.

Problem

In some free-tier projects, gemini-2.0-flash is quota-blocked (limit: 0) while other Gemini models (e.g. gemini-2.5-flash) are available. Spectrawl grounded search still fails because src/search/engines/gemini-grounded.js hardcoded 2.0.

Changes

  • src/search/index.js
    • add this.groundedModel resolution with precedence:
      1. search.llm.model
      2. search["gemini-grounded"].model
      3. search.gemini.model
      4. GEMINI_GROUNDED_MODEL
      5. GEMINI_MODEL
      6. fallback gemini-2.5-flash
    • add _engineConfig(engineName) so gemini engines receive merged config (model, apiKey).
  • src/search/engines/gemini-grounded.js
    • remove hardcoded gemini-2.0-flash fallback and use configurable model/env fallback.

Validation

In isolated docker trial:

  • Before patch: grounded search returned 429 quota errors on gemini-2.0-flash; no sources.
  • After patch with same key/config (gemini-2.5-flash):
    • search returned sources (5+)
    • summarize flow returned answer + sources.

Related issue

Closes #7

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.

Make Gemini Grounded model configurable (avoid hardcoded gemini-2.0-flash quota failures)

1 participant