-
-
Notifications
You must be signed in to change notification settings - Fork 649
feat(ai): add Google Gemini LLM provider support #3968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
arkid15r
merged 34 commits into
OWASP:feature/nestbot-ai-assistant
from
rajnisk:feature/nestbot-ai-gemini-provider
Apr 25, 2026
Merged
Changes from 6 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
e8a2e7c
feat(ai): add Google Gemini LLM provider support
rajnisk c1b57b9
fix(ai): address CodeRabbit suggestions for Google embedder
rajnisk 75c422a
fix(ai): address CodeRabbit suggestions for Google embedder
rajnisk f146b16
fix(ai): address CodeRabbit/cubic-dev-ai review issues
rajnisk f20dfb8
fix(ai): fix RET503 and mypy return statement errors
rajnisk 2c345f2
fix(ai): address CodeRabbit AI review issues
rajnisk 8bbf1f4
fix(ai): address final CodeRabbit AI review issues
rajnisk 1945a9e
fix(ai): remove unnecessary error raising for REST fallback
rajnisk e11e429
fix(ai): add warning to embed_documents for consistent exception hand…
rajnisk 86b9c2f
refactor(ai): simplify Google embedder per review feedback
rajnisk 78e8722
chore: update poetry.lock for google-genai extra
rajnisk 8a46f1a
fix(ai): pass output_dimensionality via config parameter
rajnisk c92ff76
fix(ai): add defensive check for empty embeddings response
rajnisk a332a61
fix(ai): normalize 1536-dim embeddings for accurate cosine similarity
rajnisk 4d84ef7
test: fix LLM config tests for CI/CD compatibility
rajnisk aef4129
refactor: address reviewer feedback for Google Gemini integration
rajnisk 13b0fd3
Update code
rudransh-shrivastava 5f28acc
fix chunk commands to use embedder factory instead of openai
rudransh-shrivastava e7dfc6e
fix tests
rudransh-shrivastava 10beb47
Update code
rudransh-shrivastava 5eccbdc
fix: address reviewer feedback for Google Gemini integration
rajnisk c111c44
refactor: use match statement and improve normalization
rajnisk 89cecc3
Merge branch 'feature/nestbot-ai-assistant' into feature/nestbot-ai-g…
rajnisk 3a71b16
Merge branch 'feature/nestbot-ai-assistant' into feature/nestbot-ai-g…
rajnisk 729b3b4
refactor(ai): replace magic number with module-level constant for emb…
rajnisk 4c3cb43
refactor(ai): replace magic number with module-level constant for emb…
rajnisk 075c996
Merge branch 'feature/nestbot-ai-assistant' into feature/nestbot-ai-g…
rajnisk b79e318
Merge branch 'feature/nestbot-ai-assistant' into feature/nestbot-ai-g…
rajnisk 0a20047
resolve deps, tests, and coverage for Gemini PR
rajnisk dc9fd10
chore: sort coverage run.omit for pyproject-fmt
rajnisk e5ffc61
correct pyproject dependency versions
rajnisk e03abbc
correct pyproject dependency versions
rajnisk 33323ad
merge: nestbot-ai-assistant
rajnisk 17468c9
fix: address review on dockerignore and chunk tests
rajnisk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,24 @@ | ||
| """Factory function to get the configured embedder.""" | ||
|
|
||
| from django.conf import settings | ||
|
|
||
| from apps.ai.embeddings.base import Embedder | ||
| from apps.ai.embeddings.google import GoogleEmbedder | ||
| from apps.ai.embeddings.openai import OpenAIEmbedder | ||
|
|
||
|
|
||
| def get_embedder() -> Embedder: | ||
| """Get the configured embedder. | ||
|
|
||
| Currently returns OpenAI embedder, but can be extended to support | ||
| Currently returns OpenAI and Google embedder, but can be extended to support | ||
| other providers (e.g., Anthropic, Cohere, etc.). | ||
|
|
||
| Returns: | ||
| Embedder instance configured for the current provider. | ||
|
|
||
| """ | ||
| # Currently OpenAI, but can be extended to support other providers | ||
| # Currently OpenAI and Google, but can be extended to support other providers | ||
| if settings.LLM_PROVIDER == "google": | ||
| return GoogleEmbedder() | ||
|
|
||
| return OpenAIEmbedder() |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.