feat: Add API key support for Ollama Embedder Provider #8738
+346
−11
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.
Related GitHub Issue
Closes: #8737
Roo Code Task Context (Optional)
This PR was created with assistance from Roo Code to address the feature request.
Description
This PR adds API key support to the Ollama Embedder Provider, enabling authentication with remote protected Ollama instances. The implementation:
ollamaApiKeyparameter to theCodeIndexOllamaEmbedderclassKey implementation details:
Test Procedure
Manual Testing Steps:
Automated Tests:
src/services/code-index/embedders/__tests__/ollama.spec.tsPre-Submission Checklist
Screenshots / Videos
This is primarily a backend change with minimal UI impact. The only visible change is the addition of an API key field in the Code Index settings when Ollama is selected as the embedder provider, which follows the same pattern as other providers.
Documentation Updates
Additional Notes
This implementation provides feature parity with other embedder providers by adding the requested API key support. The changes are minimal and focused, following existing patterns in the codebase to ensure consistency and maintainability.
Get in Touch
For any questions about this PR, please reach out through the GitHub issue comments.
Important
Adds API key support for Ollama Embedder Provider, enabling secure authentication with remote instances.
ollamaApiKeyparameter toCodeIndexOllamaEmbedderfor API key support.codebaseIndexProviderSchemaandglobal-settings.tsto includecodebaseIndexOllamaApiKey.CodeIndexPopover.tsxfor Ollama settings.ollama.spec.tsfor API key authentication scenarios.webviewMessageHandler.tsto handle API key storage and retrieval.This description was created by
for f3102f8. You can customize this summary. It will automatically update as commits are pushed.