feat(core): configure custom OpenAI embedding endpoints - #1370
Conversation
Signed-off-by: mikemikimike <13286568797@163.com>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40942daa5f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… settings Codex review on #1370: semantic_embedding_api_base / api_key were still described as LiteLLM-only in the Pydantic field descriptions and docs/semantic-search.md, so the newly forwarded openai support was not discoverable. Update both field descriptions, the config table rows, and add an "OpenAI-compatible endpoints" subsection to the OpenAI provider docs (llama.cpp / vLLM / TEI / LM Studio / Ollama) with a runnable example and the dimensions/key caveats. Refs #1336 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017STCpbNsYjZgUdftxgEAZ4 Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Supersedes #1365 by @mikemikimike — their commit is cherry-picked here unchanged (authorship and sign-off preserved; the PR's second commit was just a merge of main and is dropped), so the full CI matrix runs. Will be rebase-merged so the commit lands on
mainas-is.Fixes #1336.
What it does
The
openaiembedding provider now usessemantic_embedding_api_base/semantic_embedding_api_key, so it can point at any OpenAI-compatible endpoint (llama.cpp, vLLM, TEI, LM Studio, Ollama's shim) via the stable provider instead of the experimental litellm path.create_embedding_providerforwardsapi_key/base_urltoOpenAIEmbeddingProviderin theopenaibranch._provider_cache_keynow digests those two config values for bothopenaiandlitellm, so switching endpoint or credential in-process doesn't reuse a stale provider.This is exactly the two-step change scoped on #1336.
Review notes (verified locally)
OpenAIEmbeddingProvideralready acceptsapi_key/base_urland stores them as_api_key/_base_url(what the new tests assert). Both are None-safe: an absent key falls back toOPENAI_API_KEY(then errors if still missing), an absent base_url uses the default OpenAI endpoint — so default OpenAI usage is unchanged.extra_kwargsonly ever carriesdimensions, neverapi_key/base_url.Verification
ruff check/ruff format --check/ty check src tests test-int— clean (the onlytydiagnostics are the pre-existingpymilvusoptional-extra imports).tests/repository/test_openai_provider.py— 32 passed (incl. the 2 new tests: config forwarded to the provider; cache key changes with api_base and with api_key).tests/repositorysweep — 774 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_017STCpbNsYjZgUdftxgEAZ4