← Back to PRs

#17701: fix(memory-lancedb): add gemini-embedding-001 and baseUrl support

by Phineas1500 open 2026-02-16 03:15 View on GitHub →
extensions: memory-lancedb stale size: S
## Summary - Adds `gemini-embedding-001` (3072 dims) to the allowed embedding models - Introduces `baseUrl` config option so users can point to Google's OpenAI-compatible endpoint (`https://generativelanguage.googleapis.com/v1beta/openai`) or any other compatible API - Applies `resolveEnvVars` to `baseUrl` for `${ENV_VAR}` substitution, consistent with `apiKey` handling Closes #17650 ## Improvements over #17696 This PR addresses review feedback from #17696 that was left unresolved: 1. **`resolveEnvVars` on `baseUrl`** ([Copilot review](https://github.com/openclaw/openclaw/pull/17696#discussion_r2810471760)): `baseUrl` now supports `${ENV_VAR}` substitution, consistent with how `apiKey` is handled 2. **Missing `uiHints` in `config.ts`** ([Greptile review](https://github.com/openclaw/openclaw/pull/17696#issuecomment-3906198131)): Added `embedding.baseUrl` uiHints entry in `config.ts` to match `openclaw.plugin.json` 3. **Inconsistent help text** ([Greptile review](https://github.com/openclaw/openclaw/pull/17696#issuecomment-3906198131)): Updated `embedding.model` help to `"Embedding model to use (OpenAI or Gemini)"` in both `config.ts` and `openclaw.plugin.json` 4. **No test coverage**: Added two new tests — config accepts `gemini-embedding-001` with `baseUrl`, and env var resolution works on `baseUrl` ## Changes - **config.ts**: Add `gemini-embedding-001` to `EMBEDDING_DIMENSIONS`, add `baseUrl` to type/parser/`assertAllowedKeys`, apply `resolveEnvVars`, add `uiHints`, update model help text - **index.ts**: Pass `baseUrl` through `Embeddings` constructor to `OpenAI` client - **openclaw.plugin.json**: Add `gemini-embedding-001` to enum, add `baseUrl` property, add uiHint, update model help text - **index.test.ts**: Add tests for gemini model + baseUrl config and env var resolution on baseUrl ## Test plan - [x] `pnpm vitest run extensions/memory-lancedb/` — 13 passed, 1 skipped (live test) - [x] `pnpm build` passes - [x] `pnpm oxfmt --check` passes on changed files <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds `gemini-embedding-001` (3072 dims) to the memory-lancedb plugin's allowed embedding models and introduces a `baseUrl` config option for pointing to Google's OpenAI-compatible endpoint or other compatible APIs. Environment variable substitution is applied to `baseUrl` consistent with `apiKey` handling. - `config.ts`: Adds `gemini-embedding-001` to `EMBEDDING_DIMENSIONS`, adds `baseUrl` to the type/parser/allowed keys, applies `resolveEnvVars`, and adds `uiHints` - `index.ts`: Passes `baseUrl` through the `Embeddings` constructor to the `OpenAI` client as `baseURL` - `openclaw.plugin.json`: Adds `gemini-embedding-001` to the model enum, adds `baseUrl` property and uiHint - `index.test.ts`: Adds tests for gemini model + baseUrl config parsing and env var resolution on baseUrl - All four files are consistent with each other and follow existing patterns in the codebase <h3>Confidence Score: 4/5</h3> - This PR is safe to merge — it adds straightforward config options with proper validation and test coverage. - The changes are well-contained to four files in a single extension, follow existing patterns (env var resolution, allowed keys validation, uiHints), and include test coverage. The new model entry and baseUrl passthrough are simple additions that don't modify existing behavior. No logical errors, security concerns, or breaking changes found. - No files require special attention. <sub>Last reviewed commit: e8b770e</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs