Skip to content

LEADS-113: Added support for gemini embedding models#99

Merged
tisnik merged 1 commit intolightspeed-core:mainfrom
bsatapat-jpg:dev
Nov 11, 2025
Merged

LEADS-113: Added support for gemini embedding models#99
tisnik merged 1 commit intolightspeed-core:mainfrom
bsatapat-jpg:dev

Conversation

@bsatapat-jpg
Copy link
Collaborator

@bsatapat-jpg bsatapat-jpg commented Nov 11, 2025

Issue Link : https://issues.redhat.com/browse/LEADS-113

Summary by CodeRabbit

  • New Features

    • Added Google Gemini as a supported embedding provider alongside OpenAI and HuggingFace.
    • Embedding configuration now validates Gemini provider environments.
  • Chores

    • Added langchain-google-genai>=2.0.0 dependency.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 11, 2025

Walkthrough

Adds Gemini (Google Generative AI) embedding provider support: dependency added, provider allowed in config validation, environment validation added in EmbeddingManager, and ragas provider mapping wired to the GoogleGenerativeAIEmbeddings class.

Changes

Cohort / File(s) Summary
Dependency Management
pyproject.toml
Added langchain-google-genai>=2.0.0 to project dependencies.
Embedding Provider Validation
src/lightspeed_evaluation/core/embedding/manager.py
Added "gemini" branch in EmbeddingManager._validate_config to call validate_provider_env("gemini").
Embedding Integration
src/lightspeed_evaluation/core/embedding/ragas.py
Imported GoogleGenerativeAIEmbeddings and added "gemini" mapping to the provider → embedding class selection.
Configuration Model
src/lightspeed_evaluation/core/models/system.py
Extended EmbeddingConfig._validate_provider to accept "gemini" alongside existing providers.

Sequence Diagram(s)

sequenceDiagram
  participant Config as EmbeddingConfig
  participant Manager as EmbeddingManager
  participant Ragas as RagasEmbeddingManager
  participant Provider as GoogleGenerativeAIEmbeddings

  note over Config,Manager `#DDFFDD`: Validation flow (new "gemini")
  Config->>Manager: provide embedding provider "gemini"
  Manager->>Manager: _validate_config() -> validate_provider_env("gemini")
  Manager-->>Ragas: request embedding class for "gemini"
  Ragas->>Provider: instantiate GoogleGenerativeAIEmbeddings(model, kwargs)
  Provider-->>Ragas: embedding instance
  Ragas-->>Manager: return embedding instance
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Review points: dependency addition in pyproject.toml; ensure import path langchain_google_genai matches packaging; confirm no missing runtime env validation helper for "gemini".

Possibly related PRs

Suggested reviewers

  • asamal4
  • tisnik

Poem

🐰 A hop, a nibble, now Gemini's in tow,
New embeddings bloom where our mappings go,
Configs checked, the manager sends a call,
A gentle rabbit cheers — embeddings for all! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding support for Gemini embedding models, which aligns with all the modifications across the codebase (dependency addition, provider validation, embedding mapping, and config extension).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de4cd09 and 1772619.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • pyproject.toml (1 hunks)
  • src/lightspeed_evaluation/core/embedding/manager.py (1 hunks)
  • src/lightspeed_evaluation/core/embedding/ragas.py (2 hunks)
  • src/lightspeed_evaluation/core/models/system.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • pyproject.toml
  • src/lightspeed_evaluation/core/embedding/manager.py
  • src/lightspeed_evaluation/core/models/system.py
  • src/lightspeed_evaluation/core/embedding/ragas.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: mypy
  • GitHub Check: tests (3.12)
  • GitHub Check: tests (3.13)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/lightspeed_evaluation/core/models/system.py (1)

109-113: Update provider description to mention Gemini.

Now that "gemini" is accepted, please refresh the EmbeddingConfig.provider field description (Line 86) so it lists Gemini alongside the existing examples to avoid confusing users reading the schema.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 55ae93c and de4cd09.

📒 Files selected for processing (4)
  • pyproject.toml (1 hunks)
  • src/lightspeed_evaluation/core/embedding/manager.py (1 hunks)
  • src/lightspeed_evaluation/core/embedding/ragas.py (2 hunks)
  • src/lightspeed_evaluation/core/models/system.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/lightspeed_evaluation/**

📄 CodeRabbit inference engine (AGENTS.md)

Add all new evaluation features under src/lightspeed_evaluation/ (do not add new features elsewhere)

Files:

  • src/lightspeed_evaluation/core/models/system.py
  • src/lightspeed_evaluation/core/embedding/manager.py
  • src/lightspeed_evaluation/core/embedding/ragas.py
src/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.py: Require type hints for all public functions and methods
Use Google-style docstrings for all public APIs
Use custom exceptions from core.system.exceptions for error handling
Use structured logging with appropriate levels

Files:

  • src/lightspeed_evaluation/core/models/system.py
  • src/lightspeed_evaluation/core/embedding/manager.py
  • src/lightspeed_evaluation/core/embedding/ragas.py
🧬 Code graph analysis (1)
src/lightspeed_evaluation/core/embedding/manager.py (1)
src/lightspeed_evaluation/core/system/env_validator.py (1)
  • validate_provider_env (74-95)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: pydocstyle
  • GitHub Check: mypy
🔇 Additional comments (3)
pyproject.toml (1)

30-32: Dependency addition aligns with new import.

Including langchain-google-genai>=2.0.0 guarantees the new Gemini embedding class is available at runtime. Thanks for wiring this in.

src/lightspeed_evaluation/core/embedding/ragas.py (1)

3-37: Gemini mapping looks solid.

The added import and provider mapping cleanly integrate Gemini with the existing wrapper/caching flow. Nice work keeping the kwargs passthrough intact.

src/lightspeed_evaluation/core/embedding/manager.py (1)

27-30: Env validation updated appropriately.

Adding the Gemini branch keeps config validation consistent with the other providers and leverages the existing env checks. Looks good.

Copy link
Collaborator

@asamal4 asamal4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

@tisnik tisnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tisnik tisnik merged commit c91d444 into lightspeed-core:main Nov 11, 2025
15 checks passed
@bsatapat-jpg bsatapat-jpg deleted the dev branch November 11, 2025 12:32
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.

3 participants