LEADS-113: Added support for gemini embedding models#99
LEADS-113: Added support for gemini embedding models#99tisnik merged 1 commit intolightspeed-core:mainfrom
Conversation
WalkthroughAdds 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ 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)
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. Comment |
There was a problem hiding this comment.
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 theEmbeddingConfig.providerfield 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
📒 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.pysrc/lightspeed_evaluation/core/embedding/manager.pysrc/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.pysrc/lightspeed_evaluation/core/embedding/manager.pysrc/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.0guarantees 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.
Issue Link : https://issues.redhat.com/browse/LEADS-113
Summary by CodeRabbit
New Features
Chores