feat(core): configure custom OpenAI embedding endpoints - #1365
Closed
mikemikimike wants to merge 2 commits into
Closed
feat(core): configure custom OpenAI embedding endpoints#1365mikemikimike wants to merge 2 commits into
mikemikimike wants to merge 2 commits into
Conversation
Signed-off-by: mikemikimike <13286568797@163.com>
Member
|
Thank you — this is exactly the fix #1336 needed: forwarding api_key/base_url to the OpenAI provider and digesting both in the cache key for openai and litellm alike. Verified locally on top of your commit: static checks clean, your two new tests plus the full provider file (32) and the whole tests/repository suite (774) pass, and there's no keyword collision with extra_kwargs. Fork PRs don't get our full test matrix (only DCO/CLA/CodeQL run), so I've cherry-picked your commit unchanged — authorship and sign-off preserved — onto an in-repo branch as #$PR to run the matrix; it'll be rebase-merged so your commit lands on |
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.
Summary
Allow the OpenAI embedding provider to use the configured
semantic_embedding_api_baseandsemantic_embedding_api_key.The provider factory now forwards both values and includes safe digests in the process cache key, preventing stale provider reuse when an endpoint or credential changes. LiteLLM cache behavior remains covered while sharing the same configuration identity rule.
Testing
uv run --frozen pytest -q -p pytest_mock tests/repository/test_openai_provider.py -k 'forwards_openai_api_configuration or separates_openai_api_cache_keys' --no-cov(2 passed)uv run --frozen ruff check src/basic_memory/repository/embedding_provider_factory.py tests/repository/test_openai_provider.pygit diff --checkFixes #1336