Conversation
Left unset, the OpenAI SDK negotiates base64, and gateways fronting non-OpenAI providers reject the parameter outright — litellm to Vertex AI fails every call for gemini-embedding-001 with UnsupportedParamsError. 'float' is the API default and the portable choice. Separate from the driver commit because this is shared core code affecting every backend, not the PostGraph driver, and should be reviewable or droppable on its own.
linhongyu510
approved these changes
Aug 30, 2026
linhongyu510
left a comment
There was a problem hiding this comment.
Verified the current head. Both create() and create_batch() now pass encoding_format="float" explicitly, while preserving model/input handling and embedding-dimension truncation. This matches the OpenAI embeddings API contract and avoids SDK-side base64 negotiation for compatible gateways. Local validation: pytest tests/embedder/test_openai.py -q — 2 passed; an additional focused mock check confirmed the keyword on both call paths; Ruff check/format and git diff --check passed. No blocking issue found. Non-blocking: the existing tests do not assert encoding_format, so adding those assertions would make the regression coverage durable.
This branch has not been deployed
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.
Problem
OpenAIEmbeddercallsembeddings.create()without specifyingencoding_format. Left unset, the OpenAI SDK negotiates base64 on its own — and gateways fronting non-OpenAI providers reject the parameter outright:Every embedding call fails, so ingestion cannot proceed at all behind such a gateway. Hit in practice with LiteLLM proxying to Vertex AI for
gemini-embedding-001.Fix
Pin
encoding_format='float'on bothcreate()andcreate_batch(). It is the API default and the portable choice, so this is a no-op against OpenAI itself while unblocking OpenAI-compatible gateways.Notes
OpenAIEmbedderConfigexposes no way to pass the parameter through.