fix: add native Gemini embedding driver#997
Conversation
jaberjaber23
left a comment
There was a problem hiding this comment.
LGTM. Clean Gemini embedding driver with batch/single fallback, Zeroizing for API key security, proper error handling, and tests. Has merge conflicts — please rebase on main.
|
This PR has merge conflicts. Please rebase onto the latest main branch and resolve conflicts so we can merge. |
|
Thanks @chethanuk — after reviewing both your PR and #1052, we'd like to land this one as the canonical Gemini embedding driver because it handles more real-world edge cases:
Two asks before merge:
Minor nit: on error bodies, Once rebased and green, we'll merge this. Will close #1052 as the smaller subset. |
|
Reviewed: clean Gemini embedding driver add, lines up with our provider-detection pattern. Cannot merge as-is due to conflicts with main (kernel.rs context drift since the PR was opened). Please rebase and we'll land it. |
|
@chethanuk friendly nudge: still showing CONFLICTING on main (head e723c52). Two blockers from the earlier review still need addressing before we can land:
Optional but nice: swap resp.text().await.unwrap_or_default() in parse_gemini_response for an error-preserving variant so we don't lose diagnostic info on weird socket reads. Code itself still looks good: batch + single fallback with atomic mode flag, Zeroizing on api_key, gemini/google alias, dims inference, tests. Ready to merge once rebased and timeouts in. If you're out, leave a note and we can push the rebase + timeout on your branch. |
This pull request introduces support for Gemini embedding models by adding API key auto-detection for Gemini and Google, implementing a new GeminiEmbeddingDriver, and configuring default model settings. It also includes minor refactorings for MCP transport configuration and formatting cleanups in the web fetch and search modules. Feedback was provided regarding the use of unwrap_or_default() when reading response bodies, which could mask underlying network or API errors.
Summary
Validation
New Features
Bug Fixes / Reliability
Tests
Refactor