feat: support env-var source for embedding provider api_key#82
Open
ericfitz wants to merge 5 commits into
Open
feat: support env-var source for embedding provider api_key#82ericfitz wants to merge 5 commits into
ericfitz wants to merge 5 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PCya964sBj74JUSC7WXVqj
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PCya964sBj74JUSC7WXVqj
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PCya964sBj74JUSC7WXVqj
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PCya964sBj74JUSC7WXVqj
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PCya964sBj74JUSC7WXVqj
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #81.
Summary
Adds an optional
api_key_envfield tovector.embeddernaming an environment variable to source the provider API key from, so the secret no longer needs to live in plaintext inconfig.json. Follow-up to the #78 review discussion.Behavior
load_vector_config(); the value lands in the existingEmbedderConfig.api_keyfield, socreate_embedderand the vector runtime are untouched.api_key.api_keypresent → falls back to the plaintext key, with a warning.openai-compatibletoo: naming a variable signals intent to authenticate, so we don't silently proceed unauthenticated.api_keyconfigs work unchanged (pinned by a regression test).Acceptance criteria from #81
api_key_env)api_keyVECTOR_SEARCH.mdprovider setup docs recommend the env-var pathapi_keyconfigs keep working unchangedTesting
12 new unit tests in
tests/unit/vector/test_config.pycovering every resolution branch (env-only, precedence, fallback, no-fallback for both hosted providers, blank-is-unset, invalidapi_key_envtypes, plaintext back-compat). Full unit suite: 588 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01PCya964sBj74JUSC7WXVqj