mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 10:00:19 +08:00
fix(embedding): don't send encoding_format by default for OpenAI-compatible providers
SiliconFlow and other OpenAI-compatible providers reject the `encoding_format` parameter with HTTP 400. Only send it when explicitly set by the user, matching the existing opt-in pattern used for `dimensions` (send_dimensions flag). Closes #651
This commit is contained in:
@@ -167,8 +167,9 @@ class OpenAICompatibleEmbeddingAdapter(BaseEmbeddingAdapter):
|
||||
payload = {
|
||||
"input": input_payload,
|
||||
"model": model,
|
||||
"encoding_format": request.encoding_format or "float",
|
||||
}
|
||||
if request.encoding_format:
|
||||
payload["encoding_format"] = request.encoding_format
|
||||
|
||||
# `dimensions` is opt-in. The user's `send_dimensions` flag wins when set
|
||||
# explicitly (True/False); otherwise we fall back to a model-family
|
||||
|
||||
Reference in New Issue
Block a user